/**
 * CFIN Trading - Unified Auth & Error Pages Stylesheet
 * Shared by: login, forgot_password, reset_password, verify_login,
 *            email_verified, get-started, register, registration_thankyou,
 *            error-400 through error-504
 *
 * Theme variants:
 *   .auth-theme-blue  — trade.cfin.be (accent → purple)
 *   .auth-theme-green — www.cfin.be   (profit → accent)
 */

/* ============================================================================
   1. BASE LAYOUT
   ============================================================================ */

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-main);
    position: relative;
    overflow-x: clip; /* clip, not hidden — hidden creates a scroll container that breaks mobile scrolling */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Centered card layout (login, forgot, reset, verify, email_verified, thankyou, errors) */
.auth-page.auth-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

/* Safe vertical centering — margin:auto on flex child centers when space allows,
   but collapses to 0 on overflow so scrolling still works (unlike justify-content:center) */
.auth-page.auth-centered > .auth-container {
    margin-top: auto;
    margin-bottom: auto;
}

/* Scrollable content layout (get-started, register, legal pages) */
.auth-page.auth-scrollable {
    /* No flex needed on body — sticky footer handled by min-height on wrappers below */
}

/* Sticky footer: each content wrapper fills the viewport independently.
   Handles both auth-content>auth-container (get-started, register) and
   legal-container (disclaimer, privacy, cookies, acceptable-use) patterns.
   Bottom padding is zeroed so the footer sits at the true viewport bottom;
   the footer elements carry their own bottom spacing instead. */
.auth-page.auth-scrollable > .auth-content,
.auth-page.auth-scrollable > .legal-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

.auth-page.auth-scrollable .auth-content > .auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.auth-page.auth-scrollable .auth-footer-note {
    margin-top: auto;
    padding: 24px 0 40px;
}

/* ============================================================================
   2. BACKGROUND — Now unified via theme.css (aurora-bg + dash-bg-effects)
   ============================================================================ */

/* ============================================================================
   3. THEME VARIANTS
   ============================================================================ */

/* ---- Blue/Purple (trade.cfin.be) ---- */

.auth-theme-blue .auth-logo-icon {
    background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
    box-shadow: 0 4px 16px var(--accent-bg);
}

.auth-theme-blue .auth-logo-icon.auth-logo-lg {
    animation: authLogoGlowBlue 3s ease-in-out infinite;
}

.auth-theme-blue .auth-btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
}

.auth-theme-blue .auth-btn-primary:hover {
    box-shadow: 0 4px 16px var(--accent-bg);
}

.auth-theme-blue .auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.auth-theme-blue .auth-gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-theme-blue .auth-accent-border {
    border-color: var(--accent);
}

/* ---- Green/Blue (www.cfin.be) ---- */

.auth-theme-green .auth-logo-icon {
    background: linear-gradient(135deg, var(--profit) 0%, var(--accent) 100%);
    box-shadow: 0 8px 32px rgba(52, 199, 89, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.auth-theme-green .auth-logo-icon.auth-logo-lg {
    animation: authLogoGlow 3s ease-in-out infinite;
}

.auth-theme-green .auth-btn-primary {
    background: linear-gradient(135deg, var(--profit) 0%, var(--accent) 100%);
}

.auth-theme-green .auth-btn-primary:hover {
    box-shadow: 0 4px 16px var(--profit-bg);
}

.auth-theme-green .auth-input:focus {
    border-color: var(--profit);
    box-shadow: 0 0 0 3px var(--profit-bg);
}

.auth-theme-green .auth-gradient-text {
    background: linear-gradient(135deg, var(--profit) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-theme-green .auth-accent-border {
    border-color: var(--profit);
}

/* Glass Effect */
.auth-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* ============================================================================
   4. CONTAINER & CARD
   ============================================================================ */

.auth-container {
    width: 100%;
    position: relative;
    z-index: 2;
}

.auth-container.auth-narrow {
    max-width: 440px;
}

.auth-container.auth-medium {
    max-width: 520px;
}

.auth-container.auth-wide {
    max-width: 800px;
    margin: 0 auto;
}

/* Card (centered pages) */
.auth-card {
    border-radius: var(--radius-xl, 16px);
    padding: 40px;
    animation: authCardFadeIn 0.4s ease-out forwards;
}

.auth-card-centered {
    text-align: center;
}

/* Content wrapper (scrollable pages) */
.auth-content {
    position: relative;
    z-index: 1;
    padding: 40px 20px 60px;
}

/* ============================================================================
   5. LOGO COMPONENT
   ============================================================================ */

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg, 12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0 auto 16px;
    position: relative;
    /* gradient set by theme variant */
}

.auth-logo-icon.auth-logo-lg {
    width: 72px;
    height: 72px;
    font-size: 28px;
    border-radius: var(--radius-xl, 16px);
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 8px;
}

.auth-logo h1 sup {
    font-size: 10px;
    vertical-align: super;
    opacity: 0.6;
    font-weight: 400;
}

.auth-logo p,
.auth-logo .auth-subtitle {
    color: var(--text-sub);
    font-size: 14px;
    margin: 0;
}

/* ============================================================================
   6. TYPOGRAPHY
   ============================================================================ */

.auth-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    color: var(--text-main);
}

.auth-description {
    color: var(--text-sub);
    font-size: 14px;
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* ============================================================================
   7. FORM ELEMENTS
   ============================================================================ */

.auth-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.auth-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-sub);
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input, rgb(38, 38, 40));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius, 8px);
    color: var(--text-main);
    font-size: 15px;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-sizing: border-box;
}

.auth-input::placeholder {
    color: var(--text-dim);
}

.auth-input:focus {
    outline: none;
    /* border-color and box-shadow set by theme variant */
}

/* Input with icon prefix */
.auth-input-group {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.auth-input-group .auth-input {
    padding-left: 42px;
}

.auth-input-group:focus-within .auth-input-icon {
    color: var(--text-sub);
}

/* Password toggle */
.auth-password-wrapper {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dim);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.auth-password-toggle:hover {
    color: var(--text-sub);
}

.auth-password-wrapper .auth-input {
    padding-right: 44px;
}

/* ============================================================================
   8. BUTTONS
   ============================================================================ */

.auth-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius, 8px);
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
    /* background set by theme variant */
}

.auth-btn-primary:hover {
    transform: translateY(-1px);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-btn-primary:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Large button variant */
.auth-btn-primary.auth-btn-lg {
    padding: 16px 24px;
    font-size: 16px;
    border-radius: var(--radius-lg, 12px);
}

.auth-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--bg-hover, rgb(58, 58, 60));
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-btn-secondary:hover {
    background: var(--bg-main);
    border-color: var(--border-main, var(--border));
    transform: translateY(-1px);
}

.auth-btn-secondary:active {
    transform: translateY(0);
}

/* ============================================================================
   9. MESSAGES (SUCCESS / ERROR)
   ============================================================================ */

.auth-message {
    padding: 14px 16px;
    border-radius: var(--radius, 8px);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
}

.auth-message.show {
    display: block;
}

.auth-message.auth-success {
    background: var(--profit-bg, rgba(52, 199, 89, 0.15));
    border: 1px solid rgba(52, 199, 89, 0.3);
    color: var(--profit, #34c759);
}

.auth-message.auth-error {
    background: var(--loss-bg, rgba(255, 69, 58, 0.15));
    border: 1px solid rgba(255, 69, 58, 0.3);
    color: var(--loss, #ff453a);
}

.auth-message.auth-info {
    background: rgba(90, 200, 250, 0.15);
    border: 1px solid rgba(90, 200, 250, 0.3);
    color: var(--accent, #5ac8fa);
}

/* Always-visible error (for Jinja-rendered errors) */
.auth-message.auth-error-visible {
    display: block;
}

/* ============================================================================
   10. LINKS & NAVIGATION
   ============================================================================ */

.auth-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    color: var(--text-dim);
    font-size: 14px;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.auth-back-link:hover {
    color: var(--accent);
}

.auth-back-link svg {
    opacity: 0.7;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.auth-back-link:hover svg {
    opacity: 1;
    transform: translateX(-3px);
}

/* Top-left back link for scrollable pages */
.auth-back-link-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-sub);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 32px;
    padding: 8px 12px;
    border-radius: var(--radius-md, 8px);
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-back-link-top:hover {
    color: var(--text-main);
    background: var(--bg-hover, rgb(58, 58, 60));
}

.auth-back-link-top svg {
    width: 18px;
    height: 18px;
}

.auth-forgot-link {
    text-align: right;
    margin: -12px 0 20px;
}

.auth-forgot-link a {
    color: var(--text-dim);
    font-size: 13px;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.auth-forgot-link a:hover {
    color: var(--accent);
}

.auth-footer-note {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted, var(--text-sub));
    text-align: center;
}

.auth-footer-note a {
    color: var(--accent);
    text-decoration: none;
}

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

/* ============================================================================
   11. AUTH ACTIONS (register link, secondary actions)
   ============================================================================ */

.auth-actions {
    margin-top: 16px;
    text-align: center;
}

.auth-help-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    font-size: 13px;
}

.auth-help-section span {
    color: var(--text-dim);
}

.auth-help-section a {
    color: var(--accent);
    text-decoration: none;
    margin-left: 8px;
}

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

/* ============================================================================
   12. BUTTON LOADING STATE
   ============================================================================ */

.auth-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.auth-spinner {
    animation: authSpin 0.8s linear infinite;
}

.hidden {
    display: none !important;
}

/* ============================================================================
   13. PROGRESS BAR (shared across get-started, register, checkout, payment_success)
   ============================================================================ */

.auth-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
}

.auth-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-subtle);
    transition: color 0.3s, background-color 0.3s, border-color 0.3s, opacity 0.3s, transform 0.3s, box-shadow 0.3s;
}

.auth-progress-dot.active,
.auth-progress-dot.completed {
    box-shadow: 0 0 12px var(--profit-bg);
}

.auth-theme-green .auth-progress-dot.active,
.auth-theme-green .auth-progress-dot.completed {
    background: linear-gradient(135deg, var(--profit), var(--accent));
}

.auth-theme-blue .auth-progress-dot.active,
.auth-theme-blue .auth-progress-dot.completed {
    background: linear-gradient(135deg, var(--accent), var(--purple));
}

.auth-progress-line {
    width: 40px;
    height: 2px;
    background: var(--border-subtle);
}

.auth-theme-green .auth-progress-line.completed {
    background: linear-gradient(90deg, var(--profit), var(--accent));
}

.auth-theme-blue .auth-progress-line.completed {
    background: linear-gradient(90deg, var(--accent), var(--purple));
}

.auth-progress-label {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin-top: -24px;
    margin-bottom: 32px;
    color: var(--text-muted);
}

.auth-theme-green .auth-progress-label.completed {
    color: var(--profit);
}

.auth-theme-blue .auth-progress-label.completed {
    color: var(--accent);
}

@media (max-width: 640px) {
    .auth-progress-line {
        width: 24px;
    }
}

/* ============================================================================
   14. SUCCESS / STATUS ICONS (shared across payment_success, thankyou, email_verified)
   ============================================================================ */

.auth-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: authCelebrate 0.6s ease-out;
}

.auth-success-icon svg {
    width: 40px;
    height: 40px;
    color: white;
    animation: authCheckmark 0.5s ease-out 0.3s forwards;
    opacity: 0;
}

.auth-success-icon.pulse {
    animation: authSuccessPulse 2s ease-in-out infinite;
}

.auth-success-icon.pulse svg {
    animation: none;
    opacity: 1;
}

/* Green success variant (registration, payment) */
.auth-success-icon.success-green {
    background: linear-gradient(135deg, var(--profit) 0%, var(--profit-hover, rgb(47, 184, 102)) 100%);
    box-shadow: 0 8px 24px var(--profit-bg);
}

/* Blue/purple success variant (email verification) */
.auth-success-icon.success-blue {
    background: linear-gradient(135deg, var(--accent, #0A84FF) 0%, var(--purple, #5856D6) 50%, var(--purple-light, #BF5AF2) 100%);
    box-shadow: 0 8px 32px var(--accent-bg);
}

/* Error icon variant */
.auth-error-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--loss, #FF453A) 0%, #FF6961 100%);
    box-shadow: 0 8px 32px rgba(255, 69, 58, 0.4);
}

.auth-error-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

@media (max-width: 480px) {
    .auth-success-icon,
    .auth-error-icon {
        width: 64px;
        height: 64px;
    }
    .auth-success-icon svg,
    .auth-error-icon svg {
        width: 32px;
        height: 32px;
    }
}

/* ============================================================================
   15. COUNTDOWN SECTION (shared across thankyou, email_verified)
   ============================================================================ */

.auth-countdown {
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
    text-align: center;
}

.auth-theme-green .auth-countdown {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, rgba(90, 200, 250, 0.1) 100%);
}

.auth-theme-blue .auth-countdown {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.1) 0%, rgba(191, 90, 242, 0.1) 100%);
}

.auth-countdown-label {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.auth-countdown-timer {
    font-size: 28px;
    font-weight: 700;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-theme-green .auth-countdown-timer {
    background: linear-gradient(135deg, var(--profit) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.auth-theme-blue .auth-countdown-timer {
    background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ============================================================================
   16. ACTION BUTTONS LAYOUT (shared across success/thankyou pages)
   ============================================================================ */

.auth-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================================================
   17. UNIFIED ANIMATIONS
   ============================================================================ */

/* Card entrance */
@keyframes authCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Success icon celebrate bounce */
@keyframes authCelebrate {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Neutral icon entrance (for cancel/info pages) */
@keyframes authIconEntrance {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* Checkmark reveal */
@keyframes authCheckmark {
    0% { opacity: 0; transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Error input shake */
@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Section entrance (for multi-step forms) */
@keyframes authFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo shadow glow pulse (green theme) */
@keyframes authLogoGlow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(52, 199, 89, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    }
    50% {
        box-shadow: 0 8px 48px rgba(52, 199, 89, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    }
}

/* Logo shadow glow pulse (blue theme) */
@keyframes authLogoGlowBlue {
    0%, 100% {
        box-shadow: 0 4px 16px var(--accent-bg), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    }
    50% {
        box-shadow: 0 8px 32px rgba(10, 132, 255, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    }
}

/* Spin (for loading spinners and error page rings) */
@keyframes authSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes authSpinReverse {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* Pulse (for icons) */
@keyframes authPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

/* Blink (for status dots) */
@keyframes authBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Success icon pulse (for thankyou page) */
@keyframes authSuccessPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 24px var(--profit-bg); }
    50% { transform: scale(1.05); box-shadow: 0 12px 32px var(--profit-bg); }
}

/* Success icon pulse (blue variant - email_verified) */
@keyframes authSuccessPulseBlue {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 32px var(--accent-bg); }
    50% { transform: scale(1.05); box-shadow: 0 12px 40px var(--accent-bg); }
}

.auth-success-icon.success-blue.pulse {
    animation: authSuccessPulseBlue 2s ease-in-out infinite;
}

.auth-success-icon.success-blue.pulse svg {
    animation: none;
    opacity: 1;
}

/* ============================================================================
   18. ERROR PAGE COMPONENTS (migrated from error-pages.css)
   ============================================================================ */

/* Icon container with spinning rings */
.error-icon-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
    position: relative;
}

.error-ring-outer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
}

.error-ring-inner {
    position: absolute;
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
    border: 2px solid transparent;
    border-radius: 50%;
}

/* Ring animation variants */
.error-ring-outer.spin { animation: authSpin 2s linear infinite; }
.error-ring-inner.spin-reverse { animation: authSpinReverse 1.5s linear infinite; }
.error-ring-outer.dashed { border-style: dashed; opacity: 0.4; }
.error-ring-inner.dashed { border-style: dashed; opacity: 0.25; }

/* Ring color classes */
.error-ring-red { border-top-color: var(--loss); }
.error-ring-red-bottom { border-bottom-color: var(--accent); }
.error-ring-purple { border-color: var(--purple); }
.error-ring-accent { border-color: var(--accent); }
.error-ring-orange { border-color: var(--orange); }

/* Center icon */
.error-icon-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    background: var(--bg-panel-dark, rgb(58, 58, 60));
    border-radius: var(--radius-lg, 12px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-icon-center svg {
    width: 28px;
    height: 28px;
}

.error-icon-center svg.pulse {
    animation: authPulse 2s ease-in-out infinite;
}

/* Icon fill colors */
.error-icon-fill-red { fill: var(--loss); }
.error-icon-fill-purple { fill: var(--purple); }
.error-icon-fill-accent { fill: var(--accent); }
.error-icon-fill-orange { fill: var(--orange); }

/* Error code badge */
.error-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.error-code-badge.badge-red { background: var(--loss-bg); }
.error-code-badge.badge-purple { background: var(--purple-bg); }
.error-code-badge.badge-orange { background: var(--orange-bg); }
.error-code-badge.badge-accent { background: var(--accent-bg); }

.error-code {
    font-family: "SF Mono", Monaco, monospace;
    font-size: 15px;
    font-weight: 600;
}

.error-code.code-red { color: var(--loss); }
.error-code.code-purple { color: var(--purple); }
.error-code.code-orange { color: var(--orange); }
.error-code.code-accent { color: var(--accent); }

.error-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: authBlink 1.5s ease-in-out infinite;
}

.error-status-dot.dot-red { background: var(--loss); }
.error-status-dot.dot-purple { background: var(--purple); }
.error-status-dot.dot-orange { background: var(--orange); }

.error-status-text {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.error-status-text.text-red { color: var(--loss); }
.error-status-text.text-purple { color: var(--purple); }
.error-status-text.text-orange { color: var(--orange); }

/* Error content */
.error-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
}

.error-message-text {
    font-size: 15px;
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 28px;
}

/* Error page buttons */
.error-btn-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.error-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius, 8px);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.error-btn-primary:hover {
    background: var(--accent-hover, rgb(30, 150, 255));
    transform: translateY(-1px);
}

.error-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-panel-dark, rgb(58, 58, 60));
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    padding: 12px 24px;
    border-radius: var(--radius, 8px);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.error-btn-secondary:hover {
    background: var(--bg-panel);
    border-color: var(--accent);
}

/* Suggestions */
.error-suggestions {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.error-suggestions-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.error-suggestion-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-panel-dark, rgb(58, 58, 60));
    border-radius: var(--radius, 8px);
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    margin-bottom: 10px;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.error-suggestion-link:hover {
    transform: translateX(4px);
    background: var(--bg-selected, rgb(72, 72, 74));
}

.error-suggestion-link svg {
    width: 18px;
    height: 18px;
    fill: var(--accent);
    flex-shrink: 0;
}

/* Auto-retry section */
.error-auto-retry {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.error-retry-text {
    font-size: 13px;
    color: var(--text-dim);
}

.error-retry-countdown {
    font-family: "SF Mono", Monaco, monospace;
    font-weight: 600;
    color: var(--loss);
}

.error-retry-progress {
    width: 100%;
    height: 3px;
    background: var(--bg-panel-dark, rgb(58, 58, 60));
    border-radius: var(--radius-xs);
    margin-top: 12px;
    overflow: hidden;
}

.error-retry-bar {
    height: 100%;
    background: var(--loss);
    border-radius: var(--radius-xs);
    transition: width 1s linear;
}

/* Footer brand */
.error-footer-brand {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 12px;
    z-index: 1;
}

.error-footer-brand svg {
    width: 16px;
    height: 16px;
}

.error-footer-brand svg.fill-red { fill: var(--loss); }
.error-footer-brand svg.fill-purple { fill: var(--purple); }
.error-footer-brand svg.fill-accent { fill: var(--accent); }
.error-footer-brand svg.fill-orange { fill: var(--orange); }

/* ============================================================================
   19. LIGHT MODE OVERRIDES
   ============================================================================ */

:root.light .auth-input {
    background: var(--bg-input, rgb(242, 242, 247));
}

:root.light .error-icon-center {
    background: var(--bg-panel-dark, rgb(229, 229, 234));
}

:root.light .error-suggestion-link {
    background: var(--bg-panel-dark, rgb(229, 229, 234));
}

:root.light .error-btn-secondary {
    background: var(--bg-panel-dark, rgb(229, 229, 234));
}

/* ============================================================================
   20. RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .auth-card {
        padding: 32px 24px;
    }

    .auth-logo-icon.auth-logo-lg {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }

    .auth-content {
        padding: 32px 16px 48px;
    }

    .error-icon-container {
        width: 100px;
        height: 100px;
    }

    .error-icon-center {
        width: 44px;
        height: 44px;
    }

    .error-icon-center svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .auth-page.auth-centered {
        padding: 20px 16px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .auth-logo h1 {
        font-size: 20px;
    }

    .auth-title {
        font-size: 18px;
    }

    .auth-btn-primary {
        padding: 12px;
    }

    .error-title {
        font-size: 22px;
    }

    .error-btn-group {
        flex-direction: column;
    }

    .error-footer-brand {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        justify-content: center;
        margin-top: 32px;
    }
}

/* ============================================================================
   21. REDUCED MOTION
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .auth-card {
        animation: none !important;
    }

    .auth-logo-icon {
        animation: none !important;
    }

    .auth-success-icon,
    .auth-success-icon svg,
    .auth-error-icon {
        animation: none !important;
        opacity: 1;
    }

    .error-ring-outer,
    .error-ring-inner,
    .error-icon-center svg,
    .error-status-dot {
        animation: none !important;
    }

    /* Page-specific animated elements */
    .step-card,
    .form-section,
    .checklist-section,
    .cancel-icon,
    .processing-spinner,
    .checkout-spinner {
        animation: none !important;
        opacity: 1;
        transform: none;
    }

    .error-retry-bar {
        animation: none !important;
        transition: none !important;
    }

    .auth-btn-primary,
    .auth-btn-secondary,
    .auth-back-link svg,
    .error-suggestion-link,
    .step-card,
    .form-section,
    .step,
    .info-card,
    .btn-continue,
    .btn-referral,
    .auth-btn-social {
        transition: none !important;
    }
}

/* ============================================================================
   22. SOCIAL LOGIN BUTTONS
   ============================================================================ */

.auth-social-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

.auth-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    border-radius: var(--radius-md, 8px);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-subtle);
}

.auth-btn-social:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-btn-social:active {
    transform: translateY(0);
}

.auth-btn-social svg {
    flex-shrink: 0;
}

.auth-btn-google {
    background: #fff;
    color: #3c4043;
    border-color: #dadce0;
}

.auth-btn-google:hover {
    background: #f8f9fa;
    border-color: #d2d5d9;
}

.auth-btn-apple {
    background: #000;
    color: #fff;
    border-color: #000;
}

.auth-btn-apple:hover {
    background: #1a1a1a;
}
