/* ============================================================
   1vsM Auth Pages — Login, Register, Forgot/Reset Password
   Dark/gold theme, mobile-first, WCAG AA accessible.
   ============================================================ */

/* ── Auth Page Layout ──────────────────────────────────────── */

.auth-page {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    padding: 1.5rem 1rem 3rem;
}

.auth-page .container {
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
}

/* ── Auth Card ─────────────────────────────────────────────── */

.auth-card {
    padding: 2rem 1.5rem;
    max-width: 460px;
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
}

.auth-header p {
    color: var(--site-text-muted, #999);
    font-size: 0.925rem;
    margin: 0;
}

/* ── Form Groups ───────────────────────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 2px solid var(--glass-border);
    background: var(--glass);
    color: var(--text-light);
    font-size: 1rem;
    font-family: var(--font-body);
    outline: none;
    box-sizing: border-box;
    min-height: 44px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.form-group input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.form-group input::placeholder {
    color: var(--site-text-muted, #666);
}

.form-group input[aria-invalid="true"] {
    border-color: var(--color-danger, #E57373);
}

/* ── Links ─────────────────────────────────────────────────── */

.form-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
}

.form-link:hover,
.form-link:focus-visible {
    text-decoration: underline;
}

/* ── Buttons ───────────────────────────────────────────────── */

.btn-full {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    border-radius: 12px;
    margin-top: 0.5rem;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
}

.btn-full:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-full:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ── Divider ───────────────────────────────────────────────── */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--site-text-muted, #999);
    font-size: 0.85rem;
}

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

/* ── Footer ────────────────────────────────────────────────── */

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--site-text-muted, #999);
    font-size: 0.9rem;
}

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

.auth-footer a:hover,
.auth-footer a:focus-visible {
    text-decoration: underline;
}

/* ── Alerts ────────────────────────────────────────────────── */

.auth-alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-alert:empty,
.auth-alert[style*="display: none"] {
    margin: 0;
}

.auth-alert-success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.25);
    color: var(--color-success-light, #6EE7B7);
}

.auth-alert-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: var(--color-danger-light, #FCA5A5);
}

.auth-alert-info {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--color-gold, #F1D279);
}

/* ── Inline field errors ───────────────────────────────────── */

.field-error {
    color: var(--color-danger-light, #FCA5A5);
    font-size: 0.8rem;
    margin-top: 0.35rem;
    min-height: 1.2em;
}

/* ── Password strength indicator ───────────────────────────── */

.password-strength {
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.1);
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
}

.strength-weak { background: var(--color-danger, #ff6b6b); width: 25%; }
.strength-fair { background: var(--color-warning, #FFB74D); width: 50%; }
.strength-good { background: var(--color-gold, #D4AF37); width: 75%; }
.strength-strong { background: var(--color-success, #4CAF50); width: 100%; }

/* ── Spinner for loading buttons ───────────────────────────── */

.btn-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
    vertical-align: -0.15em;
    margin-right: 0.4em;
}

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

/* ── Responsive — mobile-first ─────────────────────────────── */
/* 320px baseline defaults */
.auth-card {
    padding: 1.5rem 1.15rem;
    border-radius: 14px;
}

.auth-header h1 {
    font-size: 1.5rem;
}

/* Tablet 520px+: roomier auth card */
@media (min-width: 520px) {
    .auth-card {
        padding: 2.5rem;
        border-radius: inherit;
    }

    .auth-header h1 {
        font-size: 2rem;
    }

    .form-group input {
        padding: 0.85rem 1.25rem;
        border-radius: 12px;
    }
}

/* ── Reduced motion ────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .form-group input,
    .btn-full,
    .password-strength-fill {
        transition: none;
    }

    .btn-spinner {
        animation: none;
    }
}
