/* Dedicated sign-in page. The stage stays dark in both themes; the panel follows the theme. */
.login-shell {
    --lg-ink: var(--ui-ink); --lg-muted: var(--ui-muted); --lg-faint: var(--ui-muted); --lg-line: var(--ui-border);
    --lg-paper: var(--ui-background); --lg-field: var(--ui-surface); --lg-field-line: var(--ui-field-border); --lg-accent: var(--ui-primary);
    --lg-accent-hover: var(--ui-primary-hover); --lg-gold: var(--ui-bronze); --lg-focus: var(--ui-focus-wash);
    --lg-error-bg: var(--ui-error-surface); --lg-error-line: var(--ui-error-border); --lg-error: var(--ui-error);
    --lg-notice-bg: var(--ui-selected);
    min-height: calc(100dvh - var(--site-nav-h, 0px)); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(460px, .9fr);
    background: var(--lg-paper); color: var(--lg-ink);
}

/* Stage */
.login-stage {
    position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column;
    padding: 34px 48px 44px; color: #eef3ea;
    background: radial-gradient(120% 80% at 50% 45%, #1f4a3b 0%, #133229 45%, #0b1f19 100%);
}
.login-stage::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(180deg, #0b1f1900 60%, #0b1f19cc 100%), linear-gradient(90deg, #0000 92%, #d9bb7814 100%);
}
.login-stage::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
    background: linear-gradient(180deg, #d9bb7800, #d9bb7899 50%, #d9bb7800);
}
.login-art { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 10px 0; }
.login-art > svg { display: block; width: auto; height: 100%; max-width: 100%; max-height: 600px; aspect-ratio: 640 / 600; overflow: visible; }
.login-stage-copy { max-width: 520px; }
.login-eyebrow { display: flex; align-items: center; gap: 9px; font-size: 10px; font-weight: 650; letter-spacing: 1.8px; color: #d9bb78; }
.login-eyebrow > i { width: 6px; height: 6px; border-radius: 50%; background: #d9bb78; box-shadow: 0 0 0 4px #d9bb7826; animation: lg-pulse 2.8s ease-in-out infinite; }
.login-stage-title { margin-top: 14px; font: 700 clamp(24px, 2.4vw, 34px)/1.25 'Manrope', sans-serif; letter-spacing: -.9px; color: #f6f3e8; text-wrap: balance; }
.login-stage-facts { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 24px 0 0; padding: 20px 0 0; list-style: none; border-top: 1px solid #ffffff1a; font-size: 12px; color: #b5c8b9; }
.login-stage-facts li { display: flex; align-items: center; gap: 9px; }
.login-stage-facts .icon { color: #d9bb78; }
.login-stage-facts strong { color: #f6f3e8; font-weight: 650; }

/* SVG animation */
.login-art svg * { transform-box: view-box; transform-origin: 320px 300px; }
.art-spin { animation: lg-spin 90s linear infinite; }
.art-slow { animation-duration: 160s; }
.art-reverse { animation-direction: reverse; animation-duration: 120s; }
.art-dial .tick-major { stroke: #d9bb78; stroke-opacity: .7; stroke-width: 1.4; }
.art-sweep { animation-duration: 14s; }
.art-orbit-a { animation-duration: 38s; }
.art-orbit-b { animation-duration: 54s; animation-direction: reverse; }
.art-orbit-c { animation-duration: 26s; }
.art-breathe { animation: lg-breathe 6s ease-in-out infinite; }
.art-draw { fill-opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1; animation: lg-draw 2.2s cubic-bezier(.65, 0, .35, 1) var(--delay, 0s) forwards; }
.art-fill { fill: url(#lg-marble); animation-name: lg-draw, lg-fill; animation-duration: 2.2s, 1.4s; animation-delay: var(--delay, 0s), calc(var(--delay, 0s) + 1.6s); animation-fill-mode: forwards; }
.login-art .art-star { opacity: 0; transform-box: fill-box; transform-origin: center; animation: lg-star 3.2s ease-in-out 2.4s infinite; }
.art-flow { stroke-width: 1.2; stroke-dasharray: 3 12; animation: lg-flow 2.6s linear infinite; }
.art-flow-slow { animation-duration: 4.4s; }
.art-nodes circle, .art-windows rect, .art-particles circle { transform-box: fill-box; transform-origin: center; }
.art-nodes circle { animation: lg-node 2.4s ease-in-out var(--d, 0s) infinite; }
.art-windows rect { opacity: .12; animation: lg-window 5s ease-in-out calc(1.4s + var(--d, 0s)) infinite; }
.art-particles circle { opacity: 0; animation: lg-rise var(--t, 12s) ease-in var(--d, 0s) infinite; }

@keyframes lg-spin { to { transform: rotate(360deg); } }
@keyframes lg-breathe { 50% { opacity: .65; } }
@keyframes lg-draw { to { stroke-dashoffset: 0; } }
@keyframes lg-fill { to { fill-opacity: .94; } }
@keyframes lg-star { 0%, 100% { opacity: .5; transform: scale(.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1.15) rotate(45deg); } }
@keyframes lg-flow { to { stroke-dashoffset: -30; } }
@keyframes lg-node { 50% { transform: scale(1.8); opacity: .45; } }
@keyframes lg-window { 0%, 100% { opacity: .12; } 40%, 70% { opacity: .85; } }
@keyframes lg-rise { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: .7; } 100% { opacity: 0; transform: translateY(-260px); } }
@keyframes lg-pulse { 50% { box-shadow: 0 0 0 7px #d9bb7800; } }
@keyframes lg-rise-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes lg-seal { to { stroke-dashoffset: 0; } }
@keyframes lg-spinner { to { transform: rotate(360deg); } }
@keyframes lg-sheen { to { transform: translateX(260%) skewX(-20deg); } }

/* Panel */
.login-panel { display: flex; flex-direction: column; min-width: 0; padding: 28px 56px 36px; }
.login-card { width: 100%; margin: auto; padding: 44px 0 32px; }
.login-card > * { animation: lg-rise-in .7s cubic-bezier(.2, .7, .2, 1) backwards; }
.login-card > :nth-child(2) { animation-delay: .06s; }
.login-card > :nth-child(3) { animation-delay: .12s; }
.login-card > :nth-child(4) { animation-delay: .18s; }
.login-card > :nth-child(n+5) { animation-delay: .26s; }

.login-seal { color: var(--lg-accent); }
:root[data-theme="dark"] .login-seal { color: #9fd1b4; }
.login-seal svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke-linecap: round; }
.login-seal circle { stroke: var(--lg-line); stroke-width: 1; }
.login-seal .seal-ring { stroke: var(--lg-gold); stroke-width: 1.3; stroke-dasharray: 1; stroke-dashoffset: 1; transform: rotate(-90deg); transform-origin: center; animation: lg-seal 1.6s cubic-bezier(.65, 0, .35, 1) .3s forwards; }
.login-eyebrow-dark { color: var(--lg-gold); }
.login-card h1 { margin: 14px 0 12px; font: 750 clamp(30px, 3vw, 40px)/1.12 'Manrope', sans-serif; letter-spacing: -1.6px; }
.login-lead { color: var(--lg-muted); font-size: 14px; line-height: 1.75; }

.login-alert, .login-notice { display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.55; }
.login-alert { color: var(--lg-error); background: var(--lg-error-bg); border: 1px solid var(--lg-error-line); }
.login-notice { color: var(--lg-muted); background: var(--lg-notice-bg); }
:is(.login-alert, .login-notice) > .icon { margin-top: 1px; }

.login-form { margin-top: 28px; }
.login-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.login-field + .login-field { margin-top: 18px; }
.login-field label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--lg-ink); }
.login-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.login-caps { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--lg-gold); }
.login-forgot { font-size: 11.5px; font-weight: 600; color: var(--lg-gold); text-decoration: none; transition: color .15s; }
.login-forgot:hover { color: var(--lg-accent); text-decoration: underline; text-underline-offset: 3px; }
.login-input { position: relative; }
.login-input > .icon { position: absolute; left: 15px; top: 50%; translate: 0 -50%; color: var(--lg-faint); pointer-events: none; transition: color .2s; }
.login-input > input:not([type=hidden]) {
    display: block; width: 100%; min-height: 52px; padding: 13px 48px 13px 46px;
    background: var(--lg-field); border: 1px solid var(--lg-field-line); border-radius: 11px;
    color: var(--lg-ink); font-size: 14px; line-height: 1.5;
    box-shadow: 0 1px 2px #1c312908, inset 0 1px 0 #ffffff0d;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
:root[data-theme="dark"] .login-shell .login-input > input:not([type=hidden]) { background: var(--lg-field); border-color: var(--lg-field-line); }
:root[data-theme="dark"] .login-shell .login-input > input:not([type=hidden]):focus { border-color: #9fd1b4; }
.login-input > input::placeholder { color: var(--lg-faint); }
.login-input > input:hover { border-color: color-mix(in srgb, var(--lg-field-line), var(--lg-ink) 18%); }
.login-input > input:focus { outline: none; border-color: var(--lg-accent); box-shadow: 0 0 0 4px var(--lg-focus); }
:root[data-theme="dark"] .login-input > input:focus { border-color: #9fd1b4; }
.login-input:focus-within > .icon { color: var(--lg-accent); }
:root[data-theme="dark"] .login-input:focus-within > .icon { color: #9fd1b4; }
.login-input > input[aria-invalid="true"] { border-color: var(--lg-error-line); }
.login-reveal { position: absolute; right: 6px; top: 50%; translate: 0 -50%; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; color: var(--lg-faint); transition: color .15s, background .15s; }
.login-reveal:hover { color: var(--lg-ink); background: color-mix(in srgb, var(--lg-field-line), transparent 55%); }
.login-reveal .reveal-hide, .login-reveal[aria-pressed="true"] .reveal-show { display: none; }
.login-reveal[aria-pressed="true"] .reveal-hide { display: inline-block; }

.login-turnstile { margin-top: 22px; }
.login-turnstile .cf-turnstile { min-height: 65px; }
.login-turnstile-hint { margin-top: 8px; font-size: 12px; line-height: 1.5; color: var(--lg-error); }

.login-submit {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%; min-height: 54px; margin-top: 26px; padding: 14px 22px; border-radius: 11px;
    background: linear-gradient(180deg, #2c6450 0%, var(--lg-accent) 55%, #1c4537 100%);
    color: #fffdf5; font-size: 14px; font-weight: 650; letter-spacing: .1px;
    box-shadow: inset 0 0 0 1px #d9bb7840, inset 0 1px 0 #ffffff26, 0 10px 24px -10px #173a2fcc;
    transition: transform .15s, box-shadow .2s, filter .2s;
}
:root[data-theme="dark"] .login-submit { background: linear-gradient(180deg, #4b805f 0%, var(--lg-accent) 60%, #315a43 100%); box-shadow: inset 0 0 0 1px #dbb77b4d, inset 0 1px 0 #ffffff1f, 0 10px 26px -12px #000; }
.login-submit::before { content: ''; position: absolute; inset: 0 auto 0 -40%; width: 40%; background: linear-gradient(90deg, #fff0, #ffffff2e, #fff0); transform: translateX(-100%) skewX(-20deg); }
.login-submit:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 0 0 0 1px #d9bb7866, inset 0 1px 0 #ffffff26, 0 16px 30px -12px #173a2fcc; }
.login-submit:hover:not(:disabled)::before { animation: lg-sheen .9s ease; }
.login-submit:active:not(:disabled) { transform: translateY(0); }
.login-submit-icon { transition: transform .2s; }
.login-submit:hover .login-submit-icon { transform: translateX(3px); }
.login-spinner { display: none; width: 17px; height: 17px; border: 2px solid #ffffff4d; border-top-color: #fff; border-radius: 50%; animation: lg-spinner .7s linear infinite; }
.login-submit.is-loading { pointer-events: none; }
.login-submit.is-loading .login-spinner { display: block; }
.login-submit.is-loading .login-submit-icon { display: none; }

.login-divider { display: flex; align-items: center; gap: 14px; margin: 30px 0 16px; font-size: 11px; color: var(--lg-faint); font-weight: 550; letter-spacing: .3px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--lg-line); }
.login-secondary { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 18px; border: 1px solid var(--lg-field-line); border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--lg-ink); transition: border-color .2s, background .2s; }
.login-secondary > .icon { color: var(--lg-gold); }
.login-secondary:hover { border-color: var(--lg-gold); background: color-mix(in srgb, var(--lg-gold), transparent 93%); }

.login-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin: 30px 0 0; padding: 0; list-style: none; font-size: 11px; color: var(--lg-faint); }
.login-trust li { display: inline-flex; align-items: center; gap: 6px; }
.login-trust .icon { color: var(--lg-gold); }

.login-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 1080px) {
    .login-shell { grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr); }
    .login-stage { padding: 30px 34px 36px; }
    .login-panel { padding-inline: 40px; }
}
@media (max-width: 860px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-stage { min-height: 0; padding: 22px 16px 26px; }
    .login-stage::after { inset: auto 0 0; width: auto; height: 1px; background: linear-gradient(90deg, #d9bb7800, #d9bb7899 50%, #d9bb7800); }
    .login-art { height: min(76vw, 340px); flex: none; padding: 4px 0 12px; }
    .login-stage-title { font-size: 22px; }
    .login-stage-facts { margin-top: 18px; padding-top: 16px; gap: 8px 18px; font-size: 11px; }
    .login-panel { padding: 18px 16px 22px; }
    .login-card { padding: 28px 0 26px; }
}
@media (max-width: 420px) {
    .login-card h1 { font-size: 29px; }
    .login-trust { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .login-shell *, .login-shell *::before { animation: none !important; transition: none !important; }
    .art-draw { stroke-dashoffset: 0; }
    .art-fill { fill-opacity: .94; }
    .login-art .art-star { opacity: 1; }
    .art-windows rect { opacity: .55; }
    .login-seal .seal-ring { stroke-dashoffset: 0; }
}
