:root {
    --page-bg: #10131a;
    --card-bg: #f8f7f5;
    --card-radius: 16px;
    --text: #15181e;
    --muted: #6b717c;
    --label: #4a505b;
    --border: #dcd8d1;
    --accent: #e2761b;
    --accent-hover: #c96412;
    --info-bg: #e7ebf0;
    --info-text: #36414f;
    --error-bg: #fbe8e6;
    --error-border: #d46c64;
    --error-text: #762d2a;
}

* {
    box-sizing: border-box;
}

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

body {
    min-width: 320px;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background: var(--page-bg);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px 16px;
}

.auth-card {
    display: grid;
    width: min(100%, 900px);
    min-height: 560px;
    overflow: hidden;
    border-radius: var(--card-radius);
    background: var(--card-bg);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 6vw, 64px);
    color: #f2f4f8;
    background:
        radial-gradient(120% 90% at 15% 10%, rgba(226, 118, 27, 0.34), transparent 60%),
        linear-gradient(160deg, #1c2230 0%, #0e1117 70%);
}

.auth-badge {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 12px;
    color: #1a1207;
    background: linear-gradient(150deg, #f0913c, #d25b18);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.auth-brand-name {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.auth-tagline {
    max-width: 240px;
    margin: 16px 0 0;
    color: #9ba5b4;
}

.auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 7vw, 72px);
    background: var(--card-bg);
}

.auth-form-panel h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.7rem, 4vw, 2.25rem);
    font-weight: 750;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.auth-subtitle {
    margin: 12px 0 0;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.auth-field {
    display: grid;
    gap: 7px;
    margin: 0;
}

.auth-field label {
    color: var(--label);
    font-weight: 650;
}

.auth-field input,
.auth-field select {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: #ffffff;
    font: inherit;
}

.auth-field input:focus-visible,
.auth-field select:focus-visible,
.auth-submit:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(226, 118, 27, 0.16);
}

.auth-code-field {
    text-align: center;
}

.auth-code-field input {
    max-width: 230px;
    margin: 0 auto;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 1.45rem;
    letter-spacing: 0.22em;
    text-align: center;
}

.auth-submit {
    width: 100%;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: #ffffff;
    background: var(--accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.auth-submit:hover {
    background: var(--accent-hover);
    box-shadow: 0 7px 18px rgba(226, 118, 27, 0.2);
}

.auth-submit:active {
    background: #b6570d;
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.58;
}

.auth-alert {
    margin: 18px 0 0;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
}

.auth-alert--info {
    color: var(--info-text);
    background: var(--info-bg);
}

.auth-alert--error {
    border-color: var(--error-border);
    color: var(--error-text);
    background: var(--error-bg);
}

.auth-qr {
    display: grid;
    width: fit-content;
    max-width: 100%;
    place-items: center;
    margin: 24px auto 18px;
    padding: 14px;
    border-radius: 10px;
    background: #ffffff;
}

.auth-qr img {
    display: block;
    width: min(100%, 220px);
    height: auto;
}

.auth-secret {
    display: block;
    margin: 8px 0 20px;
    padding: 10px 12px;
    overflow-wrap: anywhere;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    user-select: all;
}

.auth-security-note {
    margin: 26px 0 0;
    color: #8a9099;
    font-size: 0.8rem;
}

@media (min-width: 900px) {
    .auth-card {
        grid-template-columns: 44% 56%;
    }
}

@media (max-width: 899px) {
    .auth-card {
        min-height: 0;
    }

    .auth-brand {
        min-height: 96px;
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 20px 24px;
    }

    .auth-badge {
        flex: 0 0 auto;
        margin: 0;
    }

    .auth-brand-name {
        font-size: 1.25rem;
    }

    .auth-tagline {
        display: none;
    }

    .auth-form-panel {
        padding: 36px 24px 28px;
    }
}

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