﻿/**
 * Auth — Clean Professional Login
 * Centered form · Soft animated background · Lighter palette
 * Dark mode (deep purple twilight) + Light mode (pastel aurora)
 */

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ══════════════════════════════════════════════════════════
   ░░ 1. PAGE BACKGROUND ░░
══════════════════════════════════════════════════════════ */
.authentication-wrapper.authentication-bg.auth-page {
    position: relative;
    display: block !important;       /* override vendor flex */
    width: 100%;
    min-height: 100vh;
    /* Dark default — deep purple twilight, not pitch black */
    background: linear-gradient(135deg,
        #1a1638 0%,
        #221d4a 30%,
        #2a2458 65%,
        #1c1838 100%) !important;
    overflow: hidden;
}
html.light-style .authentication-wrapper.authentication-bg.auth-page {
    background: linear-gradient(135deg,
        #fafbff 0%,
        #f3f1ff 28%,
        #fdf4ff 60%,
        #f0f4ff 100%) !important;
}

/* ══════════════════════════════════════════════════════════
   ░░ 2. FULL-VIEWPORT ANIMATED BG STAGE ░░
══════════════════════════════════════════════════════════ */
.auth-bg-stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.auth-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
}

/* Soft blobs — only 3, gentle pastels */
.auth-blob {
    position: absolute;
    pointer-events: none;
    will-change: transform, border-radius;
}
.auth-blob-1 {
    width: 720px; height: 600px;
    top: -10%; right: -8%;
    background: radial-gradient(circle at 40% 40%,
        rgba(115,103,240,.42) 0%,
        rgba(115,103,240,.04) 70%);
    filter: blur(95px);
    animation: blob1 14s ease-in-out infinite;
}
.auth-blob-2 {
    width: 640px; height: 540px;
    bottom: -12%; left: -8%;
    background: radial-gradient(circle at 60% 50%,
        rgba(0,207,232,.36) 0%,
        rgba(0,207,232,.04) 70%);
    filter: blur(100px);
    animation: blob2 11s ease-in-out infinite;
    animation-delay: -3.5s;
}
.auth-blob-3 {
    width: 480px; height: 420px;
    top: 38%; left: 42%;
    background: radial-gradient(circle at 50% 50%,
        rgba(190,165,255,.28) 0%,
        rgba(140,110,255,.02) 70%);
    filter: blur(80px);
    animation: blob3 17s ease-in-out infinite;
    animation-delay: -8s;
}

/* Subtle dot grid */
.auth-dot-grid {
    position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 32px 32px;
}
html.light-style .auth-dot-grid {
    background-image: radial-gradient(circle, rgba(115,103,240,.08) 1px, transparent 1px);
}

/* Light-mode blob retuning — slightly more saturated */
html.light-style .auth-blob-1 {
    background: radial-gradient(circle at 40% 40%,
        rgba(115,103,240,.45) 0%,
        rgba(115,103,240,.04) 70%);
}
html.light-style .auth-blob-2 {
    background: radial-gradient(circle at 60% 50%,
        rgba(0,207,232,.45) 0%,
        rgba(0,207,232,.04) 70%);
}
html.light-style .auth-blob-3 {
    background: radial-gradient(circle at 50% 50%,
        rgba(255,160,200,.30) 0%,
        rgba(255,160,200,.02) 70%);
}

/* ══════════════════════════════════════════════════════════
   ░░ 3. CENTERED STAGE ░░
══════════════════════════════════════════════════════════ */
.auth-stage-center {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    animation: fade-up .7s cubic-bezier(0,0,.2,1) .15s both;
}

/* ══════════════════════════════════════════════════════════
   ░░ 4. FLOATING CONTROLS (lang + theme) ░░
══════════════════════════════════════════════════════════ */
.auth-controls-row {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    display: flex; align-items: center; gap: .5rem;
    z-index: 100;
}
[dir="rtl"] .auth-controls-row {
    right: auto;
    left: 1.25rem;
}

.auth-controls-row .nav-link,
.auth-controls-row .nav-link i { color: rgba(255,255,255,.88) !important; }

.auth-controls-row .dropdown-toggle {
    background: rgba(255,255,255,.10) !important;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.16) !important;
    border-radius: var(--radius-md) !important;
    padding: .45rem .7rem !important;
    transition: background .2s, border-color .2s, transform .2s var(--ease-bounce);
}
.auth-controls-row .dropdown-toggle:hover {
    background: rgba(255,255,255,.20) !important;
    transform: translateY(-2px);
}

html.light-style .auth-controls-row .nav-link,
html.light-style .auth-controls-row .nav-link i { color: #3b3766 !important; }
html.light-style .auth-controls-row .dropdown-toggle {
    background: rgba(255,255,255,.85) !important;
    border: 1px solid rgba(115,103,240,.18) !important;
    box-shadow: 0 4px 16px rgba(115,103,240,.10);
}
html.light-style .auth-controls-row .dropdown-toggle:hover {
    background: rgba(255,255,255,.98) !important;
}

/* ══════════════════════════════════════════════════════════
   ░░ 5. GLASS CARD ░░
══════════════════════════════════════════════════════════ */
.auth-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    /* Dark — lighter glass on softer dark bg */
    background: rgba(255,255,255,.075);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255,255,255,.16);
    padding: 3rem 2.5rem 2.5rem;
    box-shadow:
        inset 0 1px 0   rgba(255,255,255,.10),
        inset 0 0 0 .5px rgba(255,255,255,.08),
        0 24px 60px rgba(0,0,0,.40),
        0 4px 16px rgba(115,103,240,.18);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
@media (max-width: 575.98px) {
    .auth-card { padding: 2.25rem 1.5rem 1.75rem; }
}

/* Animated conic-gradient border (subtle) */
.auth-card::before {
    content: '';
    position: absolute; inset: -1.5px;
    border-radius: calc(var(--radius-xl) + 2px);
    background: conic-gradient(from var(--angle, 0deg),
        rgba(115,103,240,0)   0deg,
        rgba(115,103,240,.55) 70deg,
        rgba(0,207,232,.45)  140deg,
        rgba(115,103,240,0)  210deg,
        rgba(115,103,240,0)  360deg);
    animation: border-spin 7s linear infinite;
    z-index: -1;
    opacity: 0;
    transition: opacity .4s;
}
.auth-card:hover::before { opacity: 1; }

/* Inner top glow */
.auth-card::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% -10%,
        rgba(115,103,240,.16) 0%, transparent 65%);
    border-radius: var(--radius-xl);
    pointer-events: none; z-index: 0;
}
.auth-card > * { position: relative; z-index: 1; }

/* Light-mode card */
html.light-style .auth-card {
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(255,255,255,.95);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.95),
        inset 0 0 0 .5px rgba(115,103,240,.10),
        0 24px 70px rgba(115,103,240,.18),
        0 6px 20px rgba(115,103,240,.08);
}
html.light-style .auth-card::after {
    background: radial-gradient(ellipse at 50% -10%,
        rgba(115,103,240,.10) 0%, transparent 65%);
}

/* ══════════════════════════════════════════════════════════
   ░░ 6. FORM HEADER (logo + title) ░░
══════════════════════════════════════════════════════════ */
.auth-brand-wrap {
    display: flex; justify-content: center; margin-bottom: 1.85rem;
}
.auth-logo-ring-wrap {
    position: relative;
    display: inline-flex; justify-content: center; align-items: center;
}
.auth-logo-pulse {
    position: absolute; border-radius: 50%;
    width: 88px; height: 88px;
    border: 1.5px solid rgba(115,103,240,.55);
}
.auth-logo-pulse:nth-child(1) { animation: ring-pulse 2.4s ease-out 0s    infinite; }
.auth-logo-pulse:nth-child(2) { animation: ring-pulse 2.4s ease-out .8s   infinite; }
.auth-logo-pulse:nth-child(3) { animation: ring-pulse 2.4s ease-out 1.6s  infinite; border-color: rgba(0,207,232,.40); }

.auth-logo-inner {
    position: relative; z-index: 2;
    width: 84px; height: 84px;
    background: rgba(115,103,240,.16);
    border: 1px solid rgba(115,103,240,.38);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 36px rgba(115,103,240,.34);
}
.auth-logo-inner img { width: 52px; height: 52px; object-fit: contain; }

html.light-style .auth-logo-inner {
    background: rgba(115,103,240,.10);
    border-color: rgba(115,103,240,.42);
    box-shadow: 0 0 32px rgba(115,103,240,.26);
}

.auth-title {
    color: #fff !important;
    font-size: 1.7rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    margin-bottom: .4rem !important;
    letter-spacing: -.02em;
    text-shadow: 0 0 30px rgba(157,143,255,.40);
}
.auth-subtitle {
    color: rgba(255,255,255,.62) !important;
    text-align: center !important;
    margin-bottom: 2rem !important;
    font-size: .95rem;
}
html.light-style .auth-title {
    color: #1f1c45 !important;
    text-shadow: 0 0 24px rgba(115,103,240,.16);
}
html.light-style .auth-subtitle {
    color: rgba(40,38,80,.62) !important;
}

/* ══════════════════════════════════════════════════════════
   ░░ 7. FLOATING-LABEL INPUTS ░░
══════════════════════════════════════════════════════════ */
.auth-field { position: relative; margin-bottom: 1.4rem; }

.auth-field-input {
    width: 100%; height: 62px;
    background: rgba(15,12,40,.35) !important;
    border: 1.5px solid rgba(255,255,255,.20) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1.55rem 1rem .5rem 3rem !important;
    color: #fff !important;
    font-size: .95rem; font-weight: 500;
    letter-spacing: .015em;
    outline: none;
    box-shadow: none !important;
    transition: background .25s, border-color .25s, box-shadow .25s;
    -webkit-appearance: none;
}
[dir="rtl"] .auth-field-input { padding: 1.55rem 3rem .5rem 1rem !important; }

.auth-field-input:-webkit-autofill,
.auth-field-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 60px #1a1638 inset;
    caret-color: #fff;
    transition: background-color 5000s;
}
.auth-field-input:focus {
    background: rgba(115,103,240,.12) !important;
    border-color: var(--color-brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--color-brand-primary-rgb),.22) !important;
}

.auth-field-label {
    position: absolute;
    left: 3rem; top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.50);
    font-size: .95rem;
    pointer-events: none;
    transition: all .22s cubic-bezier(0,0,.2,1);
    transform-origin: left center;
    z-index: 2;
}
[dir="rtl"] .auth-field-label { left: auto; right: 3rem; transform-origin: right center; }

.auth-field-input:focus          ~ .auth-field-label,
.auth-field-input:not(:placeholder-shown) ~ .auth-field-label {
    top: .9rem;
    transform: translateY(0) scale(.76);
    color: var(--color-brand-primary);
}

.auth-field-icon {
    position: absolute; left: 1rem; top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.38);
    font-size: 1.2rem; z-index: 3;
    pointer-events: none;
    transition: color .22s, transform .22s var(--ease-bounce);
}
[dir="rtl"] .auth-field-icon { left: auto; right: 1rem; }

.auth-field:has(.auth-field-input:focus) .auth-field-icon,
.auth-field:has(.auth-field-input:not(:placeholder-shown)) .auth-field-icon {
    color: var(--color-brand-primary);
    transform: translateY(-50%) scale(1.15);
}

.auth-eye-toggle {
    position: absolute; right: 1rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; padding: .25rem;
    color: rgba(255,255,255,.38); cursor: pointer; font-size: 1.15rem;
    z-index: 4; display: flex; align-items: center;
    transition: color .2s;
}
[dir="rtl"] .auth-eye-toggle { right: auto; left: 1rem; }
.auth-eye-toggle:hover { color: rgba(255,255,255,.78); }

/* Light-mode inputs */
html.light-style .auth-field-input {
    background: rgba(255,255,255,.85) !important;
    border: 1.5px solid rgba(115,103,240,.18) !important;
    color: #1f1c45 !important;
}
html.light-style .auth-field-input:-webkit-autofill,
html.light-style .auth-field-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #1f1c45;
    -webkit-box-shadow: 0 0 0 60px #ffffff inset;
}
html.light-style .auth-field-input:focus {
    background: #fff !important;
    border-color: var(--color-brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--color-brand-primary-rgb),.16) !important;
}
html.light-style .auth-field-label { color: rgba(40,38,80,.48); }
html.light-style .auth-field-icon  { color: rgba(40,38,80,.38); }
html.light-style .auth-eye-toggle  { color: rgba(40,38,80,.42); }
html.light-style .auth-eye-toggle:hover { color: #1f1c45; }

/* ══════════════════════════════════════════════════════════
   VALIDATION ERROR STATE — ADVANCED
   Animated gradient border · pulsing glow · icon badge ·
   shake on appearance · premium message bubble
══════════════════════════════════════════════════════════ */
.auth-field.issue { position: relative; }

/* Pulsing gradient wrap behind the invalid input */
.auth-field.issue::before {
    content: '';
    position: absolute;
    inset: 0;
    height: 62px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg,
        rgba(255,107,138,.45) 0%,
        rgba(255,90,140,.20)  35%,
        rgba(255,138,107,.40) 70%,
        rgba(255,107,138,.45) 100%);
    background-size: 220% 220%;
    z-index: 0;
    animation: err-gradient 3.5s ease infinite, err-shake .55s var(--ease-out);
    pointer-events: none;
    filter: blur(.5px);
}
@keyframes err-gradient {
    0%,100% { background-position:   0%   0%; }
    50%      { background-position: 100% 100%; }
}
@keyframes err-shake {
    0%,100% { transform: translateX(0);    }
    18%      { transform: translateX(-7px); }
    36%      { transform: translateX(6px);  }
    54%      { transform: translateX(-4px); }
    72%      { transform: translateX(3px);  }
    90%      { transform: translateX(-1px); }
}

.auth-field-input.is-invalid {
    position: relative;
    z-index: 1;
    border-color: rgba(255,107,138,.65) !important;
    background:
        linear-gradient(135deg,
            rgba(255,107,138,.10) 0%,
            rgba(255,90,140,.06)  50%,
            rgba(255,107,138,.10) 100%),
        rgba(15,12,40,.55) !important;
    box-shadow:
        0 0 0 3px rgba(255,107,138,.20),
        inset 0 0 22px rgba(255,107,138,.08),
        0 4px 20px rgba(255,107,138,.22) !important;
}
.auth-field-input.is-invalid:focus {
    border-color: #ff6b8a !important;
    box-shadow:
        0 0 0 3px rgba(255,107,138,.32),
        inset 0 0 28px rgba(255,107,138,.10),
        0 6px 28px rgba(255,107,138,.36) !important;
}

.auth-field.issue .auth-field-icon {
    color: #ff6b8a !important;
    text-shadow: 0 0 12px rgba(255,107,138,.7);
    animation: err-icon-bob 1.6s ease-in-out infinite;
}
@keyframes err-icon-bob {
    0%,100% { transform: translateY(-50%) scale(1);    }
    50%      { transform: translateY(-50%) scale(1.16); }
}

.auth-field.issue .auth-field-label,
.auth-field-input.is-invalid:focus       ~ .auth-field-label,
.auth-field-input.is-invalid:not(:placeholder-shown) ~ .auth-field-label {
    color: #ff6b8a !important;
    text-shadow: 0 0 10px rgba(255,107,138,.45);
}

/* ── Help block — premium message bubble ─────────── */
.help-block {
    margin: .55rem .15rem 0;
    min-height: 0;
    position: relative;
    z-index: 2;
}
.help-block:empty { margin: 0; }
.help-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.help-block li {
    color: #ff7d99 !important;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.35;
    padding: .42rem .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    background:
        linear-gradient(135deg,
            rgba(255,107,138,.14) 0%,
            rgba(255,90,140,.07)  100%);
    border-left: 2.5px solid #ff6b8a;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow:
        0 2px 12px rgba(255,107,138,.12),
        inset 0 0 0 .5px rgba(255,107,138,.18);
    animation: err-slide .4s var(--ease-bounce);
}
[dir="rtl"] .help-block li {
    border-left: none;
    border-right: 2.5px solid #ff6b8a;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* Animated alert badge `!` before each message */
.help-block li::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    background: linear-gradient(135deg, #ff7d99 0%, #ff5577 100%);
    color: #1a1638;
    border-radius: 50%;
    font-size: .72rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 0 14px rgba(255,107,138,.65);
    animation: alert-pulse 1.6s ease-in-out infinite;
}

@keyframes err-slide {
    from { opacity: 0; transform: translateY(-6px) scale(.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
@keyframes alert-pulse {
    0%,100% { transform: scale(1);    box-shadow: 0 0 14px rgba(255,107,138,.55); }
    50%      { transform: scale(1.18); box-shadow: 0 0 22px rgba(255,107,138,.95); }
}

/* ══════════════════════════════════════════════════════════
   LIGHT-MODE — softer red palette
══════════════════════════════════════════════════════════ */
html.light-style .auth-field.issue::before {
    background: linear-gradient(135deg,
        rgba(220,53,69,.30) 0%,
        rgba(255,90,120,.18) 35%,
        rgba(255,120,90,.28) 70%,
        rgba(220,53,69,.30) 100%);
}
html.light-style .auth-field-input.is-invalid {
    border-color: #dc3545 !important;
    background:
        linear-gradient(135deg,
            rgba(220,53,69,.06) 0%,
            rgba(220,53,69,.03) 50%,
            rgba(220,53,69,.06) 100%),
        rgba(255,255,255,.85) !important;
    box-shadow:
        0 0 0 3px rgba(220,53,69,.14),
        inset 0 0 18px rgba(220,53,69,.05),
        0 4px 18px rgba(220,53,69,.12) !important;
}
html.light-style .auth-field-input.is-invalid:focus {
    box-shadow:
        0 0 0 3px rgba(220,53,69,.22),
        inset 0 0 24px rgba(220,53,69,.06),
        0 6px 24px rgba(220,53,69,.20) !important;
}
html.light-style .auth-field.issue .auth-field-icon,
html.light-style .auth-field.issue .auth-field-label { color: #dc3545 !important; }

html.light-style .help-block li {
    color: #b02a37 !important;
    background:
        linear-gradient(135deg,
            rgba(220,53,69,.10) 0%,
            rgba(220,53,69,.05) 100%);
    border-color: #dc3545;
    box-shadow:
        0 2px 12px rgba(220,53,69,.08),
        inset 0 0 0 .5px rgba(220,53,69,.20);
}
html.light-style .help-block li::before {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    color: #fff;
    box-shadow: 0 0 14px rgba(220,53,69,.50);
}

/* ══════════════════════════════════════════════════════════
   ░░ 8. REMEMBER-ME CHECKBOX ░░
══════════════════════════════════════════════════════════ */
.auth-remember { margin-bottom: 1.75rem; }
.auth-check-label {
    display: inline-flex; align-items: center; gap: .6rem;
    color: rgba(255,255,255,.68); font-size: .9rem;
    cursor: pointer; user-select: none;
}
.auth-check-input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-check-box {
    width: 19px; height: 19px; flex-shrink: 0;
    border: 1.5px solid rgba(255,255,255,.28);
    border-radius: var(--radius-xs);
    background: rgba(255,255,255,.06);
    display: flex; align-items: center; justify-content: center;
    transition: all .2s var(--ease-bounce);
    position: relative;
}
.auth-check-box::after {
    content: '';
    width: 5px; height: 9px;
    border: 2px solid #fff; border-top: none; border-left: none;
    transform: rotate(45deg) scale(0);
    transition: transform .2s var(--ease-bounce);
    margin-top: -2px;
}
.auth-check-input:checked ~ .auth-check-box {
    background: var(--color-brand-primary);
    border-color: var(--color-brand-primary);
    box-shadow: 0 0 14px rgba(var(--color-brand-primary-rgb),.50);
}
.auth-check-input:checked ~ .auth-check-box::after { transform: rotate(45deg) scale(1); }

html.light-style .auth-check-label { color: rgba(40,38,80,.70); }
html.light-style .auth-check-box {
    background: #fff;
    border-color: rgba(115,103,240,.30);
}

/* ══════════════════════════════════════════════════════════
   ░░ 9. GRADIENT SUBMIT BUTTON ░░
══════════════════════════════════════════════════════════ */
.auth-submit-btn {
    position: relative; width: 100%; height: 56px;
    border: none; border-radius: var(--radius-lg);
    background: linear-gradient(135deg,
        #7367F0 0%, #5a52d5 40%, #00CFE8 100%);
    background-size: 200% 200%;
    color: #fff; font-size: 1.02rem; font-weight: 600;
    cursor: pointer; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: .55rem;
    animation: grad-shift 4s ease infinite;
    box-shadow: 0 4px 22px rgba(115,103,240,.45);
    transition: transform .2s var(--ease-bounce), box-shadow .2s;
    letter-spacing: .02em;
}
.auth-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 34px rgba(115,103,240,.62);
}
.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 14px rgba(115,103,240,.40);
}
.auth-btn-shimmer {
    position: absolute; inset: 0;
    background: linear-gradient(105deg,
        transparent 38%, rgba(255,255,255,.22) 50%, transparent 62%);
    background-size: 220% 100%;
    animation: shimmer 3s ease-in-out infinite;
}
.auth-submit-arrow {
    display: flex; align-items: center;
    transition: transform .2s var(--ease-bounce);
}
.auth-submit-btn:hover .auth-submit-arrow { transform: translateX(5px); }
[dir="rtl"] .auth-submit-arrow i { transform: rotate(180deg); }
[dir="rtl"] .auth-submit-btn:hover .auth-submit-arrow { transform: translateX(-5px); }

.auth-spin-dot {
    position: absolute;
    width: 22px; height: 22px;
    border: 2.5px solid rgba(255,255,255,.28);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: spin .75s linear infinite;
}
.auth-submit-btn.is-loading { pointer-events: none; }
.auth-submit-btn.is-loading .auth-submit-text,
.auth-submit-btn.is-loading .auth-submit-arrow,
.auth-submit-btn.is-loading .auth-btn-shimmer { opacity: 0; }
.auth-submit-btn.is-loading .auth-spin-dot     { opacity: 1; }

/* ══════════════════════════════════════════════════════════
   ░░ 10. ENTRY ANIMATIONS ░░
══════════════════════════════════════════════════════════ */
.auth-animate-logo     { animation: pop-in  .6s var(--ease-bounce) .30s both; }
.auth-animate-title    { animation: fade-up .45s var(--ease-out)   .50s both; }
.auth-animate-subtitle { animation: fade-up .45s var(--ease-out)   .60s both; }
.auth-animate-field    { animation: fade-up .45s var(--ease-out)   calc(.66s + var(--i,0)*.10s) both; }

.auth-card.has-error { animation: card-shake .5s var(--ease-out); }

/* ══════════════════════════════════════════════════════════
   ░░ 11. KEYFRAMES ░░
══════════════════════════════════════════════════════════ */
@keyframes blob1 {
    0%,100% { transform: translate(0,0)         scale(1);    border-radius: 60% 40% 55% 45%/50% 60% 40% 50%; }
    33%      { transform: translate(38px,-28px) scale(1.07); border-radius: 45% 55% 40% 60%/60% 40% 60% 40%; }
    66%      { transform: translate(-22px,20px) scale(.93);  border-radius: 55% 45% 60% 40%/40% 55% 45% 55%; }
}
@keyframes blob2 {
    0%,100% { transform: translate(0,0)          scale(1);    border-radius: 50% 50% 60% 40%/40% 60% 50% 50%; }
    50%      { transform: translate(-32px,-30px) scale(1.10); border-radius: 40% 60% 40% 60%/60% 40% 60% 40%; }
}
@keyframes blob3 {
    0%,100% { transform: translate(0,0)         rotate(0deg)  scale(1);    border-radius: 65% 35% 55% 45%/45% 55% 45% 55%; }
    50%      { transform: translate(24px,30px)  rotate(12deg) scale(1.08); border-radius: 40% 60% 45% 55%/55% 45% 60% 40%; }
}
@keyframes ring-pulse {
    0%   { transform: scale(1);   opacity: .80; }
    80%  { transform: scale(2.7); opacity: 0;   }
    100% { transform: scale(2.7); opacity: 0;   }
}
@keyframes pop-in {
    from { opacity: 0; transform: scale(.62); }
    to   { opacity: 1; transform: scale(1);   }
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0);    }
}
@keyframes card-shake {
    0%,100% { transform: translateX(0);   }
    15%      { transform: translateX(-9px);}
    30%      { transform: translateX(7px); }
    45%      { transform: translateX(-5px);}
    60%      { transform: translateX(4px); }
    75%      { transform: translateX(-2px);}
}
@keyframes grad-shift {
    0%,100% { background-position: 0%   50%; }
    50%      { background-position: 100% 50%; }
}
@keyframes shimmer {
    0%        { background-position: -120% 0; opacity: 0; }
    8%        { opacity: 1; }
    52%       { background-position:  220% 0; opacity: 1; }
    62%,100%  { opacity: 0; background-position: 220% 0; }
}
@keyframes border-spin {
    from { --angle: 0deg;   }
    to   { --angle: 360deg; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   ░░ 12. REDUCED MOTION ░░
══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .auth-blob, .auth-logo-pulse,
    .auth-animate-logo, .auth-animate-title, .auth-animate-subtitle,
    .auth-animate-field, .auth-submit-btn, .auth-btn-shimmer,
    .auth-stage-center {
        animation: none !important;
        opacity: 1 !important;
    }
}