* {
    box-sizing: border-box;
}

:root {
    --auth-bg: #0d0e10;
    --auth-bg-soft: #141619;
    --auth-panel: #202328;
    --auth-panel-hover: #262a30;
    --auth-border: #34383f;
    --auth-border-soft: #292d33;
    --auth-text: #f5f6f7;
    --auth-text-soft: #d5d8dc;
    --auth-muted: #9da3ab;
    --auth-primary: #ff7a00;
    --auth-primary-hover: #ff922e;
    --auth-primary-soft: rgba(255, 122, 0, .14);
    --auth-danger: #ef5a5a;
    --auth-success: #35c978;
    --auth-radius-sm: 9px;
    --auth-radius-md: 13px;
    --auth-radius-lg: 22px;
    --auth-shadow: 0 28px 80px rgba(0, 0, 0, .38);
    --auth-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
    min-height: 100%;
    background: var(--auth-bg);
}

body.auth-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    color: var(--auth-text);
    font-family: var(--auth-font);
    background:
        radial-gradient(circle at 12% 16%, rgba(255, 122, 0, .16), transparent 28%),
        radial-gradient(circle at 88% 82%, rgba(255, 255, 255, .05), transparent 28%),
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(135deg, #0b0c0e, #111317 58%, #0d0e10);
    background-size: auto, auto, 46px 46px, 46px 46px, auto;
}

.auth-shell {
    width: min(1180px, calc(100% - 48px));
    min-height: calc(100vh - 72px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
    gap: clamp(44px, 7vw, 88px);
    align-items: center;
    padding: 48px 0;
}

.auth-shell-setup,
.auth-shell-recovery {
    grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    margin-bottom: clamp(42px, 7vh, 74px);
    color: inherit;
    text-decoration: none;
}

.auth-brand strong,
.auth-brand small {
    display: block;
}

.auth-brand strong {
    font-size: 22px;
    letter-spacing: -.025em;
}

.auth-brand small {
    margin-top: 3px;
    color: var(--auth-muted);
    font-size: 12px;
}

.auth-eyebrow,
.auth-panel-kicker {
    display: inline-flex;
    align-items: center;
    color: #ffb36d;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.auth-introduction h1 {
    max-width: 720px;
    margin: 16px 0 22px;
    font-size: clamp(36px, 4.7vw, 62px);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.auth-introduction-content > p {
    max-width: 690px;
    margin: 0;
    color: var(--auth-text-soft);
    font-size: 17px;
    line-height: 1.75;
}

.auth-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    margin-top: 34px;
}

.auth-feature,
.auth-security-card,
.auth-warning-card {
    border: 1px solid var(--auth-border-soft);
    border-radius: var(--auth-radius-md);
    background: rgba(255, 255, 255, .025);
}

.auth-feature {
    padding: 16px;
}

.auth-feature strong,
.auth-feature span,
.auth-security-card strong,
.auth-security-card span,
.auth-warning-card strong,
.auth-warning-card span {
    display: block;
}

.auth-feature strong,
.auth-security-card strong,
.auth-warning-card strong {
    color: var(--auth-text);
    font-size: 13px;
}

.auth-feature span,
.auth-security-card span,
.auth-warning-card span {
    margin-top: 6px;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.55;
}

.auth-security-card,
.auth-warning-card {
    max-width: 620px;
    margin-top: 30px;
    padding: 18px;
}

.auth-warning-card {
    border-color: rgba(255, 122, 0, .28);
    background: var(--auth-primary-soft);
}

.auth-step-list {
    max-width: 680px;
    margin: 34px 0 0;
    padding: 0;
    display: grid;
    gap: 13px;
    list-style: none;
    counter-reset: auth-step;
}

.auth-step-list li {
    position: relative;
    min-height: 68px;
    padding: 15px 16px 15px 62px;
    border: 1px solid var(--auth-border-soft);
    border-radius: var(--auth-radius-md);
    background: rgba(255,255,255,.024);
    counter-increment: auth-step;
}

.auth-step-list li::before {
    content: counter(auth-step);
    position: absolute;
    left: 16px;
    top: 15px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
    font-size: 12px;
    font-weight: 900;
}

.auth-step-list strong,
.auth-step-list span {
    display: block;
}

.auth-step-list strong {
    font-size: 13px;
}

.auth-step-list span {
    margin-top: 5px;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.5;
}

.auth-panel {
    width: 100%;
    max-width: 450px;
    justify-self: end;
    padding: clamp(28px, 4vw, 44px);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-lg);
    background: rgba(32, 35, 40, .94);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(16px);
}

.auth-panel-wide {
    max-width: 520px;
}

.auth-panel h2 {
    margin: 9px 0 0;
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -.035em;
}

.auth-panel-description {
    margin: 11px 0 26px;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.65;
}

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

.auth-form-compact {
    margin-top: 20px;
}

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

.auth-field label {
    color: var(--auth-text-soft);
    font-size: 12px;
    font-weight: 800;
}

.auth-field input {
    width: 100%;
    min-width: 0;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    outline: 0;
    background: #15171a;
    color: var(--auth-text);
    font: inherit;
    font-size: 15px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-field input:focus {
    border-color: var(--auth-primary);
    background: #181a1e;
    box-shadow: 0 0 0 4px var(--auth-primary-soft);
}

.auth-field input[readonly] {
    color: var(--auth-text-soft);
}

.auth-button,
.auth-secondary-button,
.auth-copy-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.auth-button {
    width: 100%;
    margin-top: 4px;
    background: var(--auth-primary);
    color: #17110b;
}

.auth-button:hover {
    background: var(--auth-primary-hover);
    transform: translateY(-1px);
}

.auth-secondary-button {
    width: 100%;
    border-color: var(--auth-border);
    background: #292d32;
    color: var(--auth-text);
}

.auth-secondary-button:hover,
.auth-copy-button:hover {
    background: #34383e;
}

.auth-copy-button {
    flex: 0 0 auto;
    min-height: 50px;
    border-color: var(--auth-border);
    background: #292d32;
    color: var(--auth-text);
}

.auth-copy-field {
    display: flex;
    gap: 9px;
}

.auth-copy-field input {
    flex: 1 1 auto;
}

.auth-alert {
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.55;
}

.auth-alert ul {
    margin: 0;
    padding-left: 18px;
}

.auth-alert-danger {
    border: 1px solid rgba(239, 90, 90, .34);
    background: rgba(239, 90, 90, .11);
    color: #ffb5b5;
}

.validation-summary-valid {
    display: none;
}

.auth-emergency {
    border: 1px solid var(--auth-border-soft);
    border-radius: 11px;
    background: rgba(255,255,255,.018);
}

.auth-emergency summary {
    padding: 13px 14px;
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.auth-emergency[open] summary {
    border-bottom: 1px solid var(--auth-border-soft);
}

.auth-emergency > p,
.auth-emergency .auth-field {
    margin-right: 14px;
    margin-left: 14px;
}

.auth-emergency > p {
    margin-top: 14px;
    margin-bottom: 14px;
    color: var(--auth-muted);
    font-size: 11px;
    line-height: 1.55;
}

.auth-emergency .auth-field {
    margin-bottom: 14px;
}

.auth-security-note {
    margin-top: 20px;
    color: var(--auth-muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

.auth-alternate-link {
    display: block;
    margin-top: 18px;
    color: #ffb36d;
    font-size: 12px;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}

.auth-alternate-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

.auth-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 18px 0 22px;
}

.auth-qr {
    width: 220px;
    max-width: 100%;
    height: auto;
    padding: 10px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(0,0,0,.28);
}

.recovery-code-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 22px 0;
}

.recovery-code-grid code {
    display: block;
    padding: 11px 9px;
    border: 1px solid var(--auth-border-soft);
    border-radius: 9px;
    background: #15171a;
    color: #ffd0a3;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    letter-spacing: .04em;
}

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

.auth-copy-status {
    min-height: 20px;
    margin: 12px 0 0;
    color: #8ae7b3;
    font-size: 11px;
    text-align: center;
}

.auth-footer {
    padding: 0 24px 24px;
    color: #777d84;
    font-size: 11px;
    text-align: center;
}

@media (max-width: 980px) {
    .auth-shell,
    .auth-shell-setup,
    .auth-shell-recovery {
        grid-template-columns: 1fr;
        gap: 38px;
        padding: 40px 0;
    }

    .auth-panel,
    .auth-panel-wide {
        max-width: none;
        justify-self: stretch;
    }

    .auth-brand {
        margin-bottom: 34px;
    }
}

@media (max-width: 620px) {
    .auth-shell {
        width: min(100% - 28px, 1180px);
        padding: 28px 0;
    }

    .auth-introduction h1 {
        font-size: 35px;
    }

    .auth-feature-grid,
    .recovery-code-grid {
        grid-template-columns: 1fr;
    }

    .auth-panel {
        padding: 26px 22px;
        border-radius: 18px;
    }

    .auth-copy-field {
        flex-direction: column;
    }

    .auth-copy-button {
        width: 100%;
    }

    .auth-brand-copy {
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

        .auth-brand-copy strong {
            display: block;
            color: var(--auth-text);
            font-size: 22px;
            font-weight: 850;
            line-height: 1.15;
            letter-spacing: -0.025em;
        }

        .auth-brand-copy small {
            display: block;
            margin-top: 4px;
            color: var(--auth-muted);
            font-size: 12px;
            line-height: 1.35;
        }

}
