:root {
    --auth-bg: #061a2d;
    --auth-bg-secondary: #092943;
    --auth-primary: #063b75;
    --auth-accent: #16b8e5;
    --auth-card: #ffffff;
    --auth-text: #0c2742;
    --auth-muted: #64748b;
    --auth-border: #cbd5e1;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 0% 100%, rgba(22, 184, 229, .34), transparent 25%),
        radial-gradient(circle at 72% 30%, rgba(6, 59, 117, .36), transparent 31%),
        linear-gradient(135deg, #041326 0%, var(--auth-bg) 48%, #020b17 100%);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 400;
}

body.auth-page::before,
body.auth-page::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

body.auth-page::before {
    inset: 0;
    opacity: .34;
    background-image:
        radial-gradient(circle, rgba(22, 184, 229, .72) 1px, transparent 1.4px),
        linear-gradient(120deg, rgba(22, 184, 229, .12) 1px, transparent 1px);
    background-size: 20px 20px, 170px 170px;
    background-position: 0 0, -40px 60px;
    mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.7) 36%, transparent 70%);
}

body.auth-page::after {
    left: -7%;
    bottom: -18%;
    width: 48vw;
    height: 48vw;
    min-width: 420px;
    min-height: 420px;
    opacity: .32;
    background:
        linear-gradient(30deg, transparent 0 48%, rgba(22,184,229,.45) 49% 50%, transparent 51%),
        linear-gradient(150deg, transparent 0 48%, rgba(22,184,229,.24) 49% 50%, transparent 51%);
}

.auth-help {
    position: fixed;
    top: 36px;
    right: 44px;
    z-index: 3;
    display: none;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.9);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 54fr) minmax(420px, 46fr);
    align-items: center;
    gap: clamp(34px, 5vw, 78px);
    padding: clamp(42px, 5.2vw, 92px) clamp(34px, 5.6vw, 96px) 64px;
}

.auth-showcase {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 24px;
}

.auth-showcase .showcase-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: auto;
    display: grid;
    align-content: center;
    gap: 24px;
}

.auth-logo-card {
    width: 222px;
    min-height: 94px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 22px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .24);
}

.auth-logo-card img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 68px;
    object-fit: contain;
}

.auth-showcase h1 {
    max-width: 560px;
    margin: 8px 0 0;
    color: #ffffff;
    font-size: clamp(38px, 4.2vw, 56px);
    line-height: 1.13;
    font-weight: 600;
    letter-spacing: 0;
}

.auth-showcase-copy {
    max-width: 535px;
    margin: 0;
    color: rgba(255,255,255,.84);
    font-size: clamp(18px, 1.6vw, 22px);
    line-height: 1.55;
    font-weight: 400;
}

.auth-illustration {
    position: relative;
    width: min(620px, 92%);
    height: 300px;
    margin-top: 4px;
    color: #65c9ff;
}

.auth-illustration svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.auth-illustration .line {
    stroke: rgba(22,184,229,.44);
    stroke-width: 1.15;
    fill: none;
}

.auth-illustration .dash {
    stroke-dasharray: 6 8;
}

.auth-illustration .node,
.auth-illustration .hub,
.auth-illustration .tile {
    fill: rgba(3, 29, 55, .44);
    stroke: rgba(22,184,229,.72);
    stroke-width: 1.3;
}

.auth-illustration .icon {
    fill: none;
    stroke: #72cdff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-panel {
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 28px;
    padding: 0;
    background: transparent;
}

.auth-card {
    width: min(100%, 480px);
    padding: 46px 46px 34px;
    border: 1px solid rgba(203, 213, 225, .86);
    border-radius: 15px;
    background: var(--auth-card);
    color: var(--auth-text);
    box-shadow: 0 24px 48px rgba(0, 0, 0, .22);
    text-align: initial;
}

.auth-card-head {
    text-align: center;
    margin-bottom: 34px;
}

.auth-card-head h2 {
    margin: 0;
    color: #0b1f3a;
    font-size: 30px;
    line-height: 1.16;
    font-weight: 600;
    letter-spacing: 0;
}

.auth-card-head p {
    margin: 14px 0 0;
    color: var(--auth-muted);
    font-size: 16px;
    line-height: 1.45;
    font-weight: 400;
}

.auth-two-factor-card {
    padding-top: 44px;
    text-align: center;
}

.auth-two-factor-head {
    margin-bottom: 28px;
}

.auth-two-factor-head h1 {
    font-size: 28px;
}

.auth-verify-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border-radius: 16px;
    color: #063b75;
    background: #eaf3ff;
}

.auth-verify-icon svg {
    width: 30px;
    height: 30px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-alert {
    margin: -10px 0 22px;
    padding: 13px 14px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    background: #fff1f2;
    font-size: 14px;
    line-height: 1.45;
}

.auth-code-error {
    margin: -6px 0 20px;
    text-align: left;
}

.auth-form {
    display: grid;
    gap: 22px;
}

.auth-field {
    display: grid;
    gap: 10px;
}

.auth-field label {
    color: #0f172a;
    font-size: 15px;
    font-weight: 500;
}

.auth-input {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon,
.auth-password-toggle {
    position: absolute;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
}

.auth-input-icon {
    left: 17px;
    width: 24px;
    height: 24px;
}

.auth-input svg,
.auth-secure-note svg,
.auth-help svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-input input {
    width: 100%;
    height: 56px;
    padding: 0 48px 0 54px;
    border: 1px solid var(--auth-border);
    border-radius: 9px;
    color: #17233b;
    background: #ffffff;
    font-size: 16px;
    font-weight: 400;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.auth-input input::placeholder {
    color: #64748b;
}

.auth-input input:focus {
    border-color: #06469a;
    box-shadow: 0 0 0 3px rgba(6, 70, 154, .12);
}

.auth-password-toggle {
    right: 12px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.auth-password-toggle:focus-visible,
.auth-submit:focus-visible,
.auth-forgot:focus-visible,
.auth-remember input:focus-visible {
    outline: 3px solid rgba(22,184,229,.32);
    outline-offset: 2px;
}

.auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: -2px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-size: 15px;
    font-weight: 400;
}

.auth-remember input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #063b75;
}

.auth-forgot {
    display: none;
    color: #0b63ce;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.auth-two-factor-form {
    gap: 24px;
}

.auth-code-group {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.auth-code-group input {
    width: 100%;
    aspect-ratio: 1 / 1.12;
    min-height: 58px;
    border: 1px solid var(--auth-border);
    border-radius: 9px;
    color: #0b1f3a;
    background: #ffffff;
    font-size: 24px;
    line-height: 1;
    font-weight: 500;
    text-align: center;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.auth-code-group input:focus {
    border-color: #06469a;
    box-shadow: 0 0 0 3px rgba(6, 70, 154, .12);
}

.auth-code-group.is-invalid input {
    border-color: #ef4444;
    background: #fffafa;
}

.auth-code-group.is-invalid input:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .14);
}

.auth-submit {
    position: relative;
    width: 100%;
    height: 56px;
    border: 1px solid #062f61;
    border-radius: 8px;
    background: linear-gradient(180deg, #063b75 0%, #052e63 100%);
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(6, 59, 117, .24);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.auth-submit:disabled {
    cursor: not-allowed;
    opacity: .56;
    box-shadow: none;
}

.auth-submit:hover {
    filter: brightness(1.04);
    box-shadow: 0 14px 28px rgba(6, 59, 117, .3);
}

.auth-submit:disabled:hover {
    filter: none;
    box-shadow: none;
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-submit.is-loading {
    pointer-events: none;
    opacity: .82;
}

.auth-submit.is-loading::after {
    content: "";
    position: absolute;
    right: 20px;
    top: calc(50% - 8px);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.42);
    border-top-color: #ffffff;
    animation: auth-spin .8s linear infinite;
}

.auth-back-link {
    display: inline-flex;
    justify-content: center;
    margin-top: 22px;
    color: #475569;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.auth-back-link:hover {
    color: #063b75;
}

.auth-back-link:focus-visible {
    outline: 3px solid rgba(22,184,229,.32);
    outline-offset: 3px;
    border-radius: 6px;
}

.auth-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 15px;
    font-weight: 400;
}

.auth-footer {
    color: rgba(255,255,255,.62);
    font-size: 14px;
    text-align: center;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

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

@media (max-width: 1120px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr) minmax(380px, .9fr);
        gap: 34px;
        padding-inline: 36px;
    }

    .auth-showcase h1 {
        font-size: 42px;
    }

    .auth-illustration {
        width: 100%;
        height: 250px;
    }
}

@media (max-width: 860px) {
    body.auth-page::before {
        mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.5) 45%, transparent 90%);
    }

    .auth-shell {
        min-height: 100vh;
        grid-template-columns: 1fr;
        align-content: center;
        gap: 24px;
        padding: 28px 18px 34px;
    }

    .auth-showcase {
        justify-items: center;
        text-align: center;
        gap: 14px;
    }

    .auth-logo-card {
        width: 190px;
        min-height: 78px;
    }

    .auth-showcase h1,
    .auth-showcase-copy,
    .auth-illustration {
        display: none;
    }

    .auth-card {
        width: min(100%, 460px);
        padding: 34px 24px 28px;
        border-radius: 14px;
    }

    .auth-card-head h2 {
        font-size: 26px;
    }

    .auth-two-factor-head h1 {
        font-size: 25px;
    }

    .auth-code-group {
        gap: 8px;
    }

    .auth-code-group input {
        min-height: 52px;
        font-size: 22px;
    }

    .auth-panel {
        gap: 20px;
    }

    .auth-footer {
        max-width: 310px;
        line-height: 1.4;
    }
}

@media (max-width: 360px) {
    .auth-shell {
        padding-inline: 12px;
    }

    .auth-card {
        padding: 28px 18px 24px;
    }

    .auth-input input {
        height: 54px;
        font-size: 15px;
    }

    .auth-code-group {
        gap: 6px;
    }

    .auth-code-group input {
        min-height: 44px;
        border-radius: 8px;
        font-size: 20px;
    }

    .auth-form-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}
