/* ============================================================
   Morgan Tuck-shop — cinematic 3D sign-in
   Layered depth: constellation canvas -> ambient light -> grid ->
   3D crest medallion -> pointer-tilted glass card -> grain.
   ============================================================ */

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

:root {
    --navy-950: #050b16;
    --navy-900: #071120;
    --navy-800: #0b192c;
    --navy-700: #122642;
    --gold: #d4af37;
    --gold-soft: #f2dfa0;
    --gold-deep: #a97f1c;
    --mint: #3ee0b0;
    --text: #f5f8fd;
    --muted: rgba(222, 232, 248, .62);
    --faint: rgba(222, 232, 248, .34);
    --line: rgba(255, 255, 255, .09);
    --card-bg: linear-gradient(158deg, rgba(19, 35, 60, .88) 0%, rgba(7, 16, 30, .86) 58%, rgba(9, 20, 36, .9) 100%);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
html { color-scheme: dark; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Segoe UI Variable Display', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--navy-950);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
::selection { background: rgba(212, 175, 55, .32); color: #fff; }

/* ---------- Depth layers ---------- */
.scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .9;
}
.ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(1200px 700px at 12% -12%, #143563 0%, transparent 58%),
        radial-gradient(1000px 620px at 108% 112%, #16324f 0%, transparent 60%),
        linear-gradient(168deg, #040a13 0%, #071120 46%, #081a2c 100%);
}
.aura {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .5;
    will-change: transform;
    animation: drift 22s ease-in-out infinite alternate;
}
.aura.a1 { width: 640px; height: 640px; left: -16%; top: -24%; background: #173d75; }
.aura.a2 { width: 540px; height: 540px; right: -14%; bottom: -22%; background: #806018; opacity: .42; animation-delay: -8s; }
.aura.a3 { width: 420px; height: 420px; left: 48%; top: 34%; background: #0a5b66; opacity: .23; animation-delay: -14s; }
@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(48px, -36px, 0) scale(1.1); }
}
.grid-floor {
    position: fixed;
    left: -24%;
    right: -24%;
    bottom: -16%;
    height: 54vh;
    z-index: 0;
    pointer-events: none;
    opacity: .34;
    background-image:
        linear-gradient(rgba(212, 175, 55, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, .16) 1px, transparent 1px);
    background-size: 52px 52px;
    transform: perspective(540px) rotateX(64deg);
    transform-origin: bottom center;
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, .85), transparent 72%);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, .85), transparent 72%);
    animation: gridFlow 16s linear infinite;
}
@keyframes gridFlow { to { background-position: 0 52px, 52px 0; } }
.grain {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: .032;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Stage ---------- */
.stage {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1120px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: clamp(24px, 5vh, 54px) clamp(24px, 5vw, 64px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 412px;
    column-gap: clamp(30px, 5vw, 72px);
    align-items: center;
}

/* ---------- 3D crest ---------- */
.showcase { justify-self: end; width: 100%; max-width: 440px; }
.js .kicker, .js .display, .js .lede, .js .motto,
.js .emblem-wrap, .js .card-stage, .js .page-foot { opacity: 0; }
.js .kicker, .js .display, .js .lede, .js .motto { transform: translateY(16px); }
.js .emblem-wrap { transform: translateY(16px) scale(.82) rotateY(-18deg); }
.js .card-stage { transform: translateY(26px) scale(.976); }
.is-ready .kicker, .is-ready .display, .is-ready .lede, .is-ready .motto,
.is-ready .emblem-wrap, .is-ready .card-stage, .is-ready .page-foot {
    opacity: 1;
    transform: none;
    transition: opacity .85s var(--ease-out), transform .95s var(--ease-out);
}
.is-ready .emblem-wrap { transition-delay: .02s; }
.is-ready .kicker { transition-delay: .08s; }
.is-ready .display { transition-delay: .14s; }
.is-ready .lede { transition-delay: .2s; }
.is-ready .motto { transition-delay: .26s; }
.is-ready .card-stage { transition-delay: .12s; }
.is-ready .page-foot { transition-delay: .3s; }
.emblem-wrap {
    position: relative;
    width: 174px;
    height: 174px;
    margin: 0 0 26px;
    perspective: 760px;
}
.emblem-glow {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, .4) 0%, rgba(39, 88, 155, .28) 44%, transparent 70%);
    filter: blur(28px);
    animation: glowPulse 5.5s ease-in-out infinite;
}
@keyframes glowPulse {
    0%, 100% { opacity: .7; transform: scale(.96); }
    50%      { opacity: 1; transform: scale(1.08); }
}
.emblem-float {
    position: absolute;
    inset: 0;
    animation: floaty 7s ease-in-out infinite;
    will-change: transform;
}
@keyframes floaty {
    0%, 100% { transform: translateY(0) rotateZ(0); }
    50%      { transform: translateY(-9px) rotateZ(-1.4deg); }
}
.emblem-tilt {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: rotateX(var(--ex, 0deg)) rotateY(var(--ey, 0deg));
    filter: drop-shadow(0 26px 34px rgba(0, 0, 0, .55));
    will-change: transform;
}
.orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, .26);
    transform-style: preserve-3d;
}
.orbit-a { animation: orbitA 18s linear infinite; }
.orbit-b { inset: 8%; border-color: rgba(150, 200, 255, .16); animation: orbitB 26s linear infinite reverse; }
@keyframes orbitA {
    from { transform: rotateX(74deg) rotateZ(0deg); }
    to   { transform: rotateX(74deg) rotateZ(360deg); }
}
@keyframes orbitB {
    from { transform: rotateX(64deg) rotateY(16deg) rotateZ(0deg); }
    to   { transform: rotateX(64deg) rotateY(16deg) rotateZ(360deg); }
}
.orbit i {
    position: absolute;
    top: 50%;
    right: -3px;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-radius: 50%;
    background: var(--gold-soft);
    box-shadow: 0 0 10px 3px rgba(242, 223, 160, .55);
}
.orbit-b i { background: #a9d0ff; box-shadow: 0 0 10px 3px rgba(150, 200, 255, .5); }
.coin {
    position: absolute;
    inset: 17%;
    transform-style: preserve-3d;
}
.coin-edge {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 210deg, #6d5010, #f7e9b2, #b78f24, #7a5c12, #f7e9b2, #8a6a1d, #6d5010);
    transform: translateZ(-7px);
    box-shadow: 0 0 0 1px rgba(255, 240, 190, .18), 0 16px 34px rgba(0, 0, 0, .55);
}
.coin-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: grid;
    place-items: center;
}
.coin-front {
    transform: translateZ(9px);
    background: radial-gradient(circle at 32% 24%, #1b3457 0%, #0a1728 58%, #060d18 100%);
    border: 2px solid rgba(212, 175, 55, .58);
    box-shadow: inset 0 2px 8px rgba(255, 255, 255, .18), inset 0 -10px 24px rgba(0, 0, 0, .6);
    overflow: hidden;
}
.coin-front img {
    width: 78%;
    height: 78%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 8px 20px rgba(0, 0, 0, .5);
}
.coin-sheen {
    position: absolute;
    inset: -30%;
    background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .38) 48%, transparent 58%);
    transform: translateX(-120%);
    animation: coinShine 6.5s ease-in-out infinite;
}
@keyframes coinShine {
    0%, 62% { transform: translateX(-120%); }
    78%, 100% { transform: translateX(120%); }
}
.coin-back {
    transform: rotateY(180deg) translateZ(9px);
    background: radial-gradient(circle at 34% 26%, #f7e9b2 0%, #d4af37 46%, #8a6a1d 100%);
    color: #0a1728;
    font-family: 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    font-size: 3.1rem;
    font-weight: 700;
    border: 2px solid rgba(255, 244, 200, .5);
}
.spark {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--gold-soft);
    box-shadow: 0 0 8px 2px rgba(242, 223, 160, .5);
    animation: twinkle 3.6s ease-in-out infinite;
}
.spark.sp1 { top: 12%; right: 4%; animation-delay: -.4s; }
.spark.sp2 { bottom: 16%; left: -4%; width: 2px; height: 2px; animation-delay: -2.1s; }
.spark.sp3 { top: 44%; left: -12%; width: 2px; height: 2px; animation-delay: -1.2s; }
@keyframes twinkle {
    0%, 100% { opacity: .25; transform: scale(.7); }
    50%      { opacity: 1; transform: scale(1.25); }
}

/* ---------- Showcase copy ---------- */
.kicker {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .21em;
    text-transform: uppercase;
    color: rgba(242, 223, 160, .92);
}
.kicker::before {
    content: "";
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
    flex: 0 0 auto;
}
.display {
    margin: 13px 0 0;
    font-size: clamp(2rem, 3.4vw, 2.85rem);
    font-weight: 700;
    line-height: 1.07;
    letter-spacing: -.035em;
    color: #fff;
    text-wrap: balance;
}
.display em {
    font-family: 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    letter-spacing: -.01em;
    color: var(--gold-soft);
}
.lede {
    margin: 17px 0 0;
    max-width: 392px;
    font-size: .9rem;
    line-height: 1.7;
    color: var(--muted);
}
.motto {
    margin: 24px 0 0;
    padding-left: 15px;
    border-left: 1px solid rgba(212, 175, 55, .42);
    font-family: 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    font-style: italic;
    font-size: .87rem;
    color: rgba(242, 223, 160, .78);
}
@keyframes riseIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Card ---------- */
.panel {
    justify-self: start;
    width: 100%;
    max-width: 412px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.card-stage {
    width: 100%;
    perspective: 1200px;
}
.auth-card {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 29px 30px 23px;
    border-radius: 22px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, .1);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    backdrop-filter: blur(24px) saturate(150%);
    box-shadow:
        0 32px 84px rgba(0, 0, 0, .56),
        0 2px 0 rgba(255, 255, 255, .04) inset,
        inset 0 1px 0 rgba(255, 255, 255, .16);
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .13s ease-out;
    will-change: transform;
}
.auth-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    padding: 1px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--glint, 0deg),
        rgba(255, 255, 255, 0) 0deg,
        rgba(212, 175, 55, .92) 42deg,
        rgba(255, 255, 255, .5) 68deg,
        rgba(255, 255, 255, 0) 118deg,
        rgba(255, 255, 255, 0) 360deg
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    animation: glintSpin 7s linear infinite;
    pointer-events: none;
    z-index: 2;
}
@keyframes glintSpin { to { --glint: 360deg; } }
.card-aura {
    position: absolute;
    left: 6%;
    right: 6%;
    top: -26%;
    height: 46%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, .2), transparent 66%);
    filter: blur(30px);
    pointer-events: none;
}
.card-sheen {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--px, 50%) var(--py, -10%), rgba(255, 255, 255, .085), transparent 62%);
    pointer-events: none;
}
.card-head { position: relative; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: rgba(242, 223, 160, .9);
}
.eyebrow i { font-size: .72rem; opacity: .85; }
.auth-card h1 {
    margin: 11px 0 5px;
    font-size: 1.52rem;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.2;
}
.auth-card .sub {
    margin: 0 0 20px;
    font-size: .84rem;
    line-height: 1.5;
    color: var(--muted);
}

/* ---------- Error ---------- */
.auth-error {
    position: relative;
    display: none;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 15px;
    padding: 11px 13px;
    border-radius: 12px;
    font-size: .82rem;
    line-height: 1.4;
    color: #ffd9dd;
    background: rgba(190, 40, 58, .18);
    border: 1px solid rgba(255, 120, 132, .34);
    box-shadow: 0 10px 26px rgba(150, 20, 35, .18);
    transform-origin: top center;
}
.auth-error.show { display: flex; animation: errorIn .42s var(--ease-out); }
.auth-error i { margin-top: 2px; color: #ff9aa5; flex: 0 0 auto; }
@keyframes errorIn {
    from { opacity: 0; transform: rotateX(-72deg) translateY(-6px); }
    to   { opacity: 1; transform: none; }
}
.panel.shake { animation: hudShake .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes hudShake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

/* ---------- Fields ---------- */
.field-row { margin-bottom: 14px; }
.field-label {
    display: block;
    margin-bottom: 7px;
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: rgba(222, 232, 248, .6);
}
.field { position: relative; }
.field .ico {
    position: absolute;
    left: 15px;
    top: 50%;
    width: 26px;
    height: 26px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    color: rgba(222, 232, 248, .44);
    pointer-events: none;
}
.field .ico i {
    font-size: .9rem;
    transition: color .25s, transform .35s var(--ease-out);
}
.field:focus-within .ico i { color: var(--gold-soft); transform: scale(1.12) rotate(-6deg); }
.field input {
    width: 100%;
    height: 51px;
    padding: 0 48px 0 50px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .038);
    color: #fff;
    font-family: inherit;
    font-size: .93rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), inset 0 10px 24px rgba(0, 0, 0, .12);
    transition: border-color .22s, background .22s, box-shadow .22s;
}
.field input::placeholder { color: rgba(222, 232, 248, .32); }
.field input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, .72);
    background: rgba(255, 255, 255, .06);
    box-shadow:
        0 0 0 4px rgba(212, 175, 55, .12),
        0 10px 26px rgba(0, 0, 0, .22),
        inset 0 1px 0 rgba(255, 255, 255, .06);
}
.field input:focus-visible { outline: none; }
.focus-line {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
    transform: scaleX(0);
    transition: transform .42s var(--ease-out);
    pointer-events: none;
}
.field:focus-within .focus-line { transform: scaleX(1); }
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #12233c inset;
    border-color: rgba(255, 255, 255, .12);
}
.toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: rgba(222, 232, 248, .5);
    cursor: pointer;
    transition: color .2s, background .2s;
}
.toggle-pass:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.toggle-pass:focus-visible { outline: 2px solid rgba(212, 175, 55, .75); outline-offset: 1px; }
.toggle-pass i.flip { animation: iconFlip .42s var(--ease-out); }
@keyframes iconFlip {
    from { transform: rotateY(0deg); }
    to   { transform: rotateY(360deg); }
}
.caps-hint {
    display: none;
    align-items: center;
    gap: 7px;
    margin: -5px 0 12px;
    font-size: .74rem;
    color: #ffd88a;
}
.caps-hint.show { display: flex; animation: riseIn .3s var(--ease-out); }

/* ---------- Button ---------- */
.btn-auth {
    position: relative;
    width: 100%;
    height: 51px;
    margin-top: 5px;
    border: 0;
    border-radius: 13px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #f7e7a5 0%, #d4af37 46%, #b0861f 100%);
    color: #0a1526;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .015em;
    cursor: pointer;
    box-shadow:
        0 16px 34px rgba(212, 175, 55, .26),
        0 2px 0 rgba(255, 255, 255, .18) inset,
        inset 0 -2px 0 rgba(90, 60, 0, .25);
    transition: transform .18s var(--ease-out), box-shadow .18s, filter .18s;
}
.btn-auth::before {
    content: "";
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: -60%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-18deg);
    animation: btnSweep 5.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes btnSweep {
    0%, 58% { left: -60%; }
    78%, 100% { left: 130%; }
}
.btn-auth > * { position: relative; z-index: 1; }
.btn-auth .arrow { transition: transform .25s var(--ease-out); }
.btn-auth:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(212, 175, 55, .38), 0 2px 0 rgba(255, 255, 255, .22) inset, inset 0 -2px 0 rgba(90, 60, 0, .25);
    filter: brightness(1.04);
}
.btn-auth:hover .arrow { transform: translateX(4px); }
.btn-auth:active:not(:disabled) { transform: translateY(0) scale(.995); }
.btn-auth:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.btn-auth:disabled { opacity: .72; cursor: progress; transform: none; }
.btn-auth:disabled::before { animation: none; }

/* ---------- Card foot ---------- */
.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .73rem;
    color: rgba(222, 232, 248, .42);
}
.secure-flag { display: inline-flex; align-items: center; gap: 7px; }
.secure-flag .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 3px rgba(62, 224, 176, .14), 0 0 10px rgba(62, 224, 176, .5);
    animation: livePulse 2.6s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(62, 224, 176, .14), 0 0 10px rgba(62, 224, 176, .45); }
    50%      { box-shadow: 0 0 0 5px rgba(62, 224, 176, .07), 0 0 14px rgba(62, 224, 176, .6); }
}
.help-toggle {
    border: 0;
    background: none;
    padding: 0;
    font-family: inherit;
    font-size: .73rem;
    color: rgba(242, 223, 160, .88);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color .2s;
}
.help-toggle:hover { color: var(--gold-soft); }
.help-toggle:focus-visible { outline: 2px solid rgba(212, 175, 55, .75); outline-offset: 2px; border-radius: 3px; }
.help-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    z-index: 8;
    width: auto;
    max-height: 0;
    margin-top: 0;
    padding: 0 13px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    overflow: hidden;
    opacity: 0;
    border-radius: 11px;
    font-size: .76rem;
    line-height: 1.55;
    color: rgba(222, 232, 248, .78);
    background: rgba(8, 18, 33, .97);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid transparent;
    box-shadow: 0 22px 48px rgba(0, 0, 0, .55);
    transform: perspective(700px) rotateX(-72deg);
    transform-origin: top center;
    transition: max-height .4s var(--ease-out), opacity .3s, transform .4s var(--ease-out), margin .4s, padding .4s, border-color .3s;
}
.help-panel::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 38px;
    width: 11px;
    height: 11px;
    background: rgba(8, 18, 33, .97);
    border-left: 1px solid rgba(255, 255, 255, .1);
    border-top: 1px solid rgba(255, 255, 255, .1);
    transform: rotate(45deg);
}
.help-panel.open {
    max-height: 190px;
    margin-top: 0;
    padding: 11px 13px;
    opacity: 1;
    border-color: rgba(255, 255, 255, .1);
    transform: perspective(700px) rotateX(0deg);
}
.help-panel i { margin-top: 3px; color: var(--gold-soft); flex: 0 0 auto; }
.page-foot {
    margin: 15px 0 0;
    font-size: .68rem;
    line-height: 1.4;
    color: rgba(222, 232, 248, .3);
    text-align: center;
}
.page-foot span { margin: 0 5px; opacity: .5; }

/* ---------- Success unlock ---------- */
.success-flash {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transform: scale(.55);
    background: radial-gradient(circle at 50% 48%, rgba(255, 245, 205, .8) 0%, rgba(212, 175, 55, .3) 22%, transparent 56%);
    transition: opacity .25s ease, transform 1.15s var(--ease-out);
}
body.is-unlocking .success-flash { opacity: 1; transform: scale(1.65); }
body.is-unlocking .card-stage {
    opacity: 0;
    transform: translateY(-12px) scale(1.035);
    transition: opacity .55s ease, transform .85s var(--ease-out);
}
body.is-unlocking .showcase { opacity: .35; transition: opacity .8s ease; }
body.is-unlocking .emblem-float { animation: unlockLift 1.1s var(--ease-out) forwards; }
@keyframes unlockLift {
    to { transform: translateY(-16px) scale(1.06); filter: brightness(1.18); }
}
body.is-unlocking { cursor: progress; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .stage {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        row-gap: 24px;
        max-width: 560px;
        padding: 28px 20px;
    }
    .showcase { justify-self: center; max-width: 440px; text-align: center; }
    .emblem-wrap { width: 146px; height: 146px; margin: 0 auto 14px; }
    .kicker { justify-content: center; font-size: .6rem; letter-spacing: .17em; }
    .kicker::before { width: 18px; }
    .display { font-size: 1.7rem; margin-top: 10px; }
    .lede { margin: 12px auto 0; font-size: .82rem; max-width: 340px; }
    .motto { display: none; }
    .panel { justify-self: center; max-width: 420px; }
    .field input { font-size: 16px; }
    .page-foot { margin-top: 12px; }
    .help-panel {
        position: static;
        width: 100%;
        top: auto;
        background: rgba(255, 255, 255, .05);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: none;
    }
    .help-panel::before { display: none; }
    .help-panel.open { margin-top: 12px; }
}
@media (max-width: 480px) {
    .stage { padding: 20px 14px 24px; row-gap: 18px; }
    .emblem-wrap { width: 118px; height: 118px; margin-bottom: 10px; }
    .display { font-size: 1.45rem; }
    .lede { display: none; }
    .auth-card { padding: 23px 20px 19px; border-radius: 18px; }
    .auth-card h1 { font-size: 1.36rem; }
    .auth-card .sub { margin-bottom: 16px; }
    .field input, .btn-auth { height: 50px; }
    .card-foot { margin-top: 15px; }
}
@media (max-width: 860px) and (max-height: 740px) {
    .emblem-wrap { width: 104px; height: 104px; margin-bottom: 8px; }
    .display { display: none; }
    .lede { display: none; }
}
@media (max-height: 720px) and (min-width: 861px) {
    .stage { padding-top: 20px; padding-bottom: 20px; }
    .emblem-wrap { width: 158px; height: 158px; margin-bottom: 18px; }
    .display { font-size: 2.35rem; }
    .lede { margin-top: 12px; font-size: .86rem; }
    .motto { margin-top: 16px; }
    .auth-card { padding: 25px 28px 20px; }
    .auth-card .sub { margin-bottom: 17px; }
    .field-row { margin-bottom: 12px; }
    .field input, .btn-auth { height: 49px; }
    .card-foot { margin-top: 15px; padding-top: 12px; }
    .page-foot { margin-top: 11px; }
}
@media (prefers-reduced-transparency: reduce) {
    .auth-card { background: #0a1728; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
.noscript {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: .8rem;
    color: #ffe1a8;
    background: rgba(212, 175, 55, .12);
    border: 1px solid rgba(212, 175, 55, .3);
}

/* ---------- Signed-out state (shares the sign-in stage) ---------- */
.logout-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 0 16px;
    padding: 13px 14px;
    border-radius: 13px;
    background: rgba(62, 224, 176, .08);
    border: 1px solid rgba(62, 224, 176, .22);
}
.logout-status .status-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--mint);
    background: rgba(62, 224, 176, .14);
    box-shadow: 0 0 0 1px rgba(62, 224, 176, .22) inset;
}
.logout-status strong {
    display: block;
    font-size: .85rem;
    color: #f5f8fd;
}
.logout-status small {
    display: block;
    margin-top: 2px;
    font-size: .74rem;
    color: rgba(222, 232, 248, .55);
}
.logout-countdown {
    margin: 0 0 16px;
    padding: 14px 15px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .035);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.countdown-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(222, 232, 248, .55);
}
.countdown-top strong {
    font-size: 1.35rem;
    letter-spacing: 0;
    color: var(--gold-soft);
}
.countdown-track {
    height: 3px;
    margin-top: 12px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .09);
    overflow: hidden;
}
.countdown-track span {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
    transition: width 1s linear;
}
.logout-actions {
    display: grid;
    gap: 10px;
}
.logout-actions .btn-auth {
    text-decoration: none;
}
.logout-actions .btn-quiet {
    background: rgba(255, 255, 255, .05);
    color: rgba(242, 223, 160, .92);
    border: 1px solid rgba(212, 175, 55, .34);
    box-shadow: none;
    font-size: .88rem;
}
.logout-actions .btn-quiet::before { display: none; }
.logout-actions .btn-quiet:hover:not(:disabled) {
    background: rgba(212, 175, 55, .12);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
}
.foot-hint { color: rgba(222, 232, 248, .38); }
@media (max-width: 480px) {
    .logout-status { padding: 11px 12px; }
    .logout-actions .btn-auth { height: 50px; }
}