/* ============================================================
   EvoCRM — Sign-in experience (glass console + living solar system)
   ============================================================ */

html:has(.login-page) { overflow-x: hidden; }

.login-page {
    --panel-max: 452px;
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3.2vh, 42px) clamp(16px, 4vw, 56px);
    overflow-x: hidden;
    background:
        radial-gradient(ellipse 60% 46% at 88% -8%, rgba(139, 92, 246, 0.26), transparent 62%),
        radial-gradient(ellipse 52% 40% at 4% 108%, rgba(217, 70, 239, 0.16), transparent 64%),
        radial-gradient(ellipse 42% 44% at 46% 48%, rgba(34, 211, 238, 0.055), transparent 66%),
        #07030F;
}
/* slow nebula drift — adds depth without stealing focus */
.login-page::before {
    content: '';
    position: fixed;
    inset: -18%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(closest-side at 74% 32%, rgba(139, 92, 246, 0.2), transparent 72%),
        radial-gradient(closest-side at 20% 76%, rgba(217, 70, 239, 0.11), transparent 74%),
        radial-gradient(closest-side at 54% 6%, rgba(34, 211, 238, 0.06), transparent 76%);
    animation: loginNebula 30s ease-in-out infinite alternate;
}
@keyframes loginNebula {
    from { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-1.6%, 1.4%, 0) scale(1.05); }
    to   { transform: translate3d(1.8%, -1.2%, 0) scale(1.02); }
}
.login-page [hidden] { display: none !important; }

/* ---------- page decor: starfield + meteors ---------- */
.login-decor {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.login-decor::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 21% 34%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1.2px 1.2px at 67% 72%, rgba(196, 181, 253, 0.55), transparent),
        radial-gradient(1px 1px at 83% 18%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(1.4px 1.4px at 12% 82%, rgba(240, 171, 252, 0.4), transparent),
        radial-gradient(1px 1px at 48% 51%, rgba(255, 255, 255, 0.4), transparent);
    background-size: 240px 240px, 320px 320px, 400px 400px, 470px 470px, 560px 560px;
    opacity: 0.55;
    animation: loginTwinkle 10s ease-in-out infinite alternate;
}

.shooting-star {
    --sx: 58vw;
    --rot: 20deg;
    --len: 160px;
    --dur: 13s;
    --delay: 0s;
    --peak: 0.95;
    position: absolute;
    top: 12%;
    left: -14%;
    width: var(--len);
    height: 1.5px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7) 58%, #F5E9FF);
    filter: drop-shadow(0 0 7px rgba(196, 181, 253, 0.85));
    opacity: 0;
    transform: rotate(var(--rot));
    animation: loginShoot var(--dur) cubic-bezier(0.2, 0.55, 0.35, 1) infinite;
    animation-delay: var(--delay);
}
.shooting-star::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -1px;
    width: 3.5px;
    height: 3.5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px 2px rgba(233, 213, 255, 0.9);
    transform: translateY(-50%);
}
.shooting-star.star-a { --delay: 1.6s; --sx: 58vw; --rot: 20deg; }
.shooting-star.star-b {
    --delay: 7s; --dur: 15.5s; --sx: 60vw; --rot: 158deg; --peak: 0.8;
    top: 24%;
    right: -14%;
    left: auto;
}
.shooting-star.star-c {
    --delay: 11.2s; --dur: 17s; --sx: 62vw; --rot: 14deg; --len: 135px;
    top: 56%;
    left: -12%;
}
.shooting-star.star-d {
    --delay: 4.4s; --dur: 19s; --sx: 66vw; --rot: 147deg; --len: 180px; --peak: 0.75;
    top: 4%;
    right: -10%;
    left: auto;
}
.shooting-star.star-e {
    --delay: 15s; --dur: 21s; --sx: 50vw; --rot: 27deg; --len: 195px;
    top: 40%;
    left: -16%;
}
.shooting-star.star-f {
    --delay: 9s; --dur: 16s; --sx: 58vw; --rot: 165deg; --len: 145px; --peak: 0.8;
    top: 72%;
    right: -12%;
    left: auto;
}
.shooting-star.star-g {
    --delay: 0.6s; --dur: 9.5s; --sx: 36vw; --rot: 24deg; --len: 92px;
    top: 2%;
    left: 28%;
}
@keyframes loginShoot {
    0%, 2%   { opacity: 0; transform: rotate(var(--rot)) translate3d(0, 0, 0); }
    5%       { opacity: var(--peak); }
    15%      { opacity: 0; transform: rotate(var(--rot)) translate3d(var(--sx), 0, 0); }
    100%     { opacity: 0; transform: rotate(var(--rot)) translate3d(var(--sx), 0, 0); }
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(1240px, 100%);
    display: grid;
    grid-template-columns: minmax(380px, var(--panel-max)) minmax(0, 1fr);
    align-items: center;
    gap: clamp(26px, 4.4vw, 76px);
}

/* ============================================================
   Sign-in card
   ============================================================ */
.login-panel { min-width: 0; }

.login-card {
    position: relative;
    padding: clamp(22px, 3vw, 38px);
    border-radius: 28px;
    border: 1px solid rgba(167, 139, 250, 0.22);
    background:
        radial-gradient(circle 260px at 100% 0%, rgba(139, 92, 246, 0.18), transparent 70%),
        radial-gradient(circle 220px at 0% 100%, rgba(217, 70, 239, 0.08), transparent 72%),
        linear-gradient(158deg, rgba(26, 16, 48, 0.86), rgba(9, 5, 20, 0.92));
    box-shadow:
        0 34px 90px rgba(3, 1, 10, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(24px) saturate(135%);
    -webkit-backdrop-filter: blur(24px) saturate(135%);
    overflow: hidden;
    animation: loginCardIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.login-card::before {
    content: '';
    position: absolute;
    inset-inline: 26px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(196, 181, 253, 0.65), rgba(232, 121, 249, 0.5), transparent);
}
.login-card::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    top: -130px;
    inset-inline-start: -90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.16), transparent 68%);
    pointer-events: none;
}
@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(22px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}

/* ---------- brand ---------- */
.login-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-mark {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #E9DDFF;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(217, 70, 239, 0.16));
    border: 1px solid rgba(167, 139, 250, 0.38);
    box-shadow: 0 10px 26px rgba(139, 92, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.brand-text strong { font-size: 17px; font-weight: 800; letter-spacing: 0.4px; }
.brand-text small { font-size: 10.5px; color: var(--text-muted); }
.brand-badge {
    margin-inline-start: auto;
    flex-shrink: 0;
    font-size: 9.5px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 999px;
    color: #E9DDFF;
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid rgba(167, 139, 250, 0.28);
}

/* ---------- heading ---------- */
.login-heading { margin: 22px 0 20px; }
.login-heading h2 {
    font-size: clamp(21px, 2.4vw, 26px);
    font-weight: 800;
    letter-spacing: -0.2px;
    line-height: 1.4;
}
.login-heading p { margin-top: 5px; font-size: 12.5px; color: var(--text-muted); }

/* ---------- mode switch ---------- */
.mode-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: rgba(6, 3, 14, 0.55);
    border: 1px solid rgba(167, 139, 250, 0.13);
}
.mode-indicator {
    position: absolute;
    inset-block: 4px;
    inset-inline-start: 4px;
    width: calc(50% - 4px);
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.42), rgba(217, 70, 239, 0.24));
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.mode-switch[data-mode="password"] .mode-indicator { transform: translateX(-100%); }
.mode-btn {
    position: relative;
    z-index: 1;
    padding: 10px 8px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.3s ease;
}
.mode-btn:hover { color: #D8D1EA; }
.mode-btn.is-active { color: #fff; }
.mode-btn:focus-visible { outline: 2px solid rgba(167, 139, 250, 0.6); outline-offset: 1px; }

/* ---------- alert ---------- */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 12px;
    font-size: 11.5px;
    line-height: 1.8;
    color: #FCA5A5;
    background: rgba(248, 113, 113, 0.09);
    border: 1px solid rgba(248, 113, 113, 0.3);
    animation: loginAlertIn 0.3s ease both;
}
.login-alert.is-info {
    color: #C4B5FD;
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(167, 139, 250, 0.28);
}
.login-alert.is-success {
    color: #6EE7B7;
    background: rgba(52, 211, 153, 0.09);
    border-color: rgba(52, 211, 153, 0.28);
}
.login-alert .alert-icon { width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px; }
@keyframes loginAlertIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- fields ---------- */
.login-form { position: relative; }
.field { display: block; margin-bottom: 14px; }
.field-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
}
.field-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(6, 3, 15, 0.55);
    border: 1px solid rgba(167, 139, 250, 0.16);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.field-box:focus-within {
    background: rgba(10, 5, 22, 0.72);
    border-color: rgba(167, 139, 250, 0.58);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14), 0 0 26px rgba(139, 92, 246, 0.16);
}
.field-box.is-invalid {
    border-color: rgba(248, 113, 113, 0.55);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.11);
    animation: loginShake 0.4s ease;
}
.field-box.is-locked { opacity: 0.72; }
.field-icon {
    display: inline-flex;
    flex-shrink: 0;
    color: var(--primary-soft);
    opacity: 0.9;
}
.field-icon svg { width: 17px; height: 17px; }
.field-box input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    box-shadow: none;
}
.field-box input:focus { outline: none; border: 0; box-shadow: none; }
.field-box input::placeholder { color: rgba(155, 147, 179, 0.42); font-size: 12.5px; }
.field-box input[readonly] { cursor: default; }
.field-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.field-action:hover { color: #fff; background: rgba(167, 139, 250, 0.12); }
.field-action svg { width: 17px; height: 17px; }
.field-action .eye-off { display: none; }
.field-action.is-on .eye-on { display: none; }
.field-action.is-on .eye-off { display: block; }
.field-hint {
    display: block;
    margin-top: 7px;
    font-size: 10.5px;
    line-height: 1.7;
    color: rgba(155, 147, 179, 0.72);
    transition: color 0.2s ease;
}
.field-hint.is-error { color: #FCA5A5; }

/* ---------- primary button ---------- */
.login-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 52px;
    margin-top: 6px;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    font: inherit;
    font-size: 13.5px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #7C3AED, #C026D3);
    box-shadow: 0 14px 34px rgba(139, 92, 246, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.2s ease, box-shadow 0.3s ease, filter 0.3s ease;
}
.login-btn::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 45%;
    inset-inline-start: -60%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-18deg);
    transition: inset-inline-start 0.55s ease;
}
.login-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.07);
    box-shadow: 0 18px 42px rgba(217, 70, 239, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.login-btn:hover::after { inset-inline-start: 115%; }
.login-btn:active:not(:disabled) { transform: translateY(0) scale(0.995); }
.login-btn:disabled { cursor: progress; opacity: 0.75; transform: none; }
.login-btn:focus-visible { outline: 2px solid rgba(196, 181, 253, 0.75); outline-offset: 2px; }
.login-btn .btn-icon { width: 17px; height: 17px; }
.login-btn .btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: loginSpin 0.7s linear infinite;
}
.login-btn.is-loading .btn-spinner { display: block; }
.login-btn.is-loading .btn-icon { display: none; }
.login-btn.is-success {
    background: linear-gradient(135deg, #059669, #10B981);
    box-shadow: 0 16px 38px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
@keyframes loginSpin { to { transform: rotate(360deg); } }

/* ---------- OTP ---------- */
.otp-block { animation: loginStepIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.otp-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}
.link-back {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    border: 1px solid rgba(167, 139, 250, 0.18);
    border-radius: 9px;
    background: rgba(139, 92, 246, 0.08);
    color: var(--primary-soft);
    font: inherit;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.link-back:hover { background: rgba(139, 92, 246, 0.18); border-color: rgba(167, 139, 250, 0.36); }
.link-back svg { width: 13px; height: 13px; }
.otp-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.otp-copy strong { font-size: 12.5px; font-weight: 700; }
.otp-copy small { font-size: 10.5px; color: var(--text-muted); line-height: 1.7; }

.otp-grid {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 13px;
    direction: ltr;
}
.otp-grid input {
    flex: 1 1 0;
    min-width: 0;
    max-width: 56px;
    height: 58px;
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(167, 139, 250, 0.18);
    background: rgba(6, 3, 15, 0.55);
    color: #fff;
    font-family: inherit;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.otp-grid input:focus {
    outline: none;
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.75);
    background: rgba(17, 9, 34, 0.8);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16), 0 0 28px rgba(139, 92, 246, 0.22);
}
.otp-grid input.is-filled {
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(167, 139, 250, 0.42);
}
.otp-grid.is-error { animation: loginShake 0.45s ease; }
.otp-grid.is-error input { border-color: rgba(248, 113, 113, 0.6); }

.otp-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 10.5px;
}
.link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary-soft);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
.link:hover:not(:disabled) { text-decoration: underline; }
.link:disabled { color: rgba(155, 147, 179, 0.55); cursor: default; }
.link-timer { font-variant-numeric: tabular-nums; }
.otp-expiry { color: rgba(155, 147, 179, 0.65); }
.otp-expiry b { color: #C4B5FD; font-variant-numeric: tabular-nums; font-weight: 700; }

@keyframes loginStepIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}

/* ---------- password recovery ---------- */
.recovery-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 0 18px;
    padding: 4px;
    list-style: none;
    border-radius: 14px;
    background: rgba(6, 3, 14, 0.55);
    border: 1px solid rgba(167, 139, 250, 0.13);
}
.recovery-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 6px;
    border-radius: 11px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}
.recovery-step.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.42), rgba(217, 70, 239, 0.24));
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.recovery-dot {
    position: relative;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    font-size: 9.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #C4B5FD;
    background: rgba(167, 139, 250, 0.16);
    border: 1px solid rgba(167, 139, 250, 0.28);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.recovery-step.is-active .recovery-dot {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.38);
}
.recovery-steps.is-done .recovery-step {
    color: #6EE7B7;
    background: rgba(52, 211, 153, 0.08);
    box-shadow: none;
}
.recovery-steps.is-done .recovery-dot {
    color: transparent;
    background: rgba(52, 211, 153, 0.18);
    border-color: rgba(52, 211, 153, 0.45);
}
.recovery-steps.is-done .recovery-dot::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #6EE7B7;
    font-size: 10px;
}
.step-panel { animation: loginStepIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }

.otp-copy small b { color: #C4B5FD; font-weight: 700; font-variant-numeric: tabular-nums; }

.pw-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: -4px 0 14px;
}
.pw-rule {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    color: rgba(155, 147, 179, 0.75);
    background: rgba(6, 3, 15, 0.5);
    border: 1px solid rgba(167, 139, 250, 0.14);
    transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}
.pw-rule i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(155, 147, 179, 0.45);
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.pw-rule.is-ok {
    color: #6EE7B7;
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.3);
}
.pw-rule.is-ok i { background: #34D399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }

.recovery-success {
    text-align: center;
    padding: 4px 0 2px;
    animation: loginStepIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.success-mark {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 2px auto 16px;
    border-radius: 50%;
    color: #6EE7B7;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.24), rgba(16, 185, 129, 0.05) 70%);
    border: 1px solid rgba(52, 211, 153, 0.4);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.06), 0 14px 34px rgba(16, 185, 129, 0.18);
}
.success-mark svg { width: 28px; height: 28px; }
.recovery-success h3 { font-size: 18px; font-weight: 800; }
.recovery-success p { margin: 6px 0 18px; font-size: 12px; color: var(--text-muted); }
.recovery-success .login-btn { text-decoration: none; }

/* ---------- self-registration ---------- */
.recovery-steps--3 { grid-template-columns: repeat(3, 1fr); }
.login-page.is-register .recovery-step { font-size: 11px; padding: 8px 4px; }
.field-optional { color: rgba(155, 147, 179, 0.75); font-weight: 400; font-size: 10.5px; }
.register-verified {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 14px;
    border-radius: 12px;
    font-size: 11.5px;
    color: var(--text-muted);
    background: rgba(6, 3, 14, 0.5);
    border: 1px solid rgba(167, 139, 250, 0.14);
}
.register-verified b {
    color: #C4B5FD;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.register-verified .link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary-soft);
    cursor: pointer;
}
.register-verified .link:hover { color: #fff; }
.register-note {
    margin: 10px 0 0;
    text-align: center;
    font-size: 10.5px;
    line-height: 1.9;
    color: rgba(155, 147, 179, 0.7);
}

/* sign-in prompt shown for unknown mobiles */
.auth-modal .modal-box { max-width: 430px; }
.auth-modal .modal-intro { align-items: flex-start; }
.auth-modal .modal-intro > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.auth-modal .modal-intro strong { color: #fff; font-size: 13px; }
.auth-modal .modal-intro span { line-height: 1.9; }
.auth-modal .modal-intro b { color: #C4B5FD; font-weight: 700; font-variant-numeric: tabular-nums; }
.auth-modal .modal-actions { justify-content: stretch; }
.auth-modal .modal-actions .btn-ghost,
.auth-modal .modal-actions .btn-primary { flex: 1; text-align: center; padding: 11px 16px; }

/* step 2 is the tallest screen: tighten spacing on shorter desktops */
@media (min-width: 901px) and (max-height: 940px) {
    .login-page.is-recovery .login-card { padding: clamp(18px, 2.6vh, 28px); }
    .login-page.is-recovery .login-heading { margin: 12px 0; }
    .login-page.is-recovery .recovery-steps { margin-bottom: 12px; }
    .login-page.is-recovery .otp-head { margin-bottom: 10px; }
    .login-page.is-recovery .otp-grid { margin-bottom: 10px; }
    .login-page.is-recovery .otp-grid input { height: 48px; font-size: 19px; }
    .login-page.is-recovery .otp-meta { margin-bottom: 10px; }
    .login-page.is-recovery .field { margin-bottom: 10px; }
    .login-page.is-recovery .field-label { margin-bottom: 6px; }
    .login-page.is-recovery .pw-rules { margin: -2px 0 10px; }
    .login-page.is-recovery .login-btn { height: 48px; margin-top: 2px; }
    .login-page.is-recovery .login-footer { margin-top: 16px; padding-top: 12px; }
}
@media (min-width: 901px) and (max-height: 820px) {
    .login-page.is-recovery .login-card { padding: 16px 20px; }
    .login-page.is-recovery .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
    .login-page.is-recovery .brand-mark svg { width: 22px; height: 22px; }
    .login-page.is-recovery .login-heading { margin: 10px 0; }
    .login-page.is-recovery .login-heading h2 { font-size: 21px; }
    .login-page.is-recovery .recovery-steps { margin-bottom: 10px; }
    .login-page.is-recovery .otp-head { margin-bottom: 8px; }
    .login-page.is-recovery .otp-grid { margin-bottom: 8px; }
    .login-page.is-recovery .otp-grid input { height: 44px; font-size: 18px; }
    .login-page.is-recovery .otp-meta { margin-bottom: 8px; }
    .login-page.is-recovery .field { margin-bottom: 8px; }
    .login-page.is-recovery .field-box { height: 46px; }
    .login-page.is-recovery .login-btn { height: 46px; }
    .login-page.is-recovery .login-footer { margin-top: 12px; padding-top: 10px; }
}

/* ---------- footer ---------- */
.login-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(167, 139, 250, 0.12);
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    min-width: 0;
}
.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--primary-soft);
    transition: color 0.2s ease;
}
.footer-link:hover { text-decoration: none; color: #fff; }
.footer-link:focus-visible { outline: 2px solid rgba(167, 139, 250, 0.6); outline-offset: 3px; border-radius: 4px; }
.footer-link svg { width: 14px; height: 14px; opacity: 0.9; }
.footer-secure {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: rgba(155, 147, 179, 0.66);
}
.footer-secure svg { width: 13px; height: 13px; color: rgba(52, 211, 153, 0.75); }

/* ============================================================
   Visual side — minimal living solar system
   ============================================================ */
.login-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 2.2vh, 22px);
    min-height: 0;
    padding: 8px 0;
}
.login-visual::before {
    content: '';
    position: absolute;
    top: 46%;
    left: 50%;
    width: min(780px, 58vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.18), rgba(217, 70, 239, 0.06) 44%, transparent 70%);
    filter: blur(18px);
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.visual-stars {
    position: absolute;
    inset: -4% 0;
    pointer-events: none;
    opacity: 0.75;
    background-image:
        radial-gradient(1.6px 1.6px at 16% 22%, rgba(255, 255, 255, 0.9), transparent 60%),
        radial-gradient(1.3px 1.3px at 73% 14%, rgba(196, 181, 253, 0.9), transparent 60%),
        radial-gradient(1.2px 1.2px at 88% 42%, rgba(255, 255, 255, 0.7), transparent 60%),
        radial-gradient(1.5px 1.5px at 26% 68%, rgba(232, 121, 249, 0.65), transparent 60%),
        radial-gradient(1.2px 1.2px at 62% 82%, rgba(255, 255, 255, 0.75), transparent 60%),
        radial-gradient(1px 1px at 44% 36%, rgba(255, 255, 255, 0.55), transparent 60%),
        radial-gradient(1px 1px at 8% 52%, rgba(196, 181, 253, 0.6), transparent 60%),
        radial-gradient(1.4px 1.4px at 94% 74%, rgba(255, 255, 255, 0.6), transparent 60%),
        radial-gradient(1px 1px at 34% 92%, rgba(255, 255, 255, 0.5), transparent 60%),
        radial-gradient(1.2px 1.2px at 58% 6%, rgba(240, 171, 252, 0.6), transparent 60%);
    animation: loginTwinkle 7s ease-in-out infinite alternate;
}
@keyframes loginTwinkle {
    from { opacity: 0.45; }
    to   { opacity: 0.95; }
}

/* ---------- solar system in perspective ---------- */
.solar-system {
    --tilt: 63deg;
    --spin: -17deg;
    position: relative;
    flex: 0 0 auto;
    width: min(620px, 48vw, 60vh);
    aspect-ratio: 1 / 0.78;
    perspective: 1150px;
    perspective-origin: 50% 46%;
    container-type: inline-size;
}
/* faint galactic disc lying under the planetary plane */
.solar-system::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    width: 104%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(
        from 20deg,
        rgba(139, 92, 246, 0) 0%,
        rgba(139, 92, 246, 0.26) 12%,
        rgba(236, 72, 153, 0.16) 24%,
        rgba(56, 189, 248, 0.18) 36%,
        rgba(139, 92, 246, 0) 52%,
        rgba(167, 139, 250, 0.24) 68%,
        rgba(244, 114, 182, 0.14) 84%,
        rgba(139, 92, 246, 0) 100%
    );
    -webkit-mask: radial-gradient(closest-side, transparent 14%, #000 32%, #000 58%, transparent 100%);
    mask: radial-gradient(closest-side, transparent 14%, #000 32%, #000 58%, transparent 100%);
    filter: blur(12px);
    transform: translate(-50%, -50%) rotate(var(--spin)) scaleY(0.42) rotate(0deg);
    animation: loginDisc 140s linear infinite;
    pointer-events: none;
}
@keyframes loginDisc {
    to { transform: translate(-50%, -50%) rotate(var(--spin)) scaleY(0.42) rotate(360deg); }
}
.solar-shadow {
    position: absolute;
    left: 50%;
    bottom: 0.5%;
    width: 74%;
    height: 20%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.36), rgba(88, 28, 135, 0.14) 54%, transparent 76%);
    filter: blur(20px);
    transform: translateX(-50%);
    pointer-events: none;
}
.solar-tilt {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    width: 100%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%) rotateZ(var(--spin)) rotateX(var(--tilt));
    transform-style: preserve-3d;
}
/* sun halo sits outside the 3D plane so it stays a smooth radial glow */
.solar-system::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    width: 46%;
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 241, 190, 0.55), rgba(251, 191, 36, 0.24) 28%, rgba(245, 158, 11, 0.09) 50%, transparent 72%);
    transform: translate(-50%, -50%);
    animation: loginSunBreath 6.5s ease-in-out infinite;
    pointer-events: none;
}
/* energy waves rippling out from the sun across the orbital plane */
.sun-wave {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 16%;
    height: 16%;
    border-radius: 50%;
    background: radial-gradient(closest-side, transparent 90%, rgba(253, 224, 71, 0.45) 96%, rgba(255, 247, 214, 0.7) 98.5%, transparent 100%);
    opacity: 0;
    animation: loginWave 8s cubic-bezier(0.16, 0.6, 0.36, 1) infinite;
    animation-delay: var(--wave-delay, 0s);
    pointer-events: none;
}
@keyframes loginWave {
    0%   { transform: scale(1); opacity: 0; }
    6%   { opacity: 0.8; }
    100% { transform: scale(6.2); opacity: 0; }
}
/* anamorphic light streak crossing the sun */
.solar-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 82%;
    height: 2px;
    border-radius: 50%;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.16) 22%, rgba(255, 244, 214, 0.9) 50%, rgba(251, 191, 36, 0.16) 78%, transparent);
    box-shadow: 0 0 10px rgba(253, 224, 71, 0.35);
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
    animation: loginFlare 6.5s ease-in-out infinite;
    pointer-events: none;
}
.solar-flare::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.5px;
    height: 9cqi;
    background: linear-gradient(180deg, transparent, rgba(255, 244, 214, 0.75), transparent);
    transform: translate(-50%, -50%);
}
@keyframes loginFlare {
    0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scaleX(0.82); }
    50%      { opacity: 1; transform: translate(-50%, -50%) scaleX(1.06); }
}
/* sun billboard is sized to contain its corona; overflow from a 3D layer renders as a square */
.sun {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 36%;
    height: 36%;
    transform: translateZ(2px) rotateX(calc(var(--tilt) * -1)) rotateZ(calc(var(--spin) * -1));
}
.sun-corona,
.sun-corona::after {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.sun-corona {
    inset: 0;
    background:
        repeating-conic-gradient(from 0deg, rgba(254, 240, 138, 0.55) 0deg 1.3deg, transparent 1.3deg 7.5deg),
        repeating-conic-gradient(from 3deg, rgba(251, 146, 60, 0.4) 0deg 0.8deg, transparent 0.8deg 4.6deg),
        radial-gradient(closest-side, rgba(253, 224, 71, 0.85) 40%, rgba(251, 146, 60, 0.42) 54%, rgba(245, 158, 11, 0.14) 74%, transparent 100%);
    -webkit-mask: radial-gradient(closest-side, transparent 38%, #000 42%, rgba(0, 0, 0, 0.32) 64%, transparent 100%);
    mask: radial-gradient(closest-side, transparent 38%, #000 42%, rgba(0, 0, 0, 0.32) 64%, transparent 100%);
    filter: blur(1.2px);
    animation: loginOrbit 90s linear infinite;
}
.sun-corona::after {
    content: '';
    inset: 8%;
    background: repeating-conic-gradient(from 1deg, rgba(255, 251, 235, 0.5) 0deg 0.9deg, transparent 0.9deg 11deg);
    -webkit-mask: radial-gradient(closest-side, transparent 44%, #000 48%, transparent 92%);
    mask: radial-gradient(closest-side, transparent 44%, #000 48%, transparent 92%);
    animation: loginOrbit 55s linear infinite reverse;
}
.sun-core {
    position: absolute;
    inset: 28%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, #FFFBEB 0, #FEF08A 22%, #FBBF24 50%, #F59E0B 72%, #EA580C 92%, #B9370B 100%);
}
/* plasma layers clip themselves with a round mask; parent clipping breaks inside the 3D context */
.sun-core::before,
.sun-core::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    -webkit-mask: radial-gradient(closest-side, #000 96%, transparent 100%);
    mask: radial-gradient(closest-side, #000 96%, transparent 100%);
}
.sun-core::before {
    background: conic-gradient(
        from 0deg,
        transparent, rgba(255, 255, 255, 0.38) 8%, transparent 18%,
        rgba(154, 52, 18, 0.32) 30%, transparent 40%,
        rgba(255, 247, 200, 0.34) 55%, transparent 66%,
        rgba(194, 65, 12, 0.3) 80%, transparent 90%
    );
    filter: blur(3px);
    animation: loginOrbit 16s linear infinite;
}
.sun-core::after {
    background:
        radial-gradient(circle at 30% 34%, rgba(255, 255, 255, 0.5), transparent 24%),
        radial-gradient(circle at 70% 62%, rgba(154, 52, 18, 0.34), transparent 26%),
        radial-gradient(circle at 42% 76%, rgba(255, 237, 180, 0.42), transparent 20%),
        radial-gradient(circle at 74% 26%, rgba(194, 65, 12, 0.28), transparent 18%),
        radial-gradient(circle at 50% 50%, transparent 62%, rgba(154, 52, 18, 0.35) 100%);
    filter: blur(2px);
    animation: loginOrbit 24s linear infinite reverse;
}
@keyframes loginSunBreath {
    0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.94); }
    50%      { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

.orbit {
    position: absolute;
    inset: 0;
    margin: auto;
    border-radius: 50%;
    border: 1px solid rgba(167, 139, 250, 0.14);
    animation: loginOrbit var(--dur, 32s) linear infinite;
    animation-delay: var(--delay, 0s);
    transform-style: preserve-3d;
}
/* glowing wake that follows each planet along its orbit */
.orbit::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 72%, var(--trail, rgba(196, 181, 253, 0.85)) 100%);
    -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2px), transparent 100%);
    mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2px), transparent 100%);
    pointer-events: none;
}
.orbit-mercury { width: 26%; height: 26%; border-color: rgba(203, 213, 225, 0.16); --trail: rgba(226, 232, 240, 0.75); }
.orbit-venus   { width: 36%; height: 36%; border-color: rgba(251, 191, 36, 0.15); --trail: rgba(252, 211, 77, 0.8); }
.orbit-earth   { width: 47%; height: 47%; border-color: rgba(96, 165, 250, 0.22); --trail: rgba(96, 165, 250, 0.95); }
.orbit-mars    { width: 57%; height: 57%; border-color: rgba(251, 146, 60, 0.18); border-style: dashed; --trail: rgba(251, 113, 75, 0.85); }
.orbit-jupiter { width: 70%; height: 70%; border-color: rgba(245, 158, 11, 0.13); --trail: rgba(253, 186, 116, 0.8); }
.orbit-saturn  { width: 84%; height: 84%; border-color: rgba(196, 181, 253, 0.2); --trail: rgba(216, 180, 254, 0.85); }
.orbit-uranus  { width: 97%; height: 97%; border-color: rgba(103, 232, 249, 0.16); --trail: rgba(103, 232, 249, 0.85); }

/* dusty ring between Mars and Jupiter */
.asteroid-belt {
    position: absolute;
    inset: 15%;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(226, 214, 255, 0.95) 0 0.9px, transparent 1.5px) 0 0 / 19px 17px,
        radial-gradient(circle, rgba(253, 186, 116, 0.8) 0 0.7px, transparent 1.3px) 9px 5px / 23px 21px,
        radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 0.6px, transparent 1.1px) 4px 11px / 13px 29px;
    -webkit-mask: radial-gradient(closest-side, transparent 0 86%, #000 89% 92%, transparent 95%);
    mask: radial-gradient(closest-side, transparent 0 86%, #000 89% 92%, transparent 95%);
    opacity: 0.55;
    animation: loginOrbit 110s linear infinite;
    pointer-events: none;
}

.planet-slot {
    position: absolute;
    top: 0;
    left: 50%;
    display: block;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
}
.planet {
    position: relative;
    display: block;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    animation: loginCounterOrbit var(--dur, 32s) linear infinite;
    animation-delay: var(--delay, 0s);
    transform-style: preserve-3d;
}
/* day/night terminator: the lit side keeps facing the sun as the planet orbits */
.planet::before {
    content: '';
    position: absolute;
    inset: -0.5px;
    border-radius: 50%;
    background:
        radial-gradient(110% 80% at 50% 104%, rgba(255, 248, 225, 0.42), transparent 46%),
        linear-gradient(180deg, rgba(5, 2, 18, 0.92) 0%, rgba(5, 2, 18, 0.66) 32%, rgba(5, 2, 18, 0) 62%);
    animation: loginShade var(--dur, 32s) linear infinite;
    animation-delay: var(--delay, 0s);
    pointer-events: none;
}
.p-mercury {
    --size: calc(2.4px + 1.7cqi);
    background: radial-gradient(circle at 50% 50%, #F3EFFB, #A79FC0 55%, #4B4560);
    box-shadow: 0 0 10px rgba(203, 213, 225, 0.35);
}
.p-venus {
    --size: calc(3.4px + 2.2cqi);
    background:
        radial-gradient(ellipse at 40% 40%, rgba(255, 255, 255, 0.35), transparent 40%),
        radial-gradient(circle at 50% 50%, #FFF1CE, #E0A34D 58%, #7C4D18);
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.4);
}
.p-earth {
    --size: calc(3.8px + 2.93cqi);
    background:
        radial-gradient(circle at 34% 40%, rgba(74, 222, 128, 0.75), transparent 22%),
        radial-gradient(circle at 66% 62%, rgba(74, 222, 128, 0.6), transparent 26%),
        radial-gradient(ellipse 60% 18% at 46% 22%, rgba(255, 255, 255, 0.6), transparent 70%),
        radial-gradient(circle at 50% 50%, #B8F0FF, #3B82F6 55%, #1D3F8F);
    box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.32), 0 0 22px rgba(59, 130, 246, 0.6);
}
.p-mars {
    --size: calc(2.4px + 2.2cqi);
    background:
        radial-gradient(ellipse 50% 16% at 50% 8%, rgba(255, 255, 255, 0.7), transparent 80%),
        radial-gradient(circle at 50% 50%, #FFC9BA, #E05D44 60%, #6E2410);
    box-shadow: 0 0 13px rgba(224, 93, 68, 0.45);
}
.p-jupiter {
    --size: calc(4.3px + 3.66cqi);
    background:
        radial-gradient(ellipse 22% 13% at 64% 64%, rgba(190, 70, 40, 0.9), transparent 80%),
        radial-gradient(circle at 50% 50%, transparent 55%, rgba(80, 45, 20, 0.55)),
        repeating-linear-gradient(7deg, #C98E5A 0 9%, #EBC79B 9% 19%, #B98252 19% 26%, #F3DDBB 26% 32%);
    box-shadow: 0 0 20px rgba(217, 160, 102, 0.45);
}
.p-saturn {
    --size: calc(3.8px + 2.93cqi);
    background:
        repeating-linear-gradient(-4deg, transparent 0 14%, rgba(154, 106, 47, 0.25) 14% 20%),
        radial-gradient(circle at 50% 50%, #FBF0D9, #E8C88A 52%, #9A6A2F);
    box-shadow: 0 0 18px rgba(232, 200, 138, 0.45);
}
.p-saturn::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 235%;
    height: 74%;
    border-radius: 50%;
    background: radial-gradient(closest-side, transparent 58%, rgba(236, 220, 180, 0.35) 62%, rgba(255, 240, 205, 0.85) 72%, rgba(196, 160, 110, 0.45) 80%, rgba(236, 220, 180, 0.7) 88%, transparent 96%);
    box-shadow: 0 0 12px rgba(232, 200, 138, 0.3);
    transform: translate(-50%, -50%) rotate(-20deg);
}
.p-uranus {
    --size: calc(2.4px + 2.2cqi);
    background: radial-gradient(circle at 50% 50%, #E4FDFF, #67E8F9 55%, #0E7490);
    box-shadow: 0 0 14px rgba(103, 232, 249, 0.45);
}
.p-uranus::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 165%;
    height: 44%;
    border-radius: 50%;
    border: 1px solid rgba(165, 243, 252, 0.6);
    transform: translate(-50%, -50%) rotate(76deg);
}

.moon-orbit {
    position: absolute;
    inset: calc(-3.4px - 1.7cqi);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    animation: loginOrbit 7s linear infinite;
}
.moon {
    position: absolute;
    top: 0;
    left: 50%;
    width: calc(1.5px + 0.73cqi);
    height: calc(1.5px + 0.73cqi);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #FFFFFF, #C7C2D8 72%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.55);
    transform: translate(-50%, -50%);
}

/* comet on its own inclined, eccentric orbit; tail trails along the path */
.comet-track {
    display: none;
    position: absolute;
    inset: 6% 2%;
    z-index: 2;
    transform: rotate(-26deg);
    pointer-events: none;
}
@supports (offset-path: ellipse(10px 10px at 50% 50%)) {
    .comet-track { display: block; }
}
.comet {
    position: absolute;
    top: 0;
    left: 0;
    width: 17%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.22) 40%, rgba(186, 230, 253, 0.6) 80%, rgba(255, 255, 255, 0.95));
    filter: drop-shadow(0 0 4px rgba(125, 211, 252, 0.85));
    offset-path: ellipse(44% 34% at 56% 50%);
    offset-anchor: 100% 50%;
    offset-rotate: auto;
    transform-origin: 100% 50%;
    animation:
        loginComet 24s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite,
        loginCometTail 24s ease-in-out infinite;
}
.comet::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -2px;
    width: calc(2px + 0.8cqi);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, #FFFFFF 0 35%, rgba(186, 230, 253, 0.8) 60%, transparent 72%);
    box-shadow: 0 0 10px 2px rgba(125, 211, 252, 0.75);
    transform: translateY(-50%);
}
@keyframes loginComet {
    from { offset-distance: 0%; }
    to   { offset-distance: 100%; }
}
@keyframes loginCometTail {
    0%, 100% { opacity: 0.35; transform: scaleX(0.35); }
    50%      { opacity: 1; transform: scaleX(1.15); }
}

@keyframes loginOrbit { to { transform: rotate(360deg); } }
/* orbits live on the tilted plane; planets undo the tilt so they stay face-on */
@keyframes loginCounterOrbit {
    from { transform: rotate(0deg) rotateX(calc(var(--tilt) * -1)) rotateZ(calc(var(--spin) * -1)); }
    to   { transform: rotate(-360deg) rotateX(calc(var(--tilt) * -1)) rotateZ(calc(var(--spin) * -1)); }
}
/* tracks the orbit angle so the shading points back at the sun */
@keyframes loginShade {
    from { transform: rotate(var(--spin)); }
    to   { transform: rotate(calc(var(--spin) + 360deg)); }
}

/* ---------- visual copy (single hero line) ---------- */
.visual-copy {
    position: relative;
    z-index: 2;
    max-width: 640px;
    text-align: center;
    animation: loginFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}
.visual-copy h1 {
    margin: 0;
    font-size: clamp(28px, 3.8vw, 52px);
    font-weight: 900;
    line-height: 1.45;
    letter-spacing: -1.2px;
    text-wrap: balance;
    background: linear-gradient(102deg, #FFFFFF 4%, #E9D5FF 36%, #C4B5FD 64%, #F0ABFC 94%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 10px 34px rgba(139, 92, 246, 0.3));
}
.visual-copy::after {
    content: '';
    display: block;
    width: 88px;
    height: 2px;
    margin: 20px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(196, 181, 253, 0.9), transparent);
    box-shadow: 0 0 16px rgba(196, 181, 253, 0.65);
}
@keyframes loginFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1120px) {
    .login-shell {
        grid-template-columns: minmax(350px, 420px) minmax(0, 1fr);
        gap: clamp(24px, 4vw, 56px);
    }
    .solar-system { width: min(500px, 44vw, 56vh); }
}

@media (max-width: 900px) {
    .login-page {
        align-items: flex-start;
        padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
    }
    .login-shell {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        max-width: 460px;
        margin-inline: auto;
    }
    .login-visual {
        order: -1;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 12px;
        width: 100%;
        padding: 6px 0 0;
    }
    .login-visual::before {
        top: 50%;
        width: min(420px, 88vw);
        transform: translate(-50%, -50%);
    }
    .solar-system { width: min(210px, 48vw); flex-shrink: 0; }
    .visual-copy { flex: 1 1 0; min-width: 0; max-width: 54%; text-align: start; }
    .visual-copy h1 {
        font-size: clamp(17px, 5.2vw, 22px);
        line-height: 1.6;
        letter-spacing: -0.5px;
    }
    .visual-copy::after { display: none; }
    .visual-stars { inset: 0; }

    .login-card { border-radius: 24px; }
    .login-heading { margin: 18px 0 16px; }
    .login-page.is-recovery.is-otp .login-heading { margin: 14px 0; }
    .login-page.is-recovery.is-otp .recovery-steps { margin-bottom: 14px; }

    /* code entry gets the whole screen; the hero returns on "edit" */
    .login-page.is-otp { padding-top: calc(14px + env(safe-area-inset-top)); }
    .login-page.is-otp .login-visual { display: none; }
}

@media (max-width: 900px) and (min-height: 760px) {
    .login-page {
        align-items: center;
        padding-block: 20px calc(20px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 520px) {
    .login-page { padding: 14px 12px calc(20px + env(safe-area-inset-bottom)); }
    .login-card { padding: 20px 18px; }
    .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
    .brand-mark svg { width: 22px; height: 22px; }
    .brand-text strong { font-size: 15.5px; }
    .brand-text small { display: none; }
    .brand-badge { font-size: 9px; padding: 4px 9px; }
    .login-heading h2 { font-size: 19px; }
    .login-heading p { font-size: 11.5px; }
    .mode-btn { padding: 9px 6px; font-size: 11.5px; }
    .field-box { height: 50px; padding: 0 12px; }
    .field-box input { font-size: 16px; }
    .login-btn { height: 50px; font-size: 13px; }
    .otp-grid { gap: 6px; }
    .otp-grid input { height: 52px; font-size: 20px; border-radius: 12px; }
    .otp-copy small { font-size: 10px; }
    .recovery-step { gap: 5px; padding: 7px 4px; font-size: 10.5px; }
    .recovery-dot { width: 16px; height: 16px; font-size: 8.5px; }
    .pw-rule { padding: 2px 7px; font-size: 9.5px; }
    .login-footer { row-gap: 8px; }
    .footer-secure { font-size: 9.5px; }
    .visual-copy h1 { font-size: clamp(15px, 4.9vw, 20px); }
}

@media (max-width: 380px) {
    .solar-system { width: min(155px, 48vw); }
    .visual-copy h1 { font-size: 15px; }
    .otp-grid input { height: 46px; font-size: 18px; }
    .login-heading h2 { font-size: 17.5px; }
}

@media (max-height: 820px) and (min-width: 901px) {
    .solar-system { width: min(470px, 44vw, 54vh); }
    .login-visual { gap: 8px; }
    .visual-copy h1 { font-size: clamp(22px, 2.8vw, 36px); }
    .visual-copy::after { margin-top: 14px; }
}

@media (max-height: 720px) and (min-width: 901px) {
    .login-page { align-items: flex-start; }
    .solar-system { width: min(430px, 42vw, 54vh); }
    .visual-copy h1 { font-size: clamp(22px, 2.6vw, 32px); }
    .visual-copy::after { display: none; }
}

/* very short phones: tighter card, hero steps aside for the form */
@media (max-width: 900px) and (max-height: 700px) {
    .login-page { padding: 10px 12px calc(6px + env(safe-area-inset-bottom)); }
    .login-card { padding: 16px; }
    .login-heading { margin: 12px 0; }
    .mode-switch { margin-bottom: 12px; }
    .field { margin-bottom: 11px; }
    .login-footer { margin-top: 14px; padding-top: 12px; }
    .login-page.is-otp .login-footer { display: none; }
    .login-page.is-password .login-visual { display: none; }

    .login-page.is-recovery .login-heading { margin: 6px 0; }
    .login-page.is-recovery .recovery-steps { margin-bottom: 8px; }
    .login-page.is-recovery .recovery-step { padding: 6px 4px; }
    .login-page.is-recovery .otp-head { margin-bottom: 8px; }
    .login-page.is-recovery .otp-copy small { font-size: 9.5px; }
    .login-page.is-recovery .otp-grid { margin-bottom: 8px; }
    .login-page.is-recovery .otp-grid input { height: 42px; font-size: 18px; }
    .login-page.is-recovery .otp-meta { margin-bottom: 8px; }
    .login-page.is-recovery .field { margin-bottom: 8px; }
    .login-page.is-recovery .field-box { height: 44px; }
    .login-page.is-recovery .field-label { margin-bottom: 5px; }
    .login-page.is-recovery .pw-rules { margin: -2px 0 8px; }
    .login-page.is-recovery .login-btn { height: 44px; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    .login-page *,
    .login-page *::before,
    .login-page *::after {
        animation: none !important;
        transition: none !important;
    }
}
