/* ============================================================
   Auth Pages - Login, Signup, Password Reset, MFA
   ============================================================ */

/* ── Page Background ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

[data-bs-theme="light"] .auth-page {
    background: linear-gradient(135deg, #f0f0ff 0%, #e8f4f8 50%, #f0f0ff 100%);
}

[data-bs-theme="dark"] .auth-page {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0f0f23 100%);
}

/* ── Theme Toggle (top-right corner) ── */
.auth-theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    gap: 2px;
    padding: 4px;
    border-radius: var(--radius-lg);
}

[data-bs-theme="light"] .auth-theme-toggle {
    background: rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .auth-theme-toggle {
    background: rgba(255, 255, 255, 0.08);
}

.auth-theme-toggle .theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    opacity: 0.5;
    transition: opacity 0.15s, background-color 0.15s;
    cursor: pointer;
}

[data-bs-theme="light"] .auth-theme-toggle .theme-btn {
    color: var(--text-primary);
}

[data-bs-theme="dark"] .auth-theme-toggle .theme-btn {
    color: #e2e8f0;
}

.auth-theme-toggle .theme-btn:hover {
    opacity: 0.8;
}

[data-bs-theme="light"] .auth-theme-toggle .theme-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .auth-theme-toggle .theme-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.auth-theme-toggle .theme-btn.active {
    opacity: 1;
    background: var(--primary);
    color: #fff;
}

/* ── Auth Card ── */
.auth-card {
    width: 100%;
    max-width: 440px;
    border: none !important;
    border-radius: var(--radius-xl) !important;
    overflow: hidden;
}

[data-bs-theme="light"] .auth-card {
    background: #fff;
    box-shadow: var(--shadow-card);
}

[data-bs-theme="dark"] .auth-card {
    background: var(--surface);
}

.auth-card .card-body {
    padding: 2.5rem;
}

@media (max-width: 480px) {
    .auth-card .card-body {
        padding: 1.5rem;
    }
}

/* ── Auth Branding ── */
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand img {
    display: block;
    margin: 0 auto 0.75rem;
}

.auth-brand .auth-site-name {
    display: block;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.auth-brand .auth-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.auth-brand .auth-subheading {
    color: var(--text-secondary);
    font-size: var(--text-md);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* ── Floating Label Overrides ── */
.auth-card .form-floating > .form-control {
    border-radius: var(--radius-lg);
    border-color: var(--border);
    height: calc(3.25rem + 2px);
}

.auth-card .form-floating > .form-control:focus {
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}

.auth-card .form-floating > label {
    color: var(--text-secondary);
}

/* ── Auth Submit Button ── */
.auth-btn {
    width: 100%;
    padding: 0.625rem 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transition: opacity 0.15s, box-shadow 0.15s;
}

.auth-btn:hover {
    opacity: 0.9;
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.auth-btn:focus {
    box-shadow: var(--focus-ring);
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Auth Links ── */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.auth-links a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* ── Auth Divider ── */
.auth-divider {
    border-color: var(--border);
    margin: 1.5rem 0;
}

/* ── Auth Checkbox ── */
.auth-card .form-check {
    margin-bottom: 0;
}

.auth-card .form-check-label {
    font-size: var(--text-md);
    color: var(--text-secondary);
}

/* ── Auth Success State ── */
.auth-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    margin: 0 auto 1.25rem;
}

[data-bs-theme="light"] .auth-success-icon {
    background: #e8f2ec;
    color: var(--success);
}

[data-bs-theme="dark"] .auth-success-icon {
    background: rgba(106, 184, 130, 0.15);
    color: var(--success);
}

/* ── Auth Email Icon ── */
.auth-email-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    margin: 0 auto 1.25rem;
}

[data-bs-theme="light"] .auth-email-icon {
    background: var(--primary-subtle);
    color: var(--primary);
}

[data-bs-theme="dark"] .auth-email-icon {
    background: var(--primary-subtle);
    color: #c7d2fe;
}

/* ── Forgot Password Link ── */
.auth-forgot-link {
    display: block;
    text-align: right;
    font-size: var(--text-base);
    color: var(--primary);
    text-decoration: none;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

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

/* ── Auth Alert ── */
.auth-card .alert {
    border-radius: var(--radius-lg);
    font-size: var(--text-md);
}

/* ── Auth Footer Text ── */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: var(--text-base);
    color: var(--text-secondary);
}
