:root {
    --auth-bg: #0d1114;
    --auth-bg-deep: #080b0d;
    --auth-surface: #141a1e;
    --auth-surface-hover: #1a2126;
    --auth-text: #f2ecdf;
    --auth-text-strong: #fffaf0;
    --auth-muted: #aaa69f;
    --auth-subtle: #979b9d;
    --auth-border: #3b444a;
    --auth-border-strong: #657077;
    --auth-cobalt: #155cff;
    --auth-cobalt-hover: #3472ff;
    --auth-cobalt-dark: #0c3fb8;
    --auth-gold: #efbf56;
    --auth-limestone: #ddd3c2;
    --auth-error: #ff8d82;
    --auth-error-surface: rgba(151, 41, 35, 0.18);
    --auth-success: #8bd6a5;
    --auth-success-surface: rgba(42, 119, 72, 0.18);
    --auth-warning: #efc878;
    --auth-warning-surface: rgba(133, 91, 24, 0.18);
    --auth-focus-ring: 0 0 0 3px rgba(21, 92, 255, 0.3);
    --auth-shadow-lg: 0 36px 90px rgba(0, 0, 0, 0.38);
    --auth-font-display: Bahnschrift, "Aptos Display", "Segoe UI Variable Display", "Segoe UI", sans-serif;
    --auth-font-body: Aptos, "Segoe UI Variable Text", "Segoe UI", sans-serif;
    --auth-space-1: 4px;
    --auth-space-2: 8px;
    --auth-space-3: 12px;
    --auth-space-4: 16px;
    --auth-space-5: 20px;
    --auth-space-6: 24px;
    --auth-space-7: 32px;
    --auth-space-8: 40px;
    --auth-space-9: 48px;
    --auth-radius-sm: 6px;
    --auth-radius-md: 10px;
    --auth-control-height: 56px;
    --auth-content-width: 590px;
    --auth-duration-fast: 150ms;
    --auth-duration: 320ms;
    --auth-duration-slow: 700ms;
    --auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--auth-bg);
    color-scheme: dark;
    font-size: 16px;
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: var(--auth-font-body);
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

a {
    color: #79a3ff;
    text-decoration-color: rgba(121, 163, 255, 0.52);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: color var(--auth-duration-fast) ease, text-decoration-color var(--auth-duration-fast) ease;
}

a:hover {
    color: #a7c1ff;
    text-decoration-color: currentColor;
}

::selection {
    background: var(--auth-cobalt);
    color: #fff;
}

.auth-skip-link {
    position: fixed;
    z-index: 100;
    top: var(--auth-space-4);
    left: var(--auth-space-4);
    padding: 10px 14px;
    border-radius: var(--auth-radius-sm);
    background: var(--auth-text-strong);
    color: var(--auth-bg);
    font-weight: 700;
    transform: translateY(-160%);
}

.auth-skip-link:focus {
    outline: 3px solid var(--auth-cobalt);
    outline-offset: 3px;
    transform: translateY(0);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(560px, 46%) minmax(0, 54%);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: clip;
    background: var(--auth-bg);
}

.auth-panel {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(32px, 4.2vw, 68px) clamp(38px, 5.4vw, 86px) 28px;
    background:
        linear-gradient(115deg, rgba(255,255,255,0.018), transparent 42%),
        var(--auth-bg);
    box-shadow: 26px 0 70px rgba(0, 0, 0, 0.16);
}

.auth-panel::before {
    position: absolute;
    inset: 0 0 0 auto;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(239, 191, 86, 0.32) 23%, rgba(255,255,255,0.08) 72%, transparent);
    content: "";
}

.auth-brand {
    position: relative;
    display: inline-flex;
    width: fit-content;
    align-items: baseline;
    color: var(--auth-text-strong);
    font-family: var(--auth-font-display);
    font-size: clamp(1.75rem, 2.2vw, 2.25rem);
    font-weight: 730;
    letter-spacing: -0.055em;
    line-height: 1;
    text-decoration: none;
    animation: auth-rise var(--auth-duration-slow) var(--auth-ease) both;
}

.auth-brand::after {
    position: absolute;
    top: calc(100% + 44px);
    left: 0;
    width: 36px;
    height: 2px;
    background: var(--auth-gold);
    content: "";
    transform-origin: left;
    animation: auth-marker-in 520ms 240ms var(--auth-ease) both;
}

.auth-brand:hover {
    color: var(--auth-text-strong);
}

.auth-brand-accent {
    color: var(--auth-cobalt);
}

.auth-content {
    width: min(100%, var(--auth-content-width));
    margin-top: clamp(64px, 8.6vh, 112px);
    outline: none;
}

.auth-heading {
    margin-bottom: var(--auth-space-7);
    animation: auth-rise var(--auth-duration-slow) 90ms var(--auth-ease) both;
}

.auth-heading h1 {
    max-width: 660px;
    margin: 0;
    color: var(--auth-text-strong);
    font-family: var(--auth-font-display);
    font-size: clamp(3rem, 4.25vw, 4.65rem);
    font-stretch: semi-condensed;
    font-weight: 690;
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.auth-heading h1 strong {
    display: block;
    color: var(--auth-gold);
    font-weight: inherit;
}

.auth-intro,
.auth-copy {
    max-width: 520px;
    margin: var(--auth-space-5) 0 0;
    color: var(--auth-muted);
    font-size: 1.08rem;
    line-height: 1.62;
}

.auth-copy {
    margin-top: 0;
}

.auth-form,
.auth-support {
    display: grid;
    gap: var(--auth-space-5);
    animation: auth-rise var(--auth-duration-slow) 170ms var(--auth-ease) both;
}

.auth-field {
    display: grid;
    gap: var(--auth-space-2);
}

.auth-field > label {
    color: var(--auth-text-strong);
    font-size: 0.92rem;
    font-weight: 650;
    letter-spacing: 0.005em;
}

.auth-control {
    position: relative;
}

.auth-control input,
.auth-field > input {
    width: 100%;
    min-height: var(--auth-control-height);
    padding: 0 17px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    outline: none;
    background: rgba(20, 26, 30, 0.86);
    color: var(--auth-text-strong);
    caret-color: var(--auth-cobalt);
    font-size: 1rem;
    line-height: 1.25;
    transition: border-color var(--auth-duration-fast) ease, background var(--auth-duration-fast) ease, box-shadow var(--auth-duration-fast) ease;
}

.auth-control input {
    padding-right: 54px;
}

.auth-control input::placeholder,
.auth-field > input::placeholder {
    color: #8e959a;
    opacity: 1;
}

.auth-control input:hover,
.auth-field > input:hover {
    border-color: var(--auth-border-strong);
    background: var(--auth-surface-hover);
}

.auth-control input:focus,
.auth-field > input:focus {
    border-color: var(--auth-cobalt);
    background: var(--auth-surface);
    box-shadow: var(--auth-focus-ring);
}

.auth-control input[aria-invalid="true"],
.auth-field > input[aria-invalid="true"] {
    border-color: var(--auth-error);
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: var(--auth-radius-sm);
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
    place-items: center;
    transform: translateY(-50%);
    transition: background var(--auth-duration-fast) ease, color var(--auth-duration-fast) ease;
}

.auth-password-toggle:hover {
    background: rgba(255,255,255,0.06);
    color: var(--auth-text-strong);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid var(--auth-cobalt);
    outline-offset: 1px;
}

.auth-password-toggle svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.auth-password-toggle .auth-eye-off,
.auth-password-toggle[aria-pressed="true"] .auth-eye-on {
    display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-eye-off {
    display: block;
}

.auth-field > span,
.auth-validation-summary {
    color: var(--auth-error);
    font-size: 0.85rem;
    line-height: 1.45;
}

.auth-field > span:empty,
.auth-validation-summary:empty {
    display: none;
}

.auth-validation-summary {
    padding: 13px 15px;
    border: 1px solid rgba(255, 141, 130, 0.38);
    border-radius: var(--auth-radius-md);
    background: var(--auth-error-surface);
}

.auth-validation-summary ul {
    margin: 0;
    padding-left: 20px;
}

.auth-options {
    display: flex;
    min-height: 28px;
    align-items: center;
    justify-content: space-between;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: var(--auth-space-3);
    color: var(--auth-text);
    cursor: pointer;
    font-size: 0.95rem;
}

.auth-check input {
    width: 20px;
    height: 20px;
    margin: 0;
    border: 1px solid var(--auth-border-strong);
    border-radius: 4px;
    accent-color: var(--auth-cobalt);
}

.auth-check input:focus-visible {
    outline: 2px solid var(--auth-cobalt);
    outline-offset: 3px;
}

.auth-submit,
.auth-secondary-button,
.auth-provider {
    display: inline-flex;
    min-height: var(--auth-control-height);
    align-items: center;
    justify-content: center;
    gap: var(--auth-space-3);
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--auth-radius-md);
    font-family: var(--auth-font-body);
    font-size: 1rem;
    font-weight: 720;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--auth-duration-fast) ease, border-color var(--auth-duration-fast) ease, box-shadow var(--auth-duration-fast) ease, color var(--auth-duration-fast) ease, transform var(--auth-duration-fast) ease;
}

.auth-submit {
    width: 100%;
    background: var(--auth-cobalt);
    color: #fff;
    box-shadow: 0 14px 34px rgba(21, 92, 255, 0.2);
}

.auth-submit:hover {
    background: var(--auth-cobalt-hover);
    color: #fff;
    transform: translateY(-1px);
}

.auth-submit:active {
    background: var(--auth-cobalt-dark);
    box-shadow: none;
    transform: translateY(0);
}

.auth-submit:focus-visible,
.auth-secondary-button:focus-visible,
.auth-provider:focus-visible {
    outline: 2px solid var(--auth-text-strong);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(21, 92, 255, 0.46);
}

.auth-submit svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform var(--auth-duration-fast) ease;
}

.auth-submit:hover svg {
    transform: translateX(3px);
}

.auth-secondary-button,
.auth-provider {
    width: 100%;
    border-color: var(--auth-border);
    background: transparent;
    color: var(--auth-text-strong);
}

.auth-secondary-button:hover,
.auth-provider:hover {
    border-color: var(--auth-border-strong);
    background: var(--auth-surface-hover);
    color: var(--auth-text-strong);
}

.auth-links {
    display: grid;
    gap: var(--auth-space-3);
    justify-items: start;
    margin-top: var(--auth-space-1);
    font-size: 0.94rem;
}

.auth-links--inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--auth-space-4) var(--auth-space-6);
}

.auth-note {
    padding: 14px 16px;
    border-left: 2px solid var(--auth-gold);
    background: rgba(239, 191, 86, 0.07);
    color: var(--auth-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.auth-note strong {
    color: var(--auth-text-strong);
}

.auth-status {
    display: grid;
    gap: var(--auth-space-3);
    padding: 18px 20px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    background: var(--auth-surface);
    color: var(--auth-text);
    line-height: 1.55;
}

.auth-status p {
    margin: 0;
}

.auth-status--success {
    border-color: rgba(139, 214, 165, 0.42);
    background: var(--auth-success-surface);
}

.auth-status--error {
    border-color: rgba(255, 141, 130, 0.42);
    background: var(--auth-error-surface);
}

.auth-status--warning {
    border-color: rgba(239, 200, 120, 0.42);
    background: var(--auth-warning-surface);
}

.auth-status-icon {
    display: grid;
    width: 42px;
    height: 42px;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: var(--auth-success);
    font-size: 1.2rem;
    font-weight: 800;
    place-items: center;
}

.auth-status--error .auth-status-icon {
    color: var(--auth-error);
}

.auth-status--warning .auth-status-icon {
    color: var(--auth-warning);
}

.auth-actions {
    display: grid;
    gap: var(--auth-space-4);
    margin-top: var(--auth-space-6);
}

.auth-external {
    margin-top: var(--auth-space-7);
    padding-top: var(--auth-space-6);
    border-top: 1px solid var(--auth-border);
}

.auth-external h2 {
    margin: 0 0 var(--auth-space-4);
    color: var(--auth-muted);
    font-size: 0.9rem;
    font-weight: 650;
}

.auth-external form {
    display: grid;
    gap: var(--auth-space-3);
}

.auth-footer {
    display: flex;
    flex-wrap: wrap;
    gap: var(--auth-space-4);
    align-items: center;
    margin-top: auto;
    padding-top: var(--auth-space-8);
    color: var(--auth-subtle);
    font-size: 0.78rem;
    animation: auth-rise var(--auth-duration-slow) 250ms var(--auth-ease) both;
}

.auth-footer a {
    color: inherit;
}

.auth-art {
    position: relative;
    min-height: 100%;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 22% 58%, rgba(255,255,255,0.045), transparent 25%),
        var(--auth-bg-deep);
}

.auth-art::after {
    position: absolute;
    z-index: 20;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
    content: "";
    mix-blend-mode: soft-light;
    opacity: 0.45;
    pointer-events: none;
}

.auth-art > span {
    position: absolute;
    display: block;
}

.auth-art-grid {
    z-index: 1;
    inset: 0 0 36% 54%;
    background-image:
        linear-gradient(rgba(239,191,86,0.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(239,191,86,0.22) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(90deg, transparent, #000 28%);
    animation: auth-grid-drift 18s linear infinite alternate;
}

.auth-art-blue {
    z-index: 2;
    top: 0;
    right: 18%;
    bottom: 21%;
    width: 39%;
    background: #0b43c8;
    box-shadow: inset 18px 0 38px rgba(0,0,0,0.24);
    clip-path: polygon(26% 0, 100% 0, 100% 100%, 0 78%, 0 10%);
    animation: auth-clip-in 900ms 120ms var(--auth-ease) both;
}

.auth-art-wall {
    z-index: 5;
    right: -7%;
    bottom: -3%;
    width: 63%;
    height: 78%;
    background: var(--auth-limestone);
    box-shadow: -35px 30px 80px rgba(0,0,0,0.34), inset 20px 0 34px rgba(76,61,41,0.12);
    clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 48%);
    animation: auth-wall-in 980ms 100ms var(--auth-ease) both;
}

.auth-art-wall::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(143deg, transparent 43%, rgba(13,17,20,0.42) 43.3%, rgba(13,17,20,0.05) 65%, transparent 76%);
    content: "";
}

.auth-art-light {
    z-index: 7;
    top: 0;
    bottom: 29%;
    left: 23%;
    width: clamp(10px, 1.35vw, 22px);
    background: #ffd77d;
    box-shadow: 0 0 32px rgba(255,215,125,0.8), 18px 0 70px rgba(239,191,86,0.35), -18px 0 70px rgba(239,191,86,0.25);
    animation: auth-light-in 780ms 280ms var(--auth-ease) both;
}

.auth-art-slab {
    z-index: 9;
    left: -8%;
    bottom: 8%;
    width: 59%;
    height: 47%;
    background: #111619;
    box-shadow: 28px 35px 70px rgba(0,0,0,0.45);
    clip-path: polygon(0 0, 79% 14%, 100% 100%, 0 100%);
    animation: auth-slab-in 900ms 220ms var(--auth-ease) both;
}

.auth-art-step {
    z-index: 12;
    right: -2%;
    height: 5.5%;
    background: #baac96;
    box-shadow: 0 -1px rgba(255,255,255,0.45), -10px 18px 22px rgba(0,0,0,0.18);
    transform: skewX(-24deg);
}

.auth-art-step-one {
    bottom: 8%;
    width: 43%;
}

.auth-art-step-two {
    right: 3%;
    bottom: 13.4%;
    width: 36%;
}

.auth-art-step-three {
    right: 7%;
    bottom: 18.8%;
    width: 29%;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-clip-in {
    from { opacity: 0; clip-path: polygon(72% 0, 100% 0, 100% 100%, 68% 78%, 68% 10%); }
    to { opacity: 1; clip-path: polygon(26% 0, 100% 0, 100% 100%, 0 78%, 0 10%); }
}

@keyframes auth-wall-in {
    from { opacity: 0; transform: translate(16%, 8%); }
    to { opacity: 1; transform: translate(0, 0); }
}

@keyframes auth-light-in {
    from { opacity: 0; transform: scaleY(0); transform-origin: top; }
    to { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

@keyframes auth-slab-in {
    from { opacity: 0; transform: translateX(-15%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes auth-grid-drift {
    from { transform: translate(0, 0); }
    to { transform: translate(-12px, 12px); }
}

@keyframes auth-marker-in {
    from { opacity: 0; transform: scaleX(0); }
    to { opacity: 1; transform: scaleX(1); }
}

@media (max-width: 1100px) {
    .auth-shell {
        grid-template-columns: minmax(530px, 54%) minmax(0, 46%);
    }

    .auth-panel {
        padding-right: clamp(34px, 5vw, 58px);
        padding-left: clamp(34px, 5vw, 58px);
    }

    .auth-heading h1 {
        font-size: clamp(2.85rem, 5vw, 3.65rem);
    }

    .auth-art-wall {
        right: -20%;
        width: 78%;
    }
}

@media (max-width: 900px) {
    .auth-shell {
        position: relative;
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .auth-panel {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 34px clamp(28px, 8vw, 72px) 26px;
        background: linear-gradient(120deg, rgba(255,255,255,0.02), transparent 42%), var(--auth-bg);
    }

    .auth-panel::before {
        display: none;
    }

    .auth-content {
        position: relative;
        z-index: 4;
        margin-top: clamp(68px, 10vh, 92px);
    }

    .auth-heading h1 {
        max-width: 560px;
    }

    .auth-art {
        position: absolute;
        z-index: 11;
        top: 0;
        right: 0;
        width: min(38vw, 290px);
        height: 210px;
        min-height: 0;
        background: transparent;
        pointer-events: none;
    }

    .auth-art-grid,
    .auth-art-wall,
    .auth-art-slab,
    .auth-art-step {
        display: none;
    }

    .auth-art-blue {
        top: 0;
        right: 0;
        bottom: auto;
        width: 48%;
        height: 100%;
        clip-path: polygon(46% 0, 100% 0, 100% 100%, 0 74%);
    }

    .auth-art-light {
        top: 0;
        right: 48%;
        bottom: auto;
        left: auto;
        width: 8px;
        height: 74%;
    }

    .auth-art::before {
        position: absolute;
        z-index: 4;
        top: 0;
        right: 48%;
        width: 52%;
        height: 72%;
        background: #2a2a28;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 38%);
        content: "";
    }
}

@media (max-width: 600px) {
    :root {
        --auth-control-height: 54px;
    }

    .auth-panel {
        padding: 28px 22px 22px;
    }

    .auth-brand {
        font-size: 1.8rem;
    }

    .auth-content {
        width: 100%;
        margin-top: clamp(74px, 11vh, 96px);
    }

    .auth-heading {
        margin-bottom: 28px;
    }

    .auth-heading h1 {
        max-width: 355px;
        font-size: clamp(2.55rem, 12.4vw, 3.25rem);
        line-height: 1.01;
    }

    .auth-intro,
    .auth-copy {
        font-size: 1rem;
    }

    .auth-form,
    .auth-support {
        gap: 18px;
    }

    .auth-links {
        gap: 14px;
    }

    .auth-footer {
        padding-top: 30px;
    }

    .auth-art {
        width: 150px;
        height: 166px;
    }
}

@media (max-width: 374px) {
    .auth-panel {
        padding-right: 18px;
        padding-left: 18px;
    }

    .auth-heading h1 {
        font-size: 2.45rem;
    }

    .auth-links--inline {
        display: grid;
        gap: var(--auth-space-3);
    }
}

.auth-otp {
    font-variant-numeric: tabular-nums;
    text-align: center;
    letter-spacing: .35em;
    font-size: 1.5rem;
    max-width: 100%;
}

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