/* ============================================================
   Kiztopia Login — "Sunshine Playland"
   Turnstile & Wristband Management · Kiztopia Malaysia
   Mid Valley Megamall · Kuala Lumpur
   ============================================================

   DESIGN INTENT
   Enterprise split-canvas with the joy of the playground. The left
   brand panel is a bright daylight sky — animated sun, drifting
   clouds, falling confetti — with a five-colour rainbow arcing over
   rolling green hills, a ferris wheel and a floating hot-air
   balloon. A rainbow-lettered KIZTOPIA wordmark anchors the top.
   The right panel is warm cream with soft sunshine/pink glows and
   one coral-to-orange "Let's play" action button with a toy-like
   hard shadow. Joyful but disciplined: the play lives on the left;
   the form stays calm, legible and fast.

   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                        #3fa9f5 fallback
     .xy-stage (fixed, grid)     z 0 — fills viewport
       .xy-brand  (left, sky)    sky gradient + sun/clouds/confetti
                                 + .xy-balloon + .xy-scene SVG
       .xy-panel  (right, cream) holds .ew-login-box / form

   TYPOGRAPHY
   Display: 'Baloo 2' · Body: 'Nunito' — both SELF-HOSTED variable
   woff2 files in /font (latin subset, ~72 KB total), so offline
   kiosks and LAN terminals render identically with zero external
   requests. 'Trebuchet MS' / Segoe UI remain as fallbacks.

   PERFORMANCE / A11Y
   • Entrance: transform + opacity only (GPU composited)
   • Scene: one inline SVG + a handful of CSS-shape layers,
     zero image requests
   • Sun rays / cloud drift / confetti / balloon: transform+opacity
   • prefers-reduced-motion fully honored
   ============================================================ */


/* ── Self-hosted webfonts (variable, latin subset) ─────────── */
@font-face {
    font-family: 'Baloo 2';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../font/baloo2-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url('../font/nunito-latin.woff2') format('woff2');
}


/* ── Design tokens ─────────────────────────────────────────── */
:root {
    /* Daylight sky (brand panel) */
    --xy-sky-1: #3fa9f5;
    --xy-sky-2: #5cbdff;
    --xy-sky-3: #a5e3ff;
    --xy-sky-4: #d8f4ff;

    /* Brand panel ink (on sky) */
    --xy-brand-ink: #ffffff;
    --xy-brand-ink-soft: #eef9ff;
    --xy-brand-shadow: rgba(30, 90, 160, 0.28);
    --xy-brand-line: rgba(255, 255, 255, 0.45);
    /* Veil behind text that overlaps the illustration. The 0.70 alpha is not a
       taste call: measured against the brightest points of the rainbow and the
       white clouds, anything lighter drops the small 0.68rem text below the
       4.5:1 AA threshold. Verified worst-pixel ratios 5.5:1–6.1:1. */
    --xy-brand-veil: rgba(6, 56, 105, 0.70);
    --xy-brand-veil-line: rgba(255, 255, 255, 0.28);

    /* Kiztopia spectrum */
    --xy-coral: #ff5a5f;
    --xy-coral-deep: #d63f44;
    --xy-orange: #ff8c42;
    --xy-amber: #ffb400;
    --xy-sunshine: #ffd23e;
    --xy-green: #37c86f;
    --xy-teal: #26c6da;
    --xy-purple: #7a5cff;
    --xy-pink: #ff7bac;

    /* Cream (action panel) */
    --xy-surface: #fffdf7;
    --xy-field: #ffffff;
    --xy-ink: #26324b;
    --xy-ink-soft: #4a566e;
    --xy-ink-mute: #7c8698;
    --xy-border: #e8e2d2;
    --xy-border-strong: #d8d0bc;
    --xy-focus: #3fa9f5;
    --xy-focus-ring: rgba(63, 169, 245, 0.18);

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

    --xy-display: 'Baloo 2', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
    --xy-font: 'Nunito', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-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: 9px; --xy-r-md: 14px; --xy-r-lg: 20px;

    --xy-shadow-field: 0 2px 0 #efe9da;
    --xy-shadow-btn: 0 6px 0 var(--xy-coral-deep), 0 14px 26px rgba(255, 90, 95, 0.35);

    --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-sky-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.06fr) minmax(0, 0.94fr);
    background: var(--xy-surface);
    overflow: hidden;
}


/* ══════════════════════════════════════════════════════════
   BRAND PANEL (left) — daylight playland
   ══════════════════════════════════════════════════════════ */
.xy-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 1rem + 3vw, 3.5rem);
    color: var(--xy-brand-ink);
    background: linear-gradient(
        178deg,
        var(--xy-sky-1) 0%,
        var(--xy-sky-2) 42%,
        var(--xy-sky-3) 78%,
        var(--xy-sky-4) 100%
    );
    isolation: isolate;
}

/* — Sun: glowing core + slowly turning conic rays — */
.xy-sun {
    position: absolute;
    top: 7%;
    right: 11%;
    width: 120px;
    height: 120px;
    z-index: -1;
    pointer-events: none;
}
.xy-sun::before {
    content: '';
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 34%, #fff3b8, var(--xy-sunshine) 62%, var(--xy-amber));
    box-shadow: 0 0 60px 22px rgba(255, 210, 62, 0.55);
}
.xy-sun::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(255, 220, 90, 0.9) 0 6deg, transparent 6deg 30deg);
    -webkit-mask: radial-gradient(circle, transparent 46%, #000 47% 58%, transparent 59%);
            mask: radial-gradient(circle, transparent 46%, #000 47% 58%, transparent 59%);
    animation: xySunSpin 40s linear infinite;
}
@keyframes xySunSpin { to { transform: rotate(360deg); } }

/* — Clouds: pill + two puffs, drifting — */
.xy-cloud {
    position: absolute;
    z-index: -1;
    background: #fff;
    border-radius: 99px;
    opacity: 0.92;
    box-shadow: 0 8px 24px rgba(63, 132, 205, 0.18);
    pointer-events: none;
}
.xy-cloud::before,
.xy-cloud::after {
    content: '';
    position: absolute;
    background: #fff;
    border-radius: 50%;
}
.xy-cloud--1 {
    width: 130px; height: 38px;
    top: 13%; left: 56%;
    animation: xyDrift 46s linear infinite;
}
.xy-cloud--1::before { width: 52px; height: 52px; top: -24px; left: 22px; }
.xy-cloud--1::after  { width: 38px; height: 38px; top: -16px; left: 64px; }
.xy-cloud--2 {
    width: 90px; height: 28px;
    top: 32%; right: 26%;
    opacity: 0.75;
    animation: xyDrift 60s linear infinite reverse;
}
.xy-cloud--2::before { width: 36px; height: 36px; top: -17px; left: 16px; }
.xy-cloud--2::after  { width: 26px; height: 26px; top: -11px; left: 46px; }
@keyframes xyDrift {
    from { transform: translateX(-30px); }
    50%  { transform: translateX(40px); }
    to   { transform: translateX(-30px); }
}

/* — Confetti: six tumbling flecks of the spectrum — */
.xy-confetti { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.xy-confetti i {
    position: absolute;
    top: 0;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    opacity: 0.85;
    animation: xyFall 9s linear infinite;
}
@keyframes xyFall {
    from { transform: translateY(-8vh) rotate(0); }
    to   { transform: translateY(108vh) rotate(340deg); }
}
.xy-confetti i:nth-child(1) { left: 6%;  background: var(--xy-coral); }
.xy-confetti i:nth-child(2) { left: 22%; background: var(--xy-amber);  animation-delay: 2.2s; border-radius: 50%; }
.xy-confetti i:nth-child(3) { left: 38%; background: var(--xy-green);  animation-delay: 4.6s; }
.xy-confetti i:nth-child(4) { left: 55%; background: var(--xy-pink);   animation-delay: 1.4s; border-radius: 50%; }
.xy-confetti i:nth-child(5) { left: 72%; background: var(--xy-purple); animation-delay: 3.4s; }
.xy-confetti i:nth-child(6) { left: 88%; background: var(--xy-teal);   animation-delay: 5.8s; border-radius: 50%; }

/* — Hot-air balloon, floating above the scene — */
.xy-balloon {
    position: absolute;
    bottom: 44%;
    right: 9%;
    width: 64px;
    z-index: -1;
    pointer-events: none;
    animation: xyFloat 7s ease-in-out infinite;
}
.xy-balloon svg { width: 100%; height: auto; display: block; }
@keyframes xyFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-16px); }
}

/* — Playland scene (rainbow + ferris wheel + hills SVG) — */
.xy-scene {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 46%;
    z-index: -1;
    pointer-events: none;
}
.xy-scene__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* — Identity lockup (brand logo tile + tagline) — */
.xy-brand__top { position: relative; z-index: 1; }

.xy-brand__lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}

/* The red Kiztopia wordmark ships as a transparent PNG, so it sits
   on a white tile for contrast against the sky. */
.xy-logo {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    padding: 10px 16px;
    box-shadow: 0 8px 20px rgba(30, 90, 160, 0.25);
}
.xy-logo img {
    height: 34px;
    width: auto;
    display: block;
}

.xy-wordmark__sub {
    padding-left: 2px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.42em;
    color: var(--xy-brand-ink-soft);
    text-shadow: 0 1px 3px var(--xy-brand-shadow);
}

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

.xy-brand__eyebrow {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 6px 14px;
    border-radius: 99px;
    margin-bottom: var(--xy-sp-4);
}

.xy-brand__title {
    font-family: var(--xy-display);
    font-size: clamp(1.9rem, 1.1rem + 2.2vw, 2.7rem);
    font-weight: 800;
    line-height: 1.08;
    color: var(--xy-brand-ink);
    text-shadow: 0 3px 0 rgba(30, 90, 160, 0.16);
    margin: 0 0 var(--xy-sp-3);
}
.xy-brand__title-accent {
    font-style: normal;
    color: var(--xy-sunshine);
}
.xy-brand__lede {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.55;
    color: var(--xy-brand-ink-soft);
    text-shadow: 0 1px 3px var(--xy-brand-shadow);
    margin: 0;
    max-width: 38ch;
}

/* — Trust signals — */
.xy-brand__features {
    list-style: none;
    margin: var(--xy-sp-6) 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.xy-feature {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--xy-brand-ink);
    text-shadow: 0 1px 3px var(--xy-brand-shadow);
}
.xy-feature__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 12px rgba(30, 90, 160, 0.2);
}
.xy-feature__icon svg { width: 17px; height: 17px; }

/* Each trust signal takes one hue of the rainbow */
.xy-feature:nth-child(1) .xy-feature__icon { color: var(--xy-coral); }
.xy-feature:nth-child(2) .xy-feature__icon { color: #f59f00; }
.xy-feature:nth-child(3) .xy-feature__icon { color: var(--xy-success); }

/* — Zones stat line — */
/* Sits over the rainbow, where white-on-artwork measured ~1.9:1. The tinted
   pill below lifts it past WCAG AA without dimming the illustration — see the
   note on .xy-brand__foot for why the tint is this strong. */
.xy-brand__stat {
    display: inline-block;
    margin-top: var(--xy-sp-5);
    padding: 6px 14px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--xy-brand-ink-soft);
    text-shadow: 0 1px 3px var(--xy-brand-shadow);
    background: var(--xy-brand-veil);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--xy-brand-veil-line);
    border-radius: 999px;
}

/* — Footer status row — */
/* This row lands on the lightest part of the artwork (rainbow, ferris wheel,
   clouds), where plain white text measured 1.4:1–2.3:1 — invisible in places.
   A tinted glass bar fixes every child at once and keeps the illustration's
   colour, which a full-panel scrim would flatten. Blur matters as well as tint:
   it averages out the rainbow's bands so the WORST pixel behind a glyph, not
   just the average, clears AA. */
.xy-brand__foot {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap; /* clock drops below the credit on narrow panels */
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--xy-sp-2) var(--xy-sp-4);
    padding: 14px 18px;
    background: var(--xy-brand-veil);
    -webkit-backdrop-filter: blur(10px) saturate(115%);
    backdrop-filter: blur(10px) saturate(115%);
    border: 1px solid var(--xy-brand-veil-line);
    border-radius: 16px;
}
/* Without backdrop-filter the rainbow is not blurred behind the glass, so the
   brightest bands reach the glyphs undiluted — raise the tint to compensate. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .xy-brand__foot,
    .xy-brand__stat { background: rgba(6, 56, 105, 0.80); }
}

.xy-brand__foot-left { min-width: 0; }
.xy-clock { margin-left: auto; }
.xy-status {
    display: flex;
    align-items: center;
    gap: var(--xy-sp-2);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--xy-brand-ink);
    text-shadow: 0 1px 3px var(--xy-brand-shadow);
}
.xy-status__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2eea8f;
    box-shadow: 0 0 0 0 rgba(46, 234, 143, 0.5);
    animation: xyPulse 2.4s var(--xy-ease) infinite;
}
@keyframes xyPulse {
    0%   { box-shadow: 0 0 0 0 rgba(46, 234, 143, 0.45); }
    70%  { box-shadow: 0 0 0 7px rgba(46, 234, 143, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 234, 143, 0); }
}

/* — Developer credit: © year Xyreon Technology + icon links — */
.xy-cred {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: var(--xy-sp-2);
}
.xy-cred__text {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--xy-brand-ink-soft);
    text-shadow: 0 1px 3px var(--xy-brand-shadow);
    white-space: nowrap;
}
.xy-social {
    display: flex;
    gap: 7px;
}
/* The SVGs are fill="currentColor", so these are whatever `color` resolves to.
   !important is deliberate: the Notion theme sets every non-button anchor to the
   accent blue via
     [data-bs-theme=light] a:not(.btn):not(.nav-link):not(.dropdown-item)
                             :not(.page-link):not(.brand-link):not(.ew-row-link)
   which scores (0,7,1) because each :not() counts as a class. Out-specifying
   that from here needs an eight-class selector, which is far less readable than
   this. The icons must stay white — they sit on the tinted bar over artwork. */
.xy-social__link {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff !important;
    transition: color var(--xy-t-fast), border-color var(--xy-t-fast), background var(--xy-t-fast), transform var(--xy-t-fast);
}
.xy-social__link svg { width: 13px; height: 13px; display: block; }
.xy-social__link:hover {
    background: #fff;
    border-color: #fff;
    color: var(--xy-sky-1) !important;   /* same theme rule as above */
    transform: translateY(-2px);
}
.xy-social__link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.xy-clock {
    text-align: right;
    line-height: 1.2;
}
.xy-clock__time {
    font-size: 1.1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: var(--xy-brand-ink);
    text-shadow: 0 1px 4px var(--xy-brand-shadow);
}
.xy-clock__date {
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--xy-brand-ink-soft);
    text-shadow: 0 1px 3px var(--xy-brand-shadow);
    margin-top: 2px;
}


/* ══════════════════════════════════════════════════════════
   ACTION PANEL (right, warm cream)
   ══════════════════════════════════════════════════════════ */
.xy-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 0.5rem + 4vw, 4rem);
    /* Soft sunshine + pink glows spill onto the cream. Painted as
       backgrounds (not positioned pseudo-elements) so they can never
       create scrollable overflow inside this scroll container. */
    background:
        radial-gradient(340px 340px at calc(100% + 60px) -60px, #ffe9b8, transparent 68%),
        radial-gradient(300px 300px at -60px calc(100% + 60px), #ffd9e4, transparent 68%),
        var(--xy-surface);
    overflow-y: auto;
    overflow-x: hidden;
}

/* 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.68rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #f59f00;
    margin-bottom: var(--xy-sp-2);
}
.xy-form__title {
    font-family: var(--xy-display);
    font-size: 1.9rem;
    font-weight: 800;
    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.9rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--xy-ink-mute);
    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.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--xy-ink-soft);
    margin-bottom: 7px;
}

.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.93rem;
    font-weight: 600;
    color: var(--xy-ink) !important;
    background: var(--xy-field) !important;
    border: 2px solid var(--xy-border) !important;
    border-radius: var(--xy-r-md);
    padding: 0.74rem 0.95rem;
    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: 500;
}

/* 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-focus) !important;
    background: var(--xy-field) !important;
    box-shadow: 0 0 0 4px var(--xy-focus-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: 2px 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-coral); }
.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-focus) !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-focus-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: 600;
    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) !important;
}


/* ── Submit button — the toy-block coral gradient ─────────── */
.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-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: linear-gradient(94deg, var(--xy-coral), var(--xy-orange));
    border: none;
    border-radius: var(--xy-r-md);
    padding: 0.82rem 1.5rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(150, 40, 40, 0.3);
    box-shadow: var(--xy-shadow-btn);
    transition: box-shadow var(--xy-t-fast), transform var(--xy-t-fast), filter var(--xy-t-fast);
}
.xy-login-active .ew-login-form .btn-primary:hover:not(:disabled) {
    filter: brightness(1.04);
    transform: translateY(-2px);
    box-shadow: 0 8px 0 var(--xy-coral-deep), 0 18px 30px rgba(255, 90, 95, 0.4);
}
.xy-login-active .ew-login-form .btn-primary:active:not(:disabled) {
    filter: none;
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--xy-coral-deep), 0 6px 14px rgba(255, 90, 95, 0.3);
}
.xy-login-active .ew-login-form .btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--xy-focus-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;
    font-weight: 600;
    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: 600;
    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 dashed var(--xy-border);
    text-align: center;
}
.xy-login-active .login-page-links .card-link {
    font-family: var(--xy-font);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--xy-ink-mute);
    text-decoration: none;
    transition: color var(--xy-t-fast);
}
.xy-login-active .login-page-links .card-link:hover { color: var(--xy-coral); }

.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 playland 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 { display: none; }
    /* Keep the rainbow peeking into the compact sky band */
    .xy-scene { height: 100%; }
    .xy-scene__svg { opacity: 0.5; }
    .xy-sun { top: -20px; right: 30%; width: 90px; height: 90px; }
    .xy-cloud, .xy-confetti, .xy-balloon { display: none; }
    .xy-brand__foot {
        /* The old dashed divider was cancelled here; the bar replaces it, so it
           keeps its padding and full border and only changes direction. */
        width: auto;
        flex-direction: column;
        align-items: flex-end;
        gap: var(--xy-sp-2);
    }
    .xy-brand__foot .xy-status { display: none; }
    .xy-brand__foot-left { order: 2; }
    .xy-cred { margin-top: 0; }
    .xy-panel { align-items: flex-start; }
    .xy-login-active .ew-login-box { margin: 0 auto; }
}

@media (max-width: 560px) {
    .xy-brand { padding: var(--xy-sp-4) var(--xy-sp-4); }
    .xy-cred__text { display: none; }
    .xy-clock__date { white-space: nowrap; }
    .xy-clock__time { font-size: 1rem; }
    .xy-wordmark__sub { letter-spacing: 0.3em; }
    .xy-logo { padding: 7px 12px; border-radius: 11px; }
    .xy-logo img { height: 24px; }
    .xy-scene__svg, .xy-sun { 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); }
    .xy-scene { height: 38%; }
}


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

@media (prefers-reduced-motion: reduce) {
    .xy-sun::after { animation: none; }
    .xy-cloud--1, .xy-cloud--2 { animation: none; }
    .xy-confetti i { animation: none; opacity: 0; }
    .xy-balloon { animation: none; }
    .xy-status__dot { animation: none; }
    .xy-social__link:hover { transform: none; }
    .xy-login-active .ew-login-form .btn-primary:hover:not(:disabled),
    .xy-login-active .ew-login-form .btn-primary:active:not(:disabled) { transform: none; }
    .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; }
}