/* ── ESB Team Manager — écrans de connexion (Account/*) ─────────────── */

.esb-auth[data-theme="dark"] {
    --bg: #0F0C22;
    --surface: #1A1638;
    --surface-2: #211B45;
    --primary: #9B59E8;
    --primary-dark: #7640C0;
    --primary-light: #B890F0;
    --text: #F0EBFF;
    --text-2: #A090C0;
    --text-3: #7E6C9C;
    --divider: rgba(155,89,232,0.20);
    --tint: rgba(155,89,232,0.10);
    --secondary: #E0A030;
    --success: #66BB6A;
    --error: #EF5350;
    --shadow-2: 0 3px 10px rgba(0,0,0,0.18);
}

.esb-auth[data-theme="light"] {
    --bg: #F4F1F8;
    --surface: #FFFFFF;
    --surface-2: #FAF8FD;
    --primary: #5C2A8A;
    --primary-dark: #2D1068;
    --primary-light: #7C4CB8;
    --text: #1A0D36;
    --text-2: #6B537A;
    --text-3: #8E7C9C;
    --divider: rgba(92,42,138,0.14);
    --tint: rgba(92,42,138,0.07);
    --secondary: #C4881A;
    --success: #2E7D32;
    --error: #C62828;
    --shadow-2: 0 3px 10px rgba(45,16,104,0.14);
}

.esb-auth {
    min-height: 100vh;
    width: 100%;
    display: flex;
    font-family: Manrope, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
}

.esb-auth .disp {
    font-family: 'Barlow Condensed', Roboto, sans-serif;
    margin: 0;
}

.esb-auth a { color: var(--primary-light); text-decoration: none; }
.esb-auth a:hover { color: var(--text); }

/* ── Panneau de marque (desktop) ─────────────────────────────────── */

.auth-brand {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 60px;
    box-sizing: border-box;
    color: #fff;
    background: linear-gradient(150deg,#1A0B3A 0%,#2D1068 42%,#5C2A8A 100%);
}

.auth-brand-header { display: flex; align-items: center; gap: 14px; }
.auth-brand-logo { width: 52px; height: 52px; object-fit: contain; }
.auth-brand-name { font-weight: 800; font-size: 2rem; color: #fff; letter-spacing: 0.05em; line-height: 1; }
.auth-brand-sub { font-size: 0.62rem; color: rgba(255,255,255,0.62); letter-spacing: 0.16em; text-transform: uppercase; margin-top: 3px; }

.auth-brand-tagline { font-weight: 800; font-size: 54px; color: #fff; letter-spacing: -1px; line-height: 1.02; text-wrap: pretty; max-width: 480px; }
.auth-brand-desc { font-size: 14.5px; color: rgba(255,255,255,0.70); margin-top: 14px; line-height: 1.6; text-wrap: pretty; max-width: 480px; }

.auth-brand-stats { display: flex; gap: 30px; margin-top: 32px; }
.auth-brand-stat-value { font-weight: 800; font-size: 34px; color: #E0A030; line-height: 1; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.auth-brand-stat-label { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin-top: 6px; }

.auth-brand-footer { font-size: 11.5px; color: rgba(255,255,255,0.42); }

/* ── Panneau de formulaire ────────────────────────────────────────── */

.auth-formpane {
    flex: none;
    width: 520px;
    max-width: 100%;
    background: var(--bg);
    color: var(--text);
    display: flex;
    align-items: center;
    padding: 40px 56px;
    box-sizing: border-box;
    box-shadow: -12px 0 40px rgba(0,0,0,0.34);
    position: relative;
}

.auth-formpane-inner { width: 100%; }

.auth-mobile-header { display: none; }

.auth-theme-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-theme-btn:hover { background: var(--tint); }
.auth-theme-btn svg { width: 18px; height: 18px; }
.esb-auth[data-theme="dark"] .auth-theme-btn .icon-sun { display: none; }
.esb-auth[data-theme="light"] .auth-theme-btn .icon-moon { display: none; }

/* ── Carte ────────────────────────────────────────────────────────── */

.auth-card-title { font-weight: 800; font-size: 32px; letter-spacing: -0.5px; line-height: 1.1; }
.auth-card-intro { font-size: 13px; color: var(--text-2); margin-top: 8px; line-height: 1.55; text-wrap: pretty; }

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 13px;
    animation: auth-slide-down 0.18s ease;
}
.auth-alert svg { flex: none; margin-top: 1px; width: 17px; height: 17px; }
.auth-alert-text { flex: 1; font-size: 12.5px; font-weight: 600; line-height: 1.45; text-wrap: pretty; }
.auth-alert--error { background: rgba(239,83,80,0.10); border: 1px solid rgba(239,83,80,0.45); }
.auth-alert--error .auth-alert-text { color: var(--error); }
.auth-alert--warning { background: rgba(224,160,48,0.10); border: 1px solid rgba(224,160,48,0.45); }
.auth-alert--warning .auth-alert-text { color: var(--secondary); }
.auth-alert--success { background: rgba(102,187,106,0.10); border: 1px solid rgba(102,187,106,0.42); }
.auth-alert--success .auth-alert-text { color: var(--success); }
.auth-alert-title { display: block; font-size: 13.5px; font-weight: 700; }
.auth-alert-note { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 5px; line-height: 1.55; text-wrap: pretty; font-weight: 400; }

@keyframes auth-slide-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Champs ───────────────────────────────────────────────────────── */

.auth-fields { display: flex; flex-direction: column; gap: 11px; margin-top: 20px; }
.auth-fields--grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }

.auth-field-wrap {
    border-radius: 13px;
    padding: 11px 13px;
    box-sizing: border-box;
    background: var(--surface-2);
    border: 1px solid var(--divider);
}
.auth-field-wrap:has(.auth-input:focus) { border-color: var(--primary); }
.auth-field-wrap:has(.auth-input:not(:placeholder-shown)) { background: var(--tint); border-color: var(--primary); }
.auth-field-wrap:has(.auth-input.invalid) { background: rgba(239,83,80,0.06); border-color: var(--error); }

.auth-field-label {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
}

.auth-input {
    width: 100%;
    margin-top: 5px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    padding: 0;
    box-sizing: border-box;
    font-family: Manrope, sans-serif;
}
.auth-input::placeholder { color: var(--text-3); }
.auth-input[type="password"] { letter-spacing: 0.1em; }

.auth-field-error { font-size: 10.5px; color: var(--error); margin-top: 4px; font-weight: 600; }

/* ── Case à cocher « Rester connecté » ───────────────────────────── */

.auth-remember {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    cursor: pointer;
    width: fit-content;
}
.auth-remember-native {
    position: absolute;
    opacity: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
}
.auth-remember-box {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 12px;
    font-weight: 700;
}
.auth-remember-native:checked + .auth-remember-box {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.auth-remember-box::after { content: "\2713"; }
.auth-remember-label { font-size: 12.5px; color: var(--text-2); }

.auth-row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.auth-row-between .auth-remember { margin-top: 0; }

.auth-link-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--primary-light);
    font-family: Manrope, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 0;
}
.auth-link-btn:hover { color: var(--text); }

.auth-link-center { display: flex; justify-content: center; margin-top: 14px; }

/* ── Boutons ──────────────────────────────────────────────────────── */

.auth-btn-primary {
    width: 100%;
    min-height: 48px;
    margin-top: 20px;
    border-radius: 14px;
    border: none;
    font-family: Manrope, sans-serif;
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-2);
}
.auth-card:has(.auth-fields input:invalid) .auth-btn-primary,
.auth-btn-primary:disabled,
.auth-btn-primary.auth-btn-primary--disabled {
    cursor: not-allowed;
    background: var(--surface-2);
    color: var(--text-3);
    border: 1px solid var(--divider);
    box-shadow: none;
}

.auth-btn-ghost {
    width: 100%;
    min-height: 44px;
    margin-top: 11px;
    border-radius: 14px;
    background: transparent;
    border: 1px solid var(--divider);
    cursor: pointer;
    color: var(--text-2);
    font-family: Manrope, sans-serif;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}
.auth-btn-ghost:hover { background: var(--tint); color: var(--text-2); }

/* ── Solidité du mot de passe ─────────────────────────────────────── */

.auth-strength-row { display: flex; align-items: center; gap: 8px; margin-top: 15px; }
.auth-strength-heading { flex: 1; font-size: 0.58rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); }
.auth-strength-label { flex: none; font-size: 11.5px; font-weight: 700; color: var(--text-3); }
.auth-strength-bars { display: flex; gap: 4px; margin-top: 8px; }
.auth-strength-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--tint); }

.auth-rules { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px 12px; margin-top: 12px; }
.auth-rule { display: flex; align-items: center; gap: 7px; }
.auth-rule-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.auth-rule-label { font-size: 11.5px; color: var(--text-3); }
.auth-rule--ok .auth-rule-dot { background: var(--success); }
.auth-rule--ok .auth-rule-label { color: var(--text-2); font-weight: 600; }

/* ── Pied de carte ────────────────────────────────────────────────── */

.auth-footnote {
    font-size: 11.5px;
    color: var(--text-3);
    margin-top: 24px;
    line-height: 1.55;
    text-wrap: pretty;
    border-top: 1px solid var(--divider);
    padding-top: 16px;
}

/* Habillage des alertes Bootstrap par défaut (StatusMessage) quand elles
   apparaissent dans le contexte de connexion, sans toucher au composant
   partagé utilisé aussi par les pages Manage/* restées hors de ce lot. */
.esb-auth .alert {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 13px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.45;
}
.esb-auth .alert-danger { background: rgba(239,83,80,0.10); border: 1px solid rgba(239,83,80,0.45); color: var(--error); }
.esb-auth .alert-success { background: rgba(102,187,106,0.10); border: 1px solid rgba(102,187,106,0.42); color: var(--success); }

/* ── Écrans d'état simple (Lockout, AccessDenied, InvalidUser…) ──── */

.auth-status-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}
.auth-status-icon svg { width: 26px; height: 26px; }
.auth-status-icon--error { background: rgba(239,83,80,0.12); color: var(--error); }
.auth-status-icon--warning { background: rgba(224,160,48,0.12); color: var(--secondary); }

/* ── Responsive (mobile < 900px) ──────────────────────────────────── */

@media (max-width: 900px) {
    .esb-auth {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: linear-gradient(165deg,#1A0B3A 0%,#2D1068 38%,#5C2A8A 100%);
        padding: 44px 18px;
    }
    .auth-brand { display: none; }
    .auth-mobile-header { display: block; flex: none; text-align: center; margin-bottom: 24px; }
    .auth-mobile-logo { width: 64px; height: 64px; object-fit: contain; }
    .auth-mobile-title { font-weight: 800; font-size: 27px; color: #fff; letter-spacing: 0.04em; margin-top: 12px; line-height: 1; }
    .auth-mobile-sub { font-size: 12px; color: rgba(255,255,255,0.62); margin-top: 5px; }

    .auth-formpane {
        width: 100%;
        max-width: 420px;
        box-shadow: 0 18px 48px rgba(0,0,0,0.42);
        border: 1px solid var(--divider);
        border-radius: 18px;
        background: var(--surface);
        padding: 20px 18px;
    }
    .auth-theme-btn { top: -60px; right: 0; color: rgba(255,255,255,0.8); }
    .auth-theme-btn:hover { background: rgba(255,255,255,0.12); }

    .auth-card-title { font-size: 22px; letter-spacing: -0.25px; line-height: 1.15; }
    .auth-fields--grid { grid-template-columns: 1fr; }
    .auth-rules { grid-template-columns: 1fr; }
    .auth-btn-primary { min-height: 50px; margin-top: 16px; font-size: 15px; }
    .auth-footnote { text-align: center; }
}
