/* ============================================================
   Merdeka 118 Login — "Dusk over Kuala Lumpur"
   Kiosk Management System · Merdeka 118 · Xyreon Technology
   ============================================================

   DESIGN INTENT
   Enterprise split-canvas. The left brand panel is the golden hour
   over Kuala Lumpur — a midnight-to-amber dusk sky with a faceted
   SVG elevation of the Merdeka 118 tower catching the sunset — and
   the right panel is quiet porcelain with gold accents. Prestigious,
   warm, flagship. A serif display voice against a calm sans body.

   ARCHITECTURE
   js/xyreon-login.js injects `.xy-stage` as a DIRECT child of <body>
   (outside AdminLTE's .wrapper, immune to PushMenu transforms) and
   relocates the generated `.ew-login-box` into the right panel.

   Stack:
     body                        #060d1e fallback
     .xy-stage (fixed, grid)     z 0 — fills viewport
       .xy-brand  (left, dusk)   sky gradient + .xy-scene SVG
       .xy-panel  (right, light) holds .ew-login-box / form

   PERFORMANCE / A11Y
   • Entrance: transform + opacity only (GPU composited)
   • Scene: one inline SVG, zero network requests
   • Facet shimmer / beacon / stars: opacity-only keyframes
   • prefers-reduced-motion fully honored
   ============================================================ */

/* Fonts: intentionally zero webfont requests — the sign-in screen
   must render instantly on kiosks and LAN terminals. Display voice
   comes from the OS serif (Palatino Linotype on Windows), body from
   the native UI stack (Segoe UI on Windows). */


/* ── Design tokens ─────────────────────────────────────────── */
:root {
    /* Dusk sky (brand panel) */
    --xy-night-1: #060d1e;
    --xy-night-2: #0b1a38;
    --xy-night-3: #22203f;
    --xy-dusk: #4a2f42;
    --xy-ember: #8a5030;
    --xy-horizon: #d9994d;

    /* Brand panel ink */
    --xy-brand-ink: #f4ede0;
    --xy-brand-ink-soft: #c3cbdd;
    --xy-brand-ink-mute: #7e8aa5;
    --xy-brand-line: rgba(217, 164, 78, 0.22);
    --xy-brand-line-soft: rgba(195, 203, 221, 0.12);

    /* Gold — sunset on the diagrid */
    --xy-gold: #c9973f;
    --xy-gold-bright: #d9a44e;
    --xy-gold-deep: #b3822f;
    --xy-gold-press: #9c7027;
    --xy-gold-ring: rgba(201, 151, 63, 0.22);
    --xy-gold-soft: rgba(201, 151, 63, 0.10);

    /* Porcelain (action panel) */
    --xy-surface: #faf8f3;
    --xy-field: #ffffff;
    --xy-ink: #1c2b4a;
    --xy-ink-soft: #56617a;
    --xy-ink-mute: #8d94a6;
    --xy-border: #e6dfd0;
    --xy-border-strong: #d2c8b2;

    --xy-success: #2e9e6b;
    --xy-danger: #cf3b4e;

    --xy-font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    --xy-serif: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, 'Times New Roman', serif;

    --xy-sp-1: .25rem; --xy-sp-2: .5rem;  --xy-sp-3: .75rem; --xy-sp-4: 1rem;
    --xy-sp-5: 1.25rem; --xy-sp-6: 1.5rem; --xy-sp-8: 2rem;  --xy-sp-10: 2.5rem;

    --xy-r-sm: 8px; --xy-r-md: 11px; --xy-r-lg: 16px;

    --xy-shadow-field: 0 1px 2px rgba(28, 43, 74, 0.05);
    --xy-shadow-btn: 0 6px 18px rgba(179, 130, 47, 0.32);

    --xy-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --xy-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --xy-t-fast: 140ms var(--xy-ease);
    --xy-t-base: 240ms var(--xy-ease);
}


/* ══════════════════════════════════════════════════════════
   HIDE ADMINLTE CHROME
   ══════════════════════════════════════════════════════════ */
body.login-page .main-header,
body.login-page .main-sidebar,
body.login-page .main-footer,
body.login-page .content-header,
.xy-login-active .main-header,
.xy-login-active .main-sidebar,
.xy-login-active .main-footer,
.xy-login-active .content-header {
    display: none !important;
}

body.xy-login-active {
    font-family: var(--xy-font);
    background-color: var(--xy-night-1) !important;
    background-image: none !important;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* The original wrapper is emptied (login box is relocated to .xy-stage). */
body.xy-login-active .wrapper,
body.xy-login-active .content-wrapper,
body.xy-login-active .content-wrapper > .content,
body.xy-login-active .content-wrapper > .content > .container-fluid {
    background: transparent !important;
}
body.xy-login-active .content-wrapper { min-height: 0 !important; }


/* ══════════════════════════════════════════════════════════
   STAGE — full-viewport split grid
   ══════════════════════════════════════════════════════════ */
.xy-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    background: var(--xy-surface);
    overflow: hidden;
}


/* ══════════════════════════════════════════════════════════
   BRAND PANEL (left) — dusk over Kuala Lumpur
   ══════════════════════════════════════════════════════════ */
.xy-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 1rem + 3vw, 4rem);
    color: var(--xy-brand-ink);
    background: linear-gradient(
        172deg,
        var(--xy-night-1) 0%,
        var(--xy-night-2) 38%,
        var(--xy-night-3) 58%,
        var(--xy-dusk) 72%,
        var(--xy-ember) 86%,
        var(--xy-horizon) 100%
    );
    isolation: isolate;
}

/* Soft directional glows — sun low on the horizon, cool sky above.
   Slow drift, transform/opacity only. */
.xy-brand::before {
    content: '';
    position: absolute;
    inset: -25%;
    z-index: -2;
    background:
        radial-gradient(42% 34% at 68% 92%, rgba(255, 190, 110, 0.34), transparent 70%),
        radial-gradient(50% 42% at 18% 8%, rgba(38, 76, 148, 0.28), transparent 74%);
    animation: xyGlow 34s var(--xy-ease) infinite alternate;
}

@keyframes xyGlow {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-2.5%, 1.5%, 0) scale(1.07); }
}

/* — Dusk scene (tower + skyline SVG, injected by JS) — */
.xy-scene {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
.xy-scene__svg {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Stars twinkle — opacity only, imperceptibly slow */
.xy-stars { animation: xyTwinkle 7s ease-in-out infinite alternate; }
@keyframes xyTwinkle {
    from { opacity: 0.85; }
    to   { opacity: 0.4; }
}

/* Gold facets breathe as the sun catches the diagrid */
.xy-facet-gold { animation: xyShimmer 9s ease-in-out infinite; }
.xy-facet-gold:nth-of-type(odd) { animation-delay: 2.4s; }
@keyframes xyShimmer {
    0%, 100% { opacity: 0.88; }
    50%      { opacity: 1; }
}

/* Spire beacon pulse */
.xy-beacon-halo {
    opacity: 0.18;
    animation: xyBeacon 3.2s var(--xy-ease) infinite;
}
@keyframes xyBeacon {
    0%, 100% { opacity: 0.12; }
    45%      { opacity: 0.45; }
}

/* — Identity lockup (Xyreon on top) — */
.xy-brand__top { position: relative; z-index: 1; }

.xy-brand__lockup {
    display: flex;
    align-items: center;
    gap: var(--xy-sp-3);
}

.xy-emblem {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    color: var(--xy-gold-bright);
    filter: drop-shadow(0 4px 12px rgba(201, 151, 63, 0.35));
}
.xy-emblem svg { width: 100%; height: 100%; display: block; }

.xy-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1;
}
.xy-wordmark__name {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--xy-brand-ink);
}
.xy-wordmark__sub {
    margin-top: 5px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.42em;
    color: var(--xy-brand-ink-mute);
}

/* — Headline block — */
.xy-brand__hero {
    position: relative;
    z-index: 1;
    max-width: 34ch;
}

.xy-brand__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--xy-gold-bright);
    margin-bottom: var(--xy-sp-4);
}
.xy-brand__eyebrow::before {
    content: '';
    width: 26px;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

.xy-brand__title {
    font-family: var(--xy-serif);
    font-size: clamp(1.8rem, 1.1rem + 2.1vw, 2.8rem);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: 0.005em;
    color: var(--xy-brand-ink);
    margin: 0 0 var(--xy-sp-4);
}
.xy-brand__lede {
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--xy-brand-ink-soft);
    margin: 0;
    max-width: 30ch;
}

/* — Trust signals — */
.xy-brand__features {
    list-style: none;
    margin: var(--xy-sp-8) 0 0;
    padding: 0;
    display: grid;
    gap: var(--xy-sp-3);
}
.xy-feature {
    display: flex;
    align-items: center;
    gap: var(--xy-sp-3);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--xy-brand-ink-soft);
}
.xy-feature__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: var(--xy-gold-bright);
    background: var(--xy-gold-soft);
    border: 1px solid var(--xy-brand-line);
}
.xy-feature__icon svg { width: 17px; height: 17px; }

/* — Tower stat line — */
.xy-brand__stat {
    margin-top: var(--xy-sp-6);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--xy-gold);
    opacity: 0.9;
}

/* — Footer status row — */
.xy-brand__foot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--xy-sp-4);
    padding-top: var(--xy-sp-5);
    border-top: 1px solid var(--xy-brand-line);
}
.xy-status {
    display: flex;
    align-items: center;
    gap: var(--xy-sp-2);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--xy-brand-ink);
    text-shadow: 0 1px 3px rgba(6, 13, 30, 0.5);
}
.xy-status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--xy-success);
    box-shadow: 0 0 0 0 rgba(46, 158, 107, 0.5);
    animation: xyPulse 2.4s var(--xy-ease) infinite;
}
.xy-status__copy {
    font-size: 0.7rem;
    color: var(--xy-brand-ink-soft);
    text-shadow: 0 1px 3px rgba(6, 13, 30, 0.5);
    margin-top: 3px;
}
.xy-clock {
    text-align: right;
    line-height: 1.2;
}
.xy-clock__time {
    font-size: 1.15rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: var(--xy-brand-ink);
    text-shadow: 0 1px 4px rgba(6, 13, 30, 0.55);
}
.xy-clock__date {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--xy-brand-ink-soft);
    text-shadow: 0 1px 3px rgba(6, 13, 30, 0.5);
    margin-top: 2px;
}

@keyframes xyPulse {
    0%   { box-shadow: 0 0 0 0 rgba(46, 158, 107, 0.45); }
    70%  { box-shadow: 0 0 0 7px rgba(46, 158, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 158, 107, 0); }
}


/* ══════════════════════════════════════════════════════════
   ACTION PANEL (right, porcelain)
   ══════════════════════════════════════════════════════════ */
.xy-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 0.5rem + 4vw, 4rem);
    background: var(--xy-surface);
    overflow-y: auto;
}

/* A whisper of the sunset carries onto the porcelain */
.xy-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(60% 45% at 100% 100%, rgba(201, 151, 63, 0.07), transparent 70%);
}

/* Relocated login box — reset AdminLTE centering/sizing */
.xy-login-active .ew-login-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 372px;
    padding: 0;
    margin: 0;
}

/* Heading lockup (injected into .login-logo) */
.xy-login-active .login-logo {
    text-align: left;
    margin: 0 0 var(--xy-sp-6);
    padding: 0;
}
.xy-form__eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--xy-gold-deep);
    margin-bottom: var(--xy-sp-2);
}
.xy-form__title {
    font-family: var(--xy-serif);
    font-size: 1.85rem;
    font-weight: 500;
    letter-spacing: 0.005em;
    color: var(--xy-ink);
    margin: 0;
    line-height: 1.15;
}

/* Card → flat surface (no card-in-panel chrome) */
.xy-login-active .ew-login-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    margin: 0;
}
.xy-login-active .ew-login-card .card-body {
    padding: 0;
}

/* Localized supporting message */
.xy-login-active .login-box-msg {
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--xy-ink-soft);
    text-align: left;
    margin: 0 0 var(--xy-sp-6);
    padding: 0;
}


/* ── Form fields ──────────────────────────────────────────── */
.xy-login-active .ew-login-form .row.gx-0 {
    display: block;
    margin-bottom: var(--xy-sp-5);
}

.xy-field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--xy-ink-soft);
    margin-bottom: var(--xy-sp-2);
}

.xy-login-active .ew-login-form input.form-control,
.xy-login-active .ew-login-form .ew-form-control,
.xy-login-active .ew-login-form input[type="text"],
.xy-login-active .ew-login-form input[type="password"] {
    font-family: var(--xy-font);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--xy-ink) !important;
    background: var(--xy-field) !important;
    border: 1px solid var(--xy-border) !important;
    border-radius: var(--xy-r-md);
    padding: 0.72rem 0.9rem;
    height: auto;
    width: 100%;
    box-shadow: var(--xy-shadow-field);
    transition: border-color var(--xy-t-fast), box-shadow var(--xy-t-base), background var(--xy-t-fast);
    outline: none;
}

.xy-login-active .ew-login-form input.form-control::placeholder,
.xy-login-active .ew-login-form .ew-form-control::placeholder {
    color: var(--xy-ink-mute);
    font-weight: 400;
}

/* Password mask: render hidden values in a font with well-formed
   mask dots and space them out. When the eye-toggle reveals the
   value (type=text) it falls back to the standard rule above. */
.xy-login-active .ew-login-form input[type="password"]:not(:placeholder-shown) {
    font-family: Verdana, Tahoma, system-ui, sans-serif;
    letter-spacing: 0.16em;
}

.xy-login-active .ew-login-form input.form-control:hover,
.xy-login-active .ew-login-form .ew-form-control:hover {
    border-color: var(--xy-border-strong) !important;
}

.xy-login-active .ew-login-form input.form-control:focus,
.xy-login-active .ew-login-form .ew-form-control:focus {
    border-color: var(--xy-gold) !important;
    background: var(--xy-field) !important;
    box-shadow: 0 0 0 4px var(--xy-gold-ring);
}

/* Password input group */
.xy-login-active .ew-login-form .input-group {
    border-radius: var(--xy-r-md);
}
.xy-login-active .ew-login-form .input-group .form-control,
.xy-login-active .ew-login-form .input-group .ew-form-control {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.xy-login-active .ew-login-form .ew-toggle-password {
    background: var(--xy-field) !important;
    border: 1px solid var(--xy-border) !important;
    border-left: none !important;
    color: var(--xy-ink-mute) !important;
    padding: 0 0.85rem;
    border-top-right-radius: var(--xy-r-md) !important;
    border-bottom-right-radius: var(--xy-r-md) !important;
    box-shadow: var(--xy-shadow-field);
    transition: color var(--xy-t-fast), border-color var(--xy-t-fast), box-shadow var(--xy-t-base), background var(--xy-t-fast);
}
.xy-login-active .ew-login-form .ew-toggle-password:hover { color: var(--xy-gold-deep); }
.xy-login-active .ew-login-form .input-group:focus-within .ew-toggle-password,
.xy-login-active .ew-login-form .input-group:focus-within .form-control,
.xy-login-active .ew-login-form .input-group:focus-within .ew-form-control {
    border-color: var(--xy-gold) !important;
    background: var(--xy-field) !important;
}
.xy-login-active .ew-login-form .input-group:focus-within {
    border-radius: var(--xy-r-md);
    box-shadow: 0 0 0 4px var(--xy-gold-ring);
}
.xy-login-active .ew-login-form .input-group:focus-within .ew-toggle-password,
.xy-login-active .ew-login-form .input-group:focus-within .form-control {
    box-shadow: none;
}


/* ── Validation ───────────────────────────────────────────── */
.xy-login-active .valid-feedback,
.xy-login-active .invalid-feedback {
    display: none;
    font-family: var(--xy-font);
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: var(--xy-sp-2);
}
.xy-login-active .is-invalid ~ .invalid-feedback,
.xy-login-active .is-invalid ~ .input-group ~ .invalid-feedback,
.xy-login-active .was-validated :invalid ~ .invalid-feedback {
    display: block;
    color: var(--xy-danger);
}
.xy-login-active .is-valid ~ .valid-feedback,
.xy-login-active .is-valid ~ .input-group ~ .valid-feedback,
.xy-login-active .was-validated :valid ~ .valid-feedback {
    display: block;
    color: var(--xy-success);
}
.xy-login-active .ew-login-form input.is-invalid,
.xy-login-active .ew-login-form .is-invalid .form-control {
    border-color: var(--xy-danger);
}


/* ── Submit button — sunset gold ──────────────────────────── */
.xy-login-active .ew-login-form .d-grid { margin-top: var(--xy-sp-6); }

.xy-login-active .ew-login-form .btn-primary {
    font-family: var(--xy-font);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: linear-gradient(180deg, var(--xy-gold-bright), var(--xy-gold-deep));
    border: none;
    border-radius: var(--xy-r-md);
    padding: 0.78rem 1.5rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(122, 88, 22, 0.35);
    box-shadow: var(--xy-shadow-btn);
    transition: background var(--xy-t-fast), filter var(--xy-t-fast), box-shadow var(--xy-t-base), transform var(--xy-t-fast);
}
.xy-login-active .ew-login-form .btn-primary:hover:not(:disabled) {
    filter: brightness(1.06);
    box-shadow: 0 8px 24px rgba(179, 130, 47, 0.4);
    transform: translateY(-1px);
}
.xy-login-active .ew-login-form .btn-primary:active:not(:disabled) {
    background: var(--xy-gold-press);
    filter: none;
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(179, 130, 47, 0.34);
}
.xy-login-active .ew-login-form .btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--xy-gold-ring), var(--xy-shadow-btn);
}
.xy-login-active .ew-login-form .btn-primary:disabled,
.xy-login-active .ew-login-form .btn-primary.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}


/* ── Secondary links ──────────────────────────────────────── */
.xy-login-active .social-auth-links { margin-top: var(--xy-sp-5) !important; }
.xy-login-active .social-auth-links p {
    position: relative;
    text-align: center;
    font-size: 0.78rem;
    color: var(--xy-ink-mute);
    margin: var(--xy-sp-2) 0 var(--xy-sp-4);
}
.xy-login-active .social-auth-links p::before,
.xy-login-active .social-auth-links p::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 1.6rem);
    height: 1px;
    background: var(--xy-border);
}
.xy-login-active .social-auth-links p::before { left: 0; }
.xy-login-active .social-auth-links p::after { right: 0; }
.xy-login-active .social-auth-links .btn {
    font-family: var(--xy-font);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--xy-r-md);
    padding: 0.6rem 1rem;
}

.xy-login-active .login-page-links {
    margin-top: var(--xy-sp-5) !important;
    padding-top: var(--xy-sp-5);
    border-top: 1px solid var(--xy-border);
    text-align: center;
}
.xy-login-active .login-page-links .card-link {
    font-family: var(--xy-font);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--xy-ink-soft);
    text-decoration: none;
    transition: color var(--xy-t-fast);
}
.xy-login-active .login-page-links .card-link:hover { color: var(--xy-gold-deep); }

.xy-login-active .ew-login-card .ew-overlay { border-radius: var(--xy-r-md); }


/* ══════════════════════════════════════════════════════════
   ENTRANCE — one orchestrated, staggered reveal
   Triggered by body.xy-ready (added once CSS is applied)
   ══════════════════════════════════════════════════════════ */
.xy-login-active .xy-anim {
    opacity: 0;
    transform: translateY(14px);
}
.xy-login-active.xy-ready .xy-anim {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s var(--xy-ease-out), transform 0.6s var(--xy-ease-out);
    transition-delay: var(--d, 0ms);
}
.xy-login-active .xy-brand { opacity: 0; }
.xy-login-active.xy-ready .xy-brand {
    opacity: 1;
    transition: opacity 0.8s var(--xy-ease);
}
/* The tower rises gently with the panel */
.xy-login-active .xy-scene__svg {
    transform: translateY(18px);
}
.xy-login-active.xy-ready .xy-scene__svg {
    transform: translateY(0);
    transition: transform 1.1s var(--xy-ease-out) 0.15s;
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 920px) {
    body.xy-login-active { overflow-y: auto; }
    .xy-stage {
        position: relative;
        min-height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .xy-brand {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: var(--xy-sp-5) clamp(1.25rem, 5vw, 2.5rem);
        gap: var(--xy-sp-4);
    }
    .xy-brand__hero,
    .xy-brand__features { display: none; }
    .xy-scene__svg {
        /* Keep the tower peeking into the compact dusk band */
        width: auto;
        height: 300%;
        right: -4%;
        opacity: 0.85;
    }
    .xy-brand__foot {
        border-top: none;
        padding-top: 0;
        width: auto;
    }
    .xy-brand__foot .xy-status { display: none; }
    .xy-panel { align-items: flex-start; }
    .xy-login-active .ew-login-box { margin: 0 auto; }
}

@media (max-width: 920px) and (min-width: 561px) {
    .xy-brand__foot { flex-direction: column; align-items: flex-end; }
}

@media (max-width: 560px) {
    .xy-brand { padding: var(--xy-sp-4) var(--xy-sp-4); }
    .xy-brand__foot .xy-status__copy { display: none; }
    .xy-clock__date { white-space: nowrap; }
    .xy-clock__time { font-size: 1rem; }
    .xy-wordmark__name { font-size: 1.15rem; letter-spacing: 0.18em; }
    .xy-emblem { width: 38px; height: 38px; }
    .xy-scene__svg { display: none; }
    .xy-panel { padding: var(--xy-sp-6) var(--xy-sp-4) var(--xy-sp-8); }
    .xy-form__title { font-size: 1.5rem; }
}

@media (max-height: 720px) and (min-width: 921px) {
    .xy-brand__features { margin-top: var(--xy-sp-5); }
    .xy-brand__title { margin-bottom: var(--xy-sp-3); }
    .xy-brand__stat { margin-top: var(--xy-sp-4); }
}


/* ── Selection + reduced motion ───────────────────────────── */
.xy-login-active ::selection {
    background: rgba(201, 151, 63, 0.22);
    color: var(--xy-ink);
}

@media (prefers-reduced-motion: reduce) {
    .xy-brand::before { animation: none; }
    .xy-status__dot { animation: none; }
    .xy-stars { animation: none; }
    .xy-facet-gold { animation: none; }
    .xy-beacon-halo { animation: none; opacity: 0.2; }
    .xy-login-active .xy-anim,
    .xy-login-active.xy-ready .xy-anim {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .xy-login-active .xy-brand,
    .xy-login-active.xy-ready .xy-brand { opacity: 1; transition: none; }
    .xy-login-active .xy-scene__svg,
    .xy-login-active.xy-ready .xy-scene__svg { transform: none; transition: none; }
}