:root {
    --auth-bg: #eef2f8;
    --auth-card: #ffffff;
    --auth-ink: #1d2430;
    --auth-muted: #6b7683;
    --auth-line: #dfe4ec;
    --auth-accent: #1b6ec2;
    --auth-accent-dark: #1861ac;
    --auth-danger: #b32121;
    --auth-success: #1a7f4b;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 1rem;
    background: var(--auth-bg);
    color: var(--auth-ink);
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    background: var(--auth-card);
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 12px 32px rgba(29, 36, 48, 0.08);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: var(--auth-accent);
    color: #fff;
    font-weight: 700;
}

.auth-brand-name {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.auth-title {
    margin: 0 0 0.35rem;
    font-size: 1.4rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    margin: 0 0 1.5rem;
    color: var(--auth-muted);
    font-size: 0.9rem;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 550;
}

.auth-field input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: inherit;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(27, 110, 194, 0.15);
}

.auth-field input.invalid {
    border-color: var(--auth-danger);
    outline: none;
}

.auth-field .validation-message {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--auth-danger);
}

.auth-otp input {
    letter-spacing: 0.5em;
    text-align: center;
    font-size: 1.15rem;
}

.auth-button {
    width: 100%;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: 8px;
    background: var(--auth-accent);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-button:hover:not(:disabled) {
    background: var(--auth-accent-dark);
}

.auth-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth-link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--auth-accent);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

.auth-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.auth-alert {
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.auth-alert-error {
    background: #fdeaea;
    border: 1px solid #f3c4c4;
    color: var(--auth-danger);
}

.auth-alert-success {
    background: #e8f6ee;
    border: 1px solid #bfe3ce;
    color: var(--auth-success);
}

.auth-alert-info {
    background: #eaf2fb;
    border: 1px solid #c5dcf5;
    color: var(--auth-accent-dark);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--auth-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-line);
}

.auth-footer {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.87rem;
    color: var(--auth-muted);
}

.auth-footer a {
    color: var(--auth-accent);
}

.auth-footnote {
    margin: 0;
    font-size: 0.78rem;
    color: var(--auth-muted);
}

.auth-spinner {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    margin-right: 0.4rem;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
    vertical-align: -2px;
}

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

@media (prefers-color-scheme: dark) {
    :root {
        --auth-bg: #12161d;
        --auth-card: #1a1f28;
        --auth-ink: #e8ecf2;
        --auth-muted: #98a2b0;
        --auth-line: #2b3341;
        --auth-accent: #4c9aef;
        --auth-accent-dark: #3b83d1;
    }

    .auth-card {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    }

    .auth-field input {
        background: #131820;
    }

    .auth-alert-error {
        background: #33191b;
        border-color: #5a2a2d;
        color: #f0a0a0;
    }

    .auth-alert-success {
        background: #14291f;
        border-color: #285a3f;
        color: #86d5a9;
    }

    .auth-alert-info {
        background: #16232f;
        border-color: #2a4459;
        color: #9dc8f0;
    }
}
