.auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;
    background: var(--bg-primary);
}

.auth-backdrop {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 0;
    pointer-events: none;
}

.auth-theme-corner {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2;
}

.auth-stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 14px;
}

.auth-brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-mono);
    animation: auth-rise 0.5s ease-out;
}

.auth-brand-glyph {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 24px var(--accent-glow);
}

.auth-brand-name {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.auth-brand-cursor {
    width: 0.7em;
    height: 2.1rem;
    align-self: center;
    background: var(--accent);
    animation: auth-blink 1.8s steps(1) infinite;
}

@keyframes auth-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.auth-tagline {
    margin: 0 0 10px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-transform: lowercase;
    line-height: 1.3;
    min-height: 1.3em;
    white-space: nowrap;
    animation: auth-rise 0.6s ease-out;
    transition: opacity 1.2s ease;
}

.auth-tagline.auth-tagline-fading {
    opacity: 0;
}

.auth-card {
    width: 100%;
    max-width: 320px;
    transition: max-width 0.3s ease;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    box-shadow: var(--shadow-lg);
    animation: auth-rise 0.45s ease-out;
}

.auth-card.auth-card-wide {
    max-width: 420px;
}

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

.auth-card h2 {
    margin-bottom: 18px;
    text-align: center;
    font-size: 1rem;
    font-family: var(--font-mono);
    text-transform: lowercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.auth-card label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 5px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.auth-card input {
    margin-bottom: 14px;
}

.auth-submit-full {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 4px;
    text-align: center;
    text-decoration: none;
}

.auth-error {
    background: var(--danger-subtle);
    border: 1px solid var(--danger-border);
    color: var(--danger);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    margin-bottom: 14px;
    animation: auth-shake 0.4s ease-out;
}

@keyframes auth-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.auth-success {
    background: var(--success-subtle);
    border: 1px solid var(--success-border);
    color: var(--success);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    margin-bottom: 14px;
}

.auth-toggle {
    text-align: center;
    margin-top: 18px;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.auth-toggle a {
    color: var(--accent);
    text-decoration: none;
    margin-left: 4px;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.auth-toggle a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.auth-recovery-intro {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 12px;
}

.auth-recovery-codes {
    list-style: none;
    margin: 0 0 14px;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-primary);
}

.auth-recovery-codes li {
    min-width: 0;
    overflow-wrap: anywhere;
}

#recovery-codes-view .auth-submit-full {
    margin-bottom: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .auth-brand,
    .auth-tagline,
    .auth-card,
    .auth-error {
        animation: none;
    }

    .auth-tagline,
    .auth-card {
        transition: none;
    }

    .auth-brand-cursor {
        animation: none;
        opacity: 1;
    }
}
