/**
 * Auth — mode sombre (V2, legacy, PIN, états compte).
 * Chargé après gx-app-bg.css + gx-dark.css.
 */

[data-theme="dark"] .gxa-body,
[data-theme="dark"] body.auth-body {
    color: var(--gx-text, #e8edf5);
}

/* ——— Auth V2 (gxa-*) ——— */
[data-theme="dark"] .gxa-card,
[data-theme="dark"] .gxa-google,
[data-theme="dark"] .gxa-card.gx-glass {
    background: var(--gx-glass-fallback, rgba(19, 28, 43, 0.9)) !important;
    background-color: var(--gx-glass-fallback, rgba(19, 28, 43, 0.9)) !important;
    border-color: var(--gx-border, #263247) !important;
    box-shadow: var(--gx-glass-shadow, 0 14px 36px rgba(0, 0, 0, 0.4)) !important;
    color: var(--gx-text, #e8edf5);
}

[data-theme="dark"] .gxa-top__brand,
[data-theme="dark"] .gxa-back.gx-glass,
[data-theme="dark"] .gxa-back {
    background: var(--gx-card-group, #1b2638) !important;
    border-color: var(--gx-border, #263247) !important;
    color: var(--gx-text, #e8edf5) !important;
}

[data-theme="dark"] .gxa-top__brand b {
    color: var(--gx-accent, #f97316);
}

[data-theme="dark"] .gxa-title,
[data-theme="dark"] .gxa-label,
[data-theme="dark"] .gxa-sub strong,
[data-theme="dark"] .gxa-help-title,
[data-theme="dark"] .gxa-channel-note strong,
[data-theme="dark"] .gxa-action,
[data-theme="dark"] .gxa-foot a,
[data-theme="dark"] .gxa-link {
    color: var(--gx-text, #e8edf5);
}

[data-theme="dark"] .gxa-sub,
[data-theme="dark"] .gxa-hint,
[data-theme="dark"] .gxa-or,
[data-theme="dark"] .gxa-channel-note span,
[data-theme="dark"] .gxa-foot,
[data-theme="dark"] .gxa-opt {
    color: var(--gx-text-muted, #94a3b8);
}

[data-theme="dark"] .gxa-tabs {
    background: rgba(27, 38, 56, 0.75) !important;
    border-color: var(--gx-border, #263247) !important;
}

[data-theme="dark"] .gxa-tab {
    color: var(--gx-text-muted, #94a3b8);
}

[data-theme="dark"] .gxa-tab.is-active {
    background: var(--gx-card-group, #243044) !important;
    color: var(--gx-text, #e8edf5) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}

[data-theme="dark"] .gxa-google {
    background: var(--gx-card-group, #1b2638) !important;
    border-color: var(--gx-border, #263247) !important;
    color: var(--gx-text, #e8edf5) !important;
}

[data-theme="dark"] .gxa-input,
[data-theme="dark"] .gxa-phone,
[data-theme="dark"] .gxa-otp-box {
    background: var(--gx-card-group, #1b2638) !important;
    border-color: var(--gx-border, #263247) !important;
    color: var(--gx-text, #e8edf5) !important;
}

[data-theme="dark"] .gxa-input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .gxa-flag {
    background: rgba(249, 115, 22, 0.12) !important;
    border-right-color: rgba(249, 115, 22, 0.2) !important;
    color: #fdba74 !important;
}

[data-theme="dark"] .gxa-phone input {
    color: var(--gx-text, #e8edf5);
}

[data-theme="dark"] .gxa-otp-box.is-filled {
    background: rgba(249, 115, 22, 0.12) !important;
    border-color: rgba(249, 115, 22, 0.4) !important;
}

[data-theme="dark"] .gxa-hero__flame {
    background: linear-gradient(145deg, rgba(249, 115, 22, 0.18), rgba(27, 38, 56, 0.9)) !important;
}

[data-theme="dark"] .gxa-hero__badge {
    background: rgba(249, 115, 22, 0.14);
    border-color: rgba(249, 115, 22, 0.28);
    color: #fdba74;
}

[data-theme="dark"] .gxa-or::before,
[data-theme="dark"] .gxa-or::after {
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.25), transparent);
}

[data-theme="dark"] .gxa-channel-note {
    background: rgba(22, 163, 74, 0.12) !important;
    border-color: rgba(22, 163, 74, 0.28) !important;
}

[data-theme="dark"] .gxa-devcode {
    background: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    color: #fcd34d;
}

[data-theme="dark"] .gxa-action {
    border-bottom-color: var(--gx-border, #263247);
}

[data-theme="dark"] .gxa-action:hover {
    color: var(--gx-accent, #f97316);
}

[data-theme="dark"] .gxa-alert--error {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .gxa-alert--success {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.3);
    color: #86efac;
}

[data-theme="dark"] .auth-toast {
    background: var(--gx-surface, #131c2b);
    color: var(--gx-text, #e8edf5);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .auth-toast__body {
    color: var(--gx-text, #e8edf5);
}

/* ——— Legacy auth (auth-common / auth-layout) ——— */
[data-theme="dark"] .auth-card,
[data-theme="dark"] .auth-form-slot .auth-card {
    background: var(--gx-surface, #131c2b) !important;
    color: var(--gx-text, #e8edf5);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45) !important;
}

@media (max-width: 767px) {
    [data-theme="dark"] .auth-form-slot {
        background: var(--gx-surface, #131c2b) !important;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45) !important;
    }
}

[data-theme="dark"] .auth-card-header h1,
[data-theme="dark"] .auth-title-mobile,
[data-theme="dark"] .auth-title-desktop {
    color: var(--gx-text, #e8edf5) !important;
}

[data-theme="dark"] .auth-card-header p,
[data-theme="dark"] .auth-footer,
[data-theme="dark"] .auth-footer a,
[data-theme="dark"] .auth-privacy p {
    color: var(--gx-text-muted, #94a3b8);
}

[data-theme="dark"] .auth-field label {
    color: #cbd5e1;
}

[data-theme="dark"] .auth-input-wrap input,
[data-theme="dark"] .auth-phone-row input,
[data-theme="dark"] .auth-select,
[data-theme="dark"] .auth-otp-input {
    background: var(--gx-card-group, #1b2638) !important;
    border-color: var(--gx-border, #263247) !important;
    color: var(--gx-text, #e8edf5) !important;
}

[data-theme="dark"] .auth-input-wrap input:focus,
[data-theme="dark"] .auth-phone-row input:focus {
    border-color: rgba(249, 115, 22, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15) !important;
}

[data-theme="dark"] .auth-phone-prefix {
    background: rgba(249, 115, 22, 0.12) !important;
    border-color: var(--gx-border, #263247) !important;
    color: #fdba74 !important;
}

[data-theme="dark"] .auth-tabs {
    background: var(--gx-card-group, #1b2638);
    border-color: var(--gx-border, #263247);
}

[data-theme="dark"] .auth-tab.is-active {
    background: var(--gx-surface, #243044);
    color: var(--gx-text, #e8edf5);
}

[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after {
    background: var(--gx-border, #263247);
}

[data-theme="dark"] .auth-alert--error {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .auth-alert--success {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.3);
    color: #86efac;
}

[data-theme="dark"] .auth-alert--warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

[data-theme="dark"] .auth-alert--info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* ——— PIN V2 ——— */
[data-theme="dark"] html.gx-pin-v2,
[data-theme="dark"] body.gx-pin-v2 {
    background: transparent !important;
    color: var(--gx-text, #e8edf5);
}

[data-theme="dark"] .gx-pin-v2__brand {
    color: var(--gx-text, #e8edf5);
}

[data-theme="dark"] .gx-pin-v2__card {
    background: var(--gx-glass-fallback, rgba(19, 28, 43, 0.92)) !important;
    border: 1px solid var(--gx-border, #263247);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="dark"] .gx-pin-v2__title,
[data-theme="dark"] .gx-pin-v2__fields label,
[data-theme="dark"] .gx-pin-v2__checklist strong {
    color: var(--gx-text, #e8edf5);
}

[data-theme="dark"] .gx-pin-v2__lead,
[data-theme="dark"] .gx-pin-v2__checklist li {
    color: var(--gx-text-muted, #94a3b8);
}

[data-theme="dark"] .gx-pin-v2__icon,
[data-theme="dark"] .gx-pin-v2__pill {
    background: rgba(249, 115, 22, 0.14) !important;
    color: #fdba74;
}

[data-theme="dark"] .gx-pin-v2__digits input,
[data-theme="dark"] .gx-pin-v2__fields input {
    background: var(--gx-card-group, #1b2638) !important;
    border-color: var(--gx-border, #263247) !important;
    color: var(--gx-text, #e8edf5) !important;
}

[data-theme="dark"] .gx-pin-v2__checklist li {
    background: var(--gx-card-group, #1b2638) !important;
}

[data-theme="dark"] .gx-pin-v2__foot a,
[data-theme="dark"] .gx-pin-v2__link {
    color: #93c5fd;
}

[data-theme="dark"] .gx-pin-v2__alert {
    background: rgba(220, 38, 38, 0.12);
    color: #fca5a5;
}

/* ——— États compte (suspendu, etc.) ——— */
[data-theme="dark"] .gx-state-card {
    background: var(--gx-surface, #131c2b) !important;
    border-color: var(--gx-border, #263247) !important;
    color: var(--gx-text, #e8edf5);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="dark"] .gx-state-card h1,
[data-theme="dark"] .gx-state-balance strong {
    color: var(--gx-text, #e8edf5);
}

[data-theme="dark"] .gx-state-lead,
[data-theme="dark"] .gx-state-balance span,
[data-theme="dark"] .gx-state-checklist li {
    color: var(--gx-text-muted, #94a3b8);
}

[data-theme="dark"] .gx-state-balance {
    background: var(--gx-card-group, #1b2638);
    border-color: var(--gx-border, #263247);
}

[data-theme="dark"] .gx-state-checklist li {
    background: var(--gx-card-group, #1b2638);
}
