/* ============================================================
   auth.css — styles partagés des pages Connexion / Inscription
   ============================================================ */

/* ── Layout : masquer sidebar / topbar / footer ── */
.footer-modern,
#back-to-top,
.back-to-top,
.whatsapp-float { display: none !important; }

#sidebar:not(.open),
.sidebar-modern:not(.open) { display: none !important; }
.sidebar-overlay:not(.active) { display: none !important; }

.main-content-with-sidebar {
    margin-left: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    width: 100vw !important;
    max-width: 100vw !important;
}

/* ── Design tokens (valeurs par défaut = page Connexion)
   La page Inscription surcharge via :root dans un <style> inline ── */
:root {
    --auth-primary:      #4F46E5;
    --auth-primary-dark: #4338CA;
    --auth-primary-rgb:  79, 70, 229;
    --auth-surface:      #FFFFFF;
    --auth-bg:           #F1F5F9;
    --auth-border:       #E2E8F0;
    --auth-text:         #0F172A;
    --auth-muted:        #64748B;
    --auth-subtle:       #94A3B8;
    --auth-radius-sm:    10px;
    --auth-radius:       14px;
    --auth-radius-lg:    20px;

    /* Tokens layout (surchargés par l'inscription) */
    --auth-cols:          1fr 1fr;
    --auth-card-max:      448px;
    --auth-input-h:       50px;
    --auth-input-pl:      1rem;
    --auth-field-mb:      1.25rem;
    --auth-card-hdr-mb:   2rem;
}

/* ── Écran global ── */
.auth-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--auth-cols);
    font-family: 'Inter', sans-serif;
    background: var(--auth-bg);
}

/* ============================================================
   Panneau gauche — marque
   ============================================================ */
.auth-brand {
    background: linear-gradient(150deg, #312E81 0%, #4F46E5 45%, #7C3AED 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3.5rem;
    overflow: hidden;
}

.auth-brand-blob { position: absolute; border-radius: 50%; pointer-events: none; }
.auth-brand-blob-1 { width: 420px; height: 420px; top: -160px; right: -120px; background: rgba(255,255,255,0.06); }
.auth-brand-blob-2 { width: 300px; height: 300px; bottom: -100px; left: -80px;  background: rgba(255,255,255,0.05); }
.auth-brand-blob-3 { width: 180px; height: 180px; top: 42%;    left: 60%;       background: rgba(255,255,255,0.04); }

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.auth-brand-top  { position: relative; z-index: 2; }
.auth-brand-bottom { position: relative; z-index: 2; }

.auth-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3.5rem;
}

.auth-brand-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-2xl); color: white;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.auth-brand-name { font-size: var(--fs-2xl-plus); font-weight: 800; color: white; letter-spacing: -0.035em; }

.auth-brand-headline {
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 800; color: white;
    line-height: 1.15; letter-spacing: -0.04em;
    margin-bottom: 1.25rem;
}
.auth-brand-headline em { font-style: normal; color: rgba(255,255,255,0.5); }

.auth-brand-sub {
    font-size: var(--fs-base); color: rgba(255,255,255,0.72);
    line-height: 1.7; max-width: 360px; margin-bottom: 2.75rem;
}

.auth-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.auth-features li { display: flex; align-items: center; gap: 1rem; font-size: var(--fs-base); font-weight: 500; color: rgba(255,255,255,0.9); }

.auth-feature-dot {
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: var(--fs-sm); color: rgba(255,255,255,0.9);
}

.auth-stats {
    display: flex;
    margin-top: 3rem;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 1.75rem;
}
.auth-stat { flex: 1; padding-right: 1.5rem; border-right: 1px solid rgba(255,255,255,0.12); }
.auth-stat:last-child { padding-right: 0; padding-left: 1.5rem; border-right: none; }
.auth-stat:not(:first-child):not(:last-child) { padding-left: 1.5rem; }

.auth-stat-value { font-size: var(--fs-2xl); font-weight: 800; color: white; letter-spacing: -0.03em; line-height: 1; margin-bottom: 0.25rem; }
.auth-stat-label { font-size: var(--fs-xs); color: rgba(255,255,255,0.55); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

/* ============================================================
   Panneau droit — formulaire
   ============================================================ */
.auth-panel {
    background: var(--auth-bg);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 2.5rem 2rem;
    overflow-y: auto;
}

.auth-card {
    width: 100%;
    max-width: var(--auth-card-max);
    background: var(--auth-surface);
    border-radius: var(--auth-radius-lg);
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.05),
        0 8px 24px rgba(0,0,0,0.06),
        0 32px 64px rgba(0,0,0,0.04);
    padding: 2.5rem;
    animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── En-tête de carte ── */
.auth-card-header { margin-bottom: var(--auth-card-hdr-mb); }

.auth-back {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: var(--fs-sm); font-weight: 500;
    color: var(--auth-muted); text-decoration: none;
    margin-bottom: 1.5rem; transition: color 0.2s;
}
.auth-back:hover         { color: var(--auth-primary); }
.auth-back i             { font-size: var(--fs-xs); transition: transform 0.2s; }
.auth-back:hover i       { transform: translateX(-3px); }

.auth-card-title { font-size: var(--fs-2xl-plus); font-weight: 800; color: var(--auth-text); letter-spacing: -0.035em; line-height: 1.15; margin-bottom: 0.375rem; }
.auth-card-sub   { font-size: var(--fs-base); color: var(--auth-muted); line-height: 1.5; margin: 0; }

/* ── Alertes ── */
.auth-alert {
    border-radius: var(--auth-radius-sm);
    padding: 0.875rem 1rem; margin-bottom: 1.25rem;
    display: flex; gap: 0.75rem; align-items: flex-start;
    font-size: var(--fs-sm); line-height: 1.5;
    border: 1px solid transparent;
}
.auth-alert-icon  { font-size: var(--fs-base); flex-shrink: 0; margin-top: 1px; }
.auth-alert-body  { flex: 1; }
.auth-alert-title { font-weight: 600; margin-bottom: 0.2rem; }
.auth-alert.is-error   { background: #FFF1F2; border-color: #FECDD3; color: #BE123C; }
.auth-alert.is-success { background: #F0FDF4; border-color: #BBF7D0; color: #15803D; }
.auth-alert.is-info    { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }
.auth-alert.is-warning { background: #FFFBEB; border-color: #FDE68A; color: #B45309; }

/* ── Champs ── */
.auth-field { margin-bottom: var(--auth-field-mb); }

.auth-label { display: block; font-size: var(--fs-sm); font-weight: 600; color: #334155; margin-bottom: 0.5rem; letter-spacing: 0.01em; }
.auth-label .required-star { color: #F43F5E; margin-left: 2px; }

.auth-input-wrap { position: relative; }

.auth-input-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--auth-subtle); font-size: var(--fs-sm);
    pointer-events: none; transition: color 0.2s; z-index: 1;
}

.auth-input {
    width: 100%;
    height: var(--auth-input-h);
    padding: 0 1rem 0 var(--auth-input-pl);
    background: #F8FAFC;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    font-size: var(--fs-base); color: var(--auth-text);
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none; appearance: none;
}
.auth-input::placeholder { color: var(--auth-subtle); }
.auth-input:focus {
    outline: none; background: #FFFFFF;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3.5px rgba(var(--auth-primary-rgb), 0.12);
}
.auth-input-wrap:focus-within .auth-input-icon { color: var(--auth-primary); }
.auth-input.is-invalid { border-color: #F43F5E; box-shadow: 0 0 0 3.5px rgba(244,63,94,0.1); }
.auth-input.is-valid   { border-color: #10B981; box-shadow: 0 0 0 3.5px rgba(16,185,129,0.1); }
.auth-input.has-toggle { padding-right: 3rem; }

/* Toggle mot de passe */
.auth-pwd-toggle {
    position: absolute; right: 0.875rem; top: 50%; transform: translateY(-50%);
    background: transparent; border: none; cursor: pointer;
    color: var(--auth-subtle); padding: 0.3rem;
    line-height: 1; font-size: var(--fs-sm); transition: color 0.2s; z-index: 2;
}
.auth-pwd-toggle:hover { color: var(--auth-primary); }
.auth-pwd-toggle:focus { outline: none; color: var(--auth-primary); }

/* Messages de champ */
.auth-field-msg { font-size: var(--fs-xs); margin-top: 0.375rem; display: flex; align-items: center; gap: 0.3rem; }
.auth-field-msg.is-error { color: #F43F5E; }
.auth-field-msg.is-hint  { color: var(--auth-subtle); }

/* ── Connexion : options Se souvenir / Mot de passe oublié ── */
.auth-options {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.75rem; flex-wrap: wrap; gap: 0.5rem;
}
.auth-checkbox-label {
    align-items: center; gap: 0.5rem;
    cursor: pointer; user-select: none;
    font-size: var(--fs-sm); color: #475569; font-weight: 500;
}
.auth-checkbox-label input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--auth-primary); cursor: pointer; flex-shrink: 0; }
.auth-forgot { font-size: var(--fs-sm); color: var(--auth-primary); font-weight: 600; text-decoration: none; transition: color 0.2s; }
.auth-forgot:hover { color: var(--auth-primary-dark); text-decoration: underline; }

/* ── Inscription : grille 2 colonnes ── */
.auth-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Inscription : force du mot de passe ── */
.auth-strength { margin-top: 0.5rem; padding: 0.5rem 0.75rem; background: #F1F5F9; border-radius: 8px; display: none; }
.auth-strength.visible { display: block; }
.auth-strength-bar { height: 3px; background: #E2E8F0; border-radius: 2px; overflow: hidden; margin-bottom: 0.3rem; }
.auth-strength-fill { height: 100%; width: 0; border-radius: 2px; transition: all 0.35s ease; }
.auth-strength-fill.weak   { width: 25%;  background: #F43F5E; }
.auth-strength-fill.fair   { width: 50%;  background: #F59E0B; }
.auth-strength-fill.good   { width: 75%;  background: #3B82F6; }
.auth-strength-fill.strong { width: 100%; background: #10B981; }
.auth-strength-row   { display: flex; justify-content: space-between; align-items: center; }
.auth-strength-label { font-size: var(--fs-xs); color: #64748B; }
.auth-strength-value { font-size: var(--fs-xs); font-weight: 700; }
.auth-strength-value.weak   { color: #F43F5E; }
.auth-strength-value.fair   { color: #F59E0B; }
.auth-strength-value.good   { color: #3B82F6; }
.auth-strength-value.strong { color: #10B981; }

/* ── Inscription : CGU ── */
.auth-terms {
    align-items: flex-start; gap: 0.75rem;
    margin-bottom: 1.25rem; padding: 0.875rem 1rem;
    background: white; border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
}
.auth-terms-checkbox { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; accent-color: var(--auth-primary); cursor: pointer; }
.auth-terms-label { font-size: var(--fs-sm); color: #475569; line-height: 1.5; cursor: pointer; }
.auth-terms-label a { color: var(--auth-primary); font-weight: 600; text-decoration: none; }
.auth-terms-label a:hover { text-decoration: underline; }

/* ── Bouton de soumission ── */
.auth-btn {
    width: 100%; height: 52px;
    background: linear-gradient(135deg, #4F46E5, #6366F1);
    color: white; border: none;
    border-radius: var(--auth-radius-sm);
    font-size: var(--fs-base); font-weight: 700;
    font-family: 'Inter', sans-serif; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    letter-spacing: -0.01em;
    transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
    box-shadow: 0 4px 16px rgba(var(--auth-primary-rgb), 0.38);
    position: relative; overflow: hidden;
    margin-bottom: 1.5rem; text-decoration: none;
}
.auth-btn::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    pointer-events: none;
}
.auth-btn:hover    { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(var(--auth-primary-rgb), 0.48); color: white; }
.auth-btn:active   { transform: translateY(0); }
.auth-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: 0 2px 8px rgba(var(--auth-primary-rgb), 0.2); }

/* ── Séparateur ── */
.auth-divider { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; color: var(--auth-subtle); font-size: var(--fs-sm); font-weight: 500; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--auth-border); }

/* ── Boutons sociaux ── */
.auth-social { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.75rem; }
.auth-social-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    height: 48px; border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    background: white; color: #334155;
    font-size: var(--fs-sm); font-weight: 600;
    font-family: 'Inter', sans-serif; text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
    cursor: pointer;
}
.auth-social-btn:hover { background: #F8FAFC; border-color: #CBD5E1; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.07); color: var(--auth-text); }
.auth-social-btn .fa-google     { color: #EA4335; }
.auth-social-btn .fa-facebook-f { color: #1877F2; }

/* ── Pied de carte ── */
.auth-card-footer { text-align: center; font-size: var(--fs-sm); color: var(--auth-muted); padding-top: 1.25rem; border-top: 1px solid var(--auth-border); }
.auth-card-footer a { color: var(--auth-primary); font-weight: 700; text-decoration: none; transition: color 0.2s; }
.auth-card-footer a:hover { color: var(--auth-primary-dark); text-decoration: underline; }

/* ── Logo mobile ── */
.auth-mobile-logo { display: none; align-items: center; justify-content: center; gap: 0.625rem; margin-bottom: 1.75rem; text-decoration: none; }
.auth-mobile-logo-icon { width: 42px; height: 42px; background: linear-gradient(135deg, #4F46E5, #7C3AED); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-size: var(--fs-lg); }
.auth-mobile-logo-name { font-size: var(--fs-2xl); font-weight: 800; color: var(--auth-text); letter-spacing: -0.035em; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
    .auth-screen { grid-template-columns: 1fr; }
    .auth-brand  { display: none; }
    .auth-panel  { min-height: 100vh; padding: 2rem 1.25rem; justify-content: flex-start; padding-top: 2.5rem; }
    .auth-card   { max-width: 100%; }
    .auth-mobile-logo { display: flex; }
    .auth-back   { margin-bottom: 1.25rem; }
}

@media (max-width: 560px) {
    .auth-panel  { padding: 1.5rem 1rem 2rem; }
    .auth-card   { padding: 1.75rem 1.25rem; border-radius: var(--auth-radius); box-shadow: 0 2px 16px rgba(0,0,0,0.06); }
    .auth-card-title { font-size: var(--fs-2xl); }
    .auth-social { grid-template-columns: 1fr; }
    .auth-options { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .auth-form-row { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (prefers-contrast: high) {
    .auth-input { border-color: #000; border-width: 2px; }
    .auth-label { color: #000; }
}
