/* ==========================================================================
   QuantaBible auth pages — shared centered-card layout + social buttons.
   Used by all authentication templates (login, register, set_password,
   choose_username, social_tos, setup_totp, profile).
   Requires tokens.css, base.css, components.css first.
   ========================================================================== */

.auth-card {
    max-width: 450px;
    margin: 3rem auto;
    background: var(--bg-card);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}
.auth-card-wide { max-width: 640px; }

.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.auth-header p { color: var(--text-secondary); font-family: var(--font-ui); margin: 0; }

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-family: var(--font-ui);
}
.auth-footer a { color: var(--color-accent); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* Auth form primitives — thin wrappers over components.css forms */
.auth-form .form-group, .auth-form .field { margin-bottom: 1.25rem; }
.auth-form .form-label { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.5rem; color: var(--text-primary); font-weight: 500; font-family: var(--font-ui); font-size: var(--text-sm); }
.auth-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-ui);
    color: var(--text-primary);
    background: var(--bg-input);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.auth-form .form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: var(--focus-ring);
}
.auth-form .form-help { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 0.25rem; }
.auth-submit { width: 100%; display: flex; justify-content: center; }

/* Auth alerts map Django message tags onto the shared alert component */
.auth-alerts .alert { margin-bottom: 1rem; }

/* "or continue with" divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-family: var(--font-ui);
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-light);
}
.auth-divider::before { margin-right: 0.75rem; }
.auth-divider::after { margin-left: 0.75rem; }

/* Social provider buttons — consistent height, theme-safe */
.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 48px;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-ui);
    transition: background 0.15s, box-shadow 0.15s;
    text-decoration: none;
    box-sizing: border-box;
}
.btn-social svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-social + .btn-social { margin-top: 0.75rem; }

.btn-google {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1.5px solid var(--border-light);
}
.btn-google:hover { background: var(--bg-card-hover); box-shadow: var(--shadow-sm); }

.btn-apple {
    background: #000;
    color: #fff;
    border: 1.5px solid #000;
}
.btn-apple:hover { background: #1a1a1a; box-shadow: var(--shadow-sm); }
.btn-apple svg { width: 18px; height: 18px; fill: currentColor; }
/* Keep the Apple button readable on dark theme (Apple brand requires black) */
[data-theme="dark"] .btn-apple { background: #fff; color: #000; border-color: #fff; }
[data-theme="dark"] .btn-apple:hover { background: #e6e6e6; }

/* Security notice callout */
.auth-notice {
    background: var(--bg-sidebar);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--color-cta);
    margin-bottom: 1.5rem;
}
.auth-notice h4 { color: var(--color-cta); margin: 0 0 0.5rem 0; font-size: 1rem; font-family: var(--font-ui); }
.auth-notice p { color: var(--text-secondary); margin: 0; font-size: var(--text-sm); }

/* TOTP / code display block */
.auth-code {
    display: block;
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    color: var(--text-primary);
    user-select: all;
}
.auth-qr { display: flex; justify-content: center; margin: 1rem 0; }
.auth-qr img, .auth-qr svg { border-radius: var(--radius-md); border: 1px solid var(--border-light); background: #fff; padding: 8px; }

@media (max-width: 640px) {
    .auth-card { margin: 1.5rem auto; padding: 1.75rem 1.25rem; }
}
