:root {
    --auth-ink: #06142c;
    --auth-blue: #0866d9;
    --auth-cyan: #25c7d9;
}

.auth-shell-body {
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--auth-ink);
}

.auth-shell,
.auth-shell__inner,
.auth-stage {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
}

.auth-shell {
    width: 100%;
    max-width: none;
    padding: 0;
}

.auth-shell__inner {
    width: 100%;
    max-width: none;
    padding: 0;
}

.auth-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(400px, .82fr);
    align-items: center;
    width: 100%;
    max-width: none;
    padding: 0 clamp(1.25rem, 5.5vw, 5.75rem);
    isolation: isolate;
    min-height: 100svh;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: var(--auth-ink);
    box-shadow: none;
    --auth-pointer-x: 50%;
    --auth-pointer-y: 50%;
    --auth-parallax-x: 0;
    --auth-parallax-y: 0;
    --auth-pointer-glow-opacity: 0;
}

.auth-stage__background {
    position: absolute;
    z-index: -2;
    inset: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 22%, rgb(37 199 217 / 18%), transparent 30%),
        radial-gradient(circle at 76% 78%, rgb(8 102 217 / 24%), transparent 34%),
        linear-gradient(135deg, #041127 0%, #0a2850 48%, #071a35 100%);
    pointer-events: none;
}

.auth-stage__background > * { pointer-events: none; }

.auth-interactive-canvas,
.auth-pointer-glow,
.auth-interaction-ripples {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.auth-interactive-canvas {
    z-index: 1;
    opacity: .78;
}

.auth-pointer-glow {
    z-index: 2;
    inset: auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    opacity: var(--auth-pointer-glow-opacity);
    transform: translate3d(calc(var(--auth-pointer-x) - 50%), calc(var(--auth-pointer-y) - 50%), 0);
    background: radial-gradient(circle, rgb(49 207 255 / 20%), rgb(31 131 255 / 8%) 35%, transparent 70%);
    filter: blur(18px);
    transition: opacity 280ms ease;
    will-change: transform, opacity;
}

.auth-interaction-ripples { z-index: 3; overflow: hidden; }

.auth-interaction-ripple {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 1px solid rgb(126 226 255 / 45%);
    border-radius: 50%;
    opacity: .72;
    transform: translate(-50%, -50%) scale(.2);
    animation: auth-ripple 680ms cubic-bezier(.14,.72,.25,1) forwards;
}

.auth-stage__sky {
    inset: 0;
    background:
        linear-gradient(110deg, transparent 20%, rgb(255 255 255 / 5%) 42%, transparent 58%),
        radial-gradient(ellipse at 50% 110%, rgb(28 169 218 / 20%), transparent 55%);
    background-size: 220% 100%, 100% 100%;
    animation: auth-sky-drift 16s ease-in-out infinite alternate;
}

.auth-stage__building {
    inset: auto -8% -16% -8%;
    width: auto;
    height: 68%;
    opacity: .34;
    background:
        linear-gradient(90deg, transparent 0 8%, rgb(4 17 39 / 80%) 8% 14%, transparent 14% 20%, rgb(4 17 39 / 88%) 20% 32%, transparent 32% 38%, rgb(4 17 39 / 72%) 38% 47%, transparent 47% 56%, rgb(4 17 39 / 90%) 56% 70%, transparent 70% 77%, rgb(4 17 39 / 76%) 77% 88%, transparent 88%),
        linear-gradient(180deg, transparent, rgb(3 13 30 / 85%));
    clip-path: polygon(0 28%, 8% 28%, 8% 18%, 14% 18%, 14% 35%, 20% 35%, 20% 7%, 32% 7%, 32% 42%, 38% 42%, 38% 22%, 47% 22%, 47% 36%, 56% 36%, 56% 0, 70% 0, 70% 27%, 77% 27%, 77% 13%, 88% 13%, 88% 34%, 100% 34%, 100% 100%, 0 100%);
    transform-origin: bottom;
    animation: auth-city-breathe 9s ease-in-out infinite alternate;
}

.auth-stage__building::before,
.auth-stage__building::after { display: none; }

.auth-stage__glow {
    top: auto;
    right: auto;
    bottom: -34%;
    left: -12%;
    width: 78vw;
    height: 78vw;
    opacity: .42;
    filter: blur(4px);
    background: radial-gradient(circle, rgb(37 199 217 / 40%), transparent 62%);
    animation: auth-glow-pulse 8s ease-in-out infinite alternate;
}

.auth-stage__gridlines {
    inset: 48% -20% -30%;
    opacity: .16;
    background-image:
        linear-gradient(rgb(117 210 255 / 42%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(117 210 255 / 42%) 1px, transparent 1px);
    background-size: 58px 40px;
    transform: perspective(420px) rotateX(58deg) scale(1.3);
    transform-origin: center top;
    animation: auth-grid-travel 10s linear infinite;
}

.auth-motion {
    position: absolute;
    border-radius: 999px;
    filter: blur(58px);
    will-change: transform;
}

.auth-motion--one {
    top: -18%;
    left: 18%;
    width: 42vw;
    height: 42vw;
    background: rgb(20 154 222 / 22%);
    animation: auth-orbit-one 18s ease-in-out infinite alternate;
    translate: calc(var(--auth-parallax-x) * 10px) calc(var(--auth-parallax-y) * 8px);
}

.auth-motion--two {
    right: -12%;
    bottom: -28%;
    width: 54vw;
    height: 54vw;
    background: rgb(30 104 235 / 26%);
    animation: auth-orbit-two 22s ease-in-out infinite alternate;
    translate: calc(var(--auth-parallax-x) * -7px) calc(var(--auth-parallax-y) * -5px);
}

.auth-flow-lines {
    position: absolute;
    inset: 0;
    opacity: .24;
    background: linear-gradient(118deg, transparent 0 24%, rgb(107 222 255 / 36%) 24.2% 24.35%, transparent 24.6% 52%, rgb(107 222 255 / 22%) 52.2% 52.35%, transparent 52.7%);
    background-size: 180% 100%;
    animation: auth-flow 13s linear infinite;
}

.auth-stars {
    position: absolute;
    inset: 0;
    opacity: .36;
    background-image:
        radial-gradient(circle at 12% 18%, #fff 0 1px, transparent 1.5px),
        radial-gradient(circle at 38% 12%, #8eeaff 0 1px, transparent 1.5px),
        radial-gradient(circle at 67% 28%, #fff 0 1px, transparent 1.5px),
        radial-gradient(circle at 84% 14%, #8eeaff 0 1px, transparent 1.5px),
        radial-gradient(circle at 72% 62%, #fff 0 1px, transparent 1.5px);
    animation: auth-stars-shimmer 6s ease-in-out infinite alternate;
    translate: calc(var(--auth-parallax-x) * 3px) calc(var(--auth-parallax-y) * 2px);
}

.auth-stage__gridlines { translate: calc(var(--auth-parallax-x) * 4px) calc(var(--auth-parallax-y) * 3px); }
.auth-stage__building { translate: calc(var(--auth-parallax-x) * 2px) calc(var(--auth-parallax-y) * 2px); }

.auth-stage[data-auth-interactive-background].auth-interactive-ready .auth-stage__panel::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    content: "";
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(280px circle at var(--auth-pointer-x) var(--auth-pointer-y), rgb(79 210 255 / 13%), transparent 70%);
    opacity: .7;
}

.auth-stage__panel > * { position: relative; z-index: 1; }

.auth-stage__brand {
    top: clamp(1.25rem, 4vw, 3.5rem);
    left: clamp(1.25rem, 5vw, 5rem);
    animation: auth-enter-left 650ms cubic-bezier(.2,.8,.2,1) both;
}

.auth-stage__brand-mark {
    width: 42px;
    height: 42px;
    padding: 7px;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 13px;
    background: rgb(255 255 255 / 10%);
    box-shadow: inset 0 1px rgb(255 255 255 / 16%);
    backdrop-filter: blur(12px);
}

.auth-stage__brand-name {
    color: #fff;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    letter-spacing: -.025em;
}

.auth-stage__brand-subtitle { color: rgb(218 239 255 / 68%); }

.auth-environment-badge {
    position: absolute;
    top: clamp(1.4rem, 4vw, 3.7rem);
    right: clamp(1rem, 5vw, 5rem);
    z-index: 2;
    margin: 0;
    padding: .45rem .7rem;
    border: 1px solid rgb(151 225 255 / 24%);
    border-radius: 999px;
    color: #d9f4ff;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgb(5 27 57 / 54%);
    backdrop-filter: blur(12px);
}

.auth-stage__panel {
    grid-column: 2;
    justify-self: center;
    width: min(448px, calc(100vw - 2rem));
    margin-right: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    animation: auth-enter-panel 720ms 90ms cubic-bezier(.2,.8,.2,1) both;
}

.auth-stage__panel-inner {
    /* Keep a single login surface: no inherited card width or outer padding. */
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.auth-card--login {
    max-width: none;
    padding: clamp(1.8rem, 4vw, 2.5rem);
    border: 1px solid rgb(255 255 255 / 64%);
    border-radius: 28px;
    background: rgb(248 252 255 / 96%);
    box-shadow: 0 26px 72px rgb(0 8 28 / 38%), inset 0 1px rgb(255 255 255 / 92%);
    backdrop-filter: blur(24px) saturate(130%);
}

.auth-card__header { text-align: left; }

.auth-card__eyebrow {
    color: var(--auth-blue);
    letter-spacing: .14em;
}

.auth-card__title {
    margin-top: .5rem;
    color: #071a35;
    font-size: clamp(1.95rem, 4vw, 2.6rem);
    letter-spacing: -.045em;
}

.auth-card__text {
    max-width: 28ch;
    margin-top: .65rem;
    margin-right: 0;
    margin-left: 0;
    color: #5c6b7f;
}

.auth-form {
    gap: 1.15rem;
    margin-top: 1.9rem;
}

.auth-card .ui-label {
    color: #253651;
    font-weight: 750;
}

.auth-card .ui-control {
    min-height: 52px;
    border: 1px solid #cfdae8;
    border-radius: 12px;
    color: #071a35;
    background: rgb(255 255 255 / 76%);
    transition: border-color 180ms, box-shadow 180ms, background-color 180ms;
}

.auth-password-control { position: relative; }

.auth-password-control .ui-control { padding-right: 8.7rem; }

.auth-password-toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0 .65rem;
    border: 0;
    border-radius: 9px;
    color: #315271;
    font-size: .72rem;
    font-weight: 800;
    background: transparent;
    cursor: pointer;
}

.auth-password-toggle:hover { background: #e9f2fb; }

.auth-password-toggle:focus-visible,
.auth-help-trigger:focus-visible,
.auth-help-dialog__close:focus-visible {
    outline: 3px solid rgb(8 102 217 / 25%);
    outline-offset: 2px;
}

.auth-password-toggle__icon {
    width: 14px;
    height: 10px;
    border: 1.7px solid currentColor;
    border-radius: 50%;
}

.auth-password-toggle__icon::after {
    display: block;
    width: 4px;
    height: 4px;
    margin: 1.3px auto 0;
    content: "";
    border-radius: 50%;
    background: currentColor;
}

.auth-field-error,
.auth-caps-lock {
    min-height: 1rem;
    margin: .28rem 0 0;
    color: #a62b22;
    font-size: .76rem;
    font-weight: 650;
}

.auth-caps-lock { color: #8a4b00; }

.auth-submit-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgb(255 255 255 / 48%);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .65s linear infinite;
}

.auth-form[aria-busy="true"] .auth-submit-spinner { display: inline-block; }

.auth-help-trigger {
    display: block;
    margin: 1rem auto .45rem;
    padding: .5rem;
    border: 0;
    color: #285b8e;
    font-size: .78rem;
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 3px;
    background: transparent;
    cursor: pointer;
}

.auth-help-dialog {
    width: min(420px, calc(100vw - 2rem));
    padding: 0;
    border: 1px solid #d4e0ec;
    border-radius: 18px;
    color: #071a35;
    background: #f8fbff;
    box-shadow: 0 26px 80px rgb(0 12 38 / 35%);
}

.auth-help-dialog::backdrop { background: rgb(1 12 30 / 62%); backdrop-filter: blur(4px); }
.auth-help-dialog__content { position: relative; padding: 2rem; }
.auth-help-dialog__content h2 { margin: .5rem 0 .8rem; font-size: 1.45rem; }
.auth-help-dialog__content p { margin: .65rem 0; color: #53657a; line-height: 1.55; }
.auth-help-dialog__content .ui-btn { margin-top: .8rem; }
.auth-help-dialog__close { position: absolute; top: .7rem; right: .7rem; min-width: 44px; min-height: 44px; border: 0; color: #496077; background: transparent; cursor: pointer; }

.auth-card .ui-control:focus {
    border-color: var(--auth-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgb(8 102 217 / 13%);
}

.auth-card--login .ui-btn--primary {
    min-height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0866d9, #0755b8);
    box-shadow: 0 12px 24px rgb(8 102 217 / 22%);
    transition: transform 180ms, box-shadow 180ms, filter 180ms;
}

.auth-card--login .ui-btn--primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 16px 30px rgb(8 102 217 / 28%);
}

.auth-stage__caption {
    display: none;
}

.auth-card__support-text { color: #3f5065; }

@media (max-width: 820px) {
    .auth-stage {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: center;
        padding: 6.5rem 1rem 1.5rem;
    }

    .auth-stage__panel {
        grid-column: 1;
        width: min(430px, 100%);
        margin: 0 auto;
    }

    .auth-stage__brand {
        top: 1.25rem;
        left: 1.25rem;
    }

    .auth-environment-badge {
        top: 5.1rem;
        right: 1rem;
        font-size: .62rem;
    }

    .auth-stage__building { height: 50%; }
}

@media (max-width: 390px), (max-height: 640px) {
    .auth-stage { align-items: start; padding-top: 5.5rem; }
    .auth-stage__panel-inner { padding: 0; }
    .auth-card__title { font-size: 1.75rem; }
    .auth-card__text { margin-top: .3rem; }
    .auth-form { gap: .65rem; margin-top: 1rem; }
    .auth-card .ui-control { min-height: 48px; }
    .auth-card--login .ui-btn--primary { min-height: 48px; }
    .auth-stage__caption { padding-bottom: 1rem; }
    .auth-environment-badge { display: none; }
}

@media (orientation: landscape) and (max-height: 560px) {
    .auth-stage { display: flex; align-items: flex-start; justify-content: flex-end; min-height: 100dvh; padding: .75rem 1.25rem; }
    .auth-stage__brand { top: 1rem; left: 1rem; }
    .auth-stage__brand-subtitle { display: none; }
    .auth-stage__panel { width: min(430px, 58vw); }
    .auth-stage__panel-inner { padding: 0; }
    .auth-card__title { font-size: 1.65rem; }
    .auth-card__text, .auth-card__support-text, .auth-help-trigger, .auth-stage__caption { display: none; }
    .auth-form { gap: .45rem; margin-top: .75rem; }
    .auth-card .ui-control, .auth-card--login .ui-btn--primary { min-height: 44px; }
}

@media (max-height: 650px) and (min-width: 821px) {
    .auth-stage__panel-inner { padding: 0; }
    .auth-form { margin-top: 1.1rem; }
    .auth-stage__caption { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-stage *,
    .auth-stage *::before,
    .auth-stage *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.auth-reduced-effects .auth-motion,
.auth-reduced-effects .auth-flow-lines,
.auth-reduced-effects .auth-stars,
.auth-reduced-effects .auth-interactive-canvas,
.auth-reduced-effects .auth-pointer-glow,
.auth-reduced-effects .auth-interaction-ripples { display: none; }

@media (prefers-reduced-motion: reduce) {
    .auth-interactive-canvas,
    .auth-pointer-glow,
    .auth-interaction-ripples { display: none; }
}

.auth-reduced-effects .auth-stage__sky,
.auth-reduced-effects .auth-stage__building,
.auth-reduced-effects .auth-stage__glow,
.auth-reduced-effects .auth-stage__gridlines { animation: none; }

@supports not (backdrop-filter: blur(1px)) {
    .auth-stage__panel { background: #edf4fb; }
    .auth-environment-badge { background: #0a2850; }
}

@keyframes auth-sky-drift { to { background-position: -120% 0, 0 0; } }
@keyframes auth-city-breathe { to { transform: scaleY(1.025); opacity: .42; } }
@keyframes auth-glow-pulse { to { transform: translate(10%, -5%) scale(1.12); opacity: .58; } }
@keyframes auth-grid-travel { to { background-position: 0 40px, 58px 0; } }
@keyframes auth-orbit-one { to { transform: translate(28vw, 18vh) scale(1.18); } }
@keyframes auth-orbit-two { to { transform: translate(-24vw, -16vh) scale(.88); } }
@keyframes auth-flow { to { background-position: -180% 0; } }
@keyframes auth-stars-shimmer { to { opacity: .68; transform: translateY(5px); } }
@keyframes auth-enter-left { from { opacity: 0; transform: translateX(-18px); } }
@keyframes auth-enter-panel { from { opacity: 0; transform: translateY(22px) scale(.985); } }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-ripple { to { opacity: 0; transform: translate(-50%, -50%) scale(8); } }
