/* Thème clair de Car Protect Mobile.
   Règle impérative du fond blanc, ALSA Consulting, 19 septembre 2026 : fond blanc ou ivoire
   très clair, texte sombre, sur la vitrine comme sur les écrans clients.

   Ce fichier se charge en dernier dans la tête de chaque page : il redéfinit les jetons de
   couleur du site, puis corrige les endroits où une couleur claire était écrite en dur pour
   un fond noir. Le blanc reste du blanc partout où il se pose sur un aplat de couleur :
   bouton rouge, bouton WhatsApp vert, pastille d'accent.
   Retirer la ligne qui appelle ce fichier suffit à revenir au thème sombre. */

:root {
  --bg-deep: #ffffff;
  --bg-dark: #f7f8fa;
  --bg-card: #ffffff;
  --bg-surface: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --glass-border: rgba(15, 23, 42, 0.12);
  --accent: #E20512;            /* le rouge de la marque, absent des jetons de certaines pages */
  --success: #047857;
  --gold: #a16207;
}

html, body { background: var(--bg-deep); color: var(--text-primary); }

/* ---- Surfaces qui étaient sombres ---- */
header, .navbar, nav.navbar, footer, .section-dark, .bg-dark, .glass, .card, .feature-card,
.pricing-card, .step-card, .faq-item, .product-card, .testimonial-card, .stat-card {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

header, .navbar, nav.navbar {
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

footer { border-top: 1px solid var(--glass-border); background: var(--bg-dark); }

/* ---- Texte qui était clair sur fond noir ---- */
.nav-links a, .footer-col a, .footer-legal, .footer-legal a, .contact-row a,
.hours-table td, .hero p, .lead, p, li, dd, dt { color: var(--text-secondary); }

h1, h2, h3, h4, h5, h6, .hero-badge b, .alert-strip p b, .hours-table td:last-child,
.footer-col h4, .stat-number { color: var(--text-primary); }

.nav-links a:hover, .footer-col a:hover, .footer-legal a:hover, .contact-row a:hover {
  color: var(--accent);
}

.burger { color: var(--text-primary); }

/* ---- Boutons fantômes : ils empruntaient un voile blanc sur fond noir ---- */
.btn-ghost, .btn-secondary, .btn-call, .hero-actions .btn:not(.btn-primary) {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--glass-border) !important;
}
.btn-ghost:hover, .btn-secondary:hover, .btn-call:hover {
  background: #e2e8f0 !important;
}

/* ---- Ce qui garde du blanc : le texte posé sur un aplat de couleur ---- */
.btn-primary, .btn-whatsapp, .footer-social a:hover, .badge-accent, .cta-button,
.btn-devis, .nav-cta {
  color: #ffffff !important;
}

/* ---- Voiles blancs devenus invisibles sur fond blanc ---- */
.hero-badge, .alert-strip, .stat-item, .trust-bar {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
}

/* ---- Champs de saisie : le texte blanc en dur devenait illisible sur un téléphone clair ---- */
input, select, textarea {
  background: #ffffff !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--glass-border) !important;
}
input::placeholder, textarea::placeholder { color: var(--text-muted) !important; }

/* ---- Lisibilité : contraste du texte secondaire sur fond clair ---- */
::selection { background: rgba(226, 5, 18, 0.14); color: var(--text-primary); }

/* ---- Confort de lecture et accessibilité ---- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Héros : le voile était noir pour porter du texte blanc, il devient blanc ----
   Le texte se lit à gauche, la voiture reste visible à droite. */
.hero-vignette {
  background: linear-gradient(to right, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.78) 42%, rgba(255,255,255,0.10) 100%),
              linear-gradient(to top, var(--bg-deep) 0%, transparent 28%) !important;
}
.hero-fallback { opacity: 0.08 !important; }
.hero-eyebrow { background: rgba(161, 98, 7, 0.10) !important; border-color: rgba(161, 98, 7, 0.32) !important; }

/* Les légendes de photos restent blanches : elles se posent sur un dégradé sombre au-dessus de l'image. */
.gallery-item figcaption { color: #ffffff !important; }

/* ---- Barre de navigation : la classe est .nav, et son état au défilement était noir ---- */
.nav { background: transparent; }
.nav.scrolled {
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.10) !important;
  border-bottom: 1px solid var(--glass-border);
}
.nav-links a { color: var(--text-secondary); }
.nav-links a:hover { color: var(--accent) !important; }
.burger, .nav-logo span { color: var(--text-primary) !important; }

/* ---- Contraste mesuré : tout passe le seuil AA de 4,5 pour 1 ---- */
:root {
  --text-muted: #556070;      /* 4,34 pour 1 avant, insuffisant sur gris très clair */
  --accent-hover: #c40410;    /* le rouge vif ne passait pas en texte sur blanc */
}
.section-eyebrow { color: #0b6bb8 !important; }   /* bleu assombri pour un usage en texte */
.badge-top { color: #c40410 !important; }

/* Le bandeau « depuis 1994 » gardait un fond noir au milieu d'une page blanche. */
.since {
  background: var(--bg-surface) !important;
  border: 1px solid var(--glass-border);
  color: var(--text-primary) !important;
}
.since * { color: var(--text-primary) !important; }

/* La bande professionnels portait du texte blanc, invisible une fois le fond éclairci. */
.pro-band { background: var(--bg-surface) !important; }
.pro-band p, .pro-band b, .pro-band strong, .pro-band li { color: var(--text-primary) !important; }

/* ---- Simulateur : en-tête et bandeau des assureurs ---- */
.main-header {
  background: var(--bg-card) !important;
  border-bottom: 1px solid var(--glass-border) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.main-header a, .main-header span, .main-header h1, .main-header div { color: var(--text-primary) !important; }
.main-header .btn, .main-header .btn-primary, .main-header [class*="btn"] { color: #ffffff !important; }

.marquee-logo-item { color: var(--text-secondary) !important; }
.marquee-logo-item i { color: var(--success) !important; }
.marquee-logo-item.incert-badge {
  color: #0b6bb8 !important;
  background: rgba(9, 132, 227, 0.10) !important;
  border-color: rgba(9, 132, 227, 0.35) !important;
}

/* Pied de page : les paragraphes sans classe gardaient du blanc. */
footer p, footer span, footer li, footer small, footer div { color: var(--text-secondary); }
footer a { color: var(--text-secondary); }
footer a:hover { color: var(--accent); }
footer h1, footer h2, footer h3, footer h4 { color: var(--text-primary); }

/* ---- Écrans secondaires : textes restés dans l'échelle de gris du thème sombre ----
   Mesurés un par un dans le navigateur, puis corrigés à leur emplacement exact. */

/* Téléphone dans la barre de navigation (flottes, camping-car, incert) */
.nav-tel, .nav-tel span, .nav-tel i { color: var(--text-primary) !important; }

/* Cartes de contenu et d'identification (mentions légales, espace partenaire) */
.card { background: var(--bg-card) !important; border: 1px solid var(--glass-border); }
.card p, .card li, .card label, .card small { color: var(--text-secondary) !important; }
.card b, .card strong, .card h1, .card h2, .card h3, .card h4 { color: var(--text-primary) !important; }
.card .btn, .card button[type="submit"] { background: var(--accent) !important; color: #ffffff !important; }

/* Espace client : écran d'erreur quand le lien n'a pas de référence */
.print-hidden h1, .print-hidden h2, .print-hidden h3 { color: var(--text-primary) !important; }
.print-hidden p, .print-hidden span, .print-hidden li { color: var(--text-secondary) !important; }

/* Espace poseur : surfaces et textes */
main.container p, main.container h1, main.container h2, main.container h3 { color: var(--text-primary) !important; }
main.container p { color: var(--text-secondary) !important; }

/* Barre du constat, restée sombre */
.viewer-nav { background: var(--bg-card) !important; border-bottom: 1px solid var(--glass-border) !important; }
.viewer-nav a, .viewer-nav span, .viewer-nav button { color: var(--text-primary) !important; }

/* ---- CRM : il porte son propre jeu de jetons dans crm.css, on les redéfinit ---- */
:root {
  --bg-sidebar: #f1f5f9;      /* la colonne passe au clair : la règle ne prévoit pas d exception pour les portails */
  --bg-main: #f7f8fa;
  --bg-input: #ffffff;
  --color-text: #0f172a;
  --color-text-muted: #556070;
  --color-border: rgba(15, 23, 42, 0.12);
  --color-success: #047857;
}
.crm-main, .crm-content, main.crm, .content-area { background: var(--bg-main) !important; color: var(--color-text) !important; }
table, thead, tbody, tr { color: var(--color-text); }
th { color: var(--color-text) !important; background: var(--bg-surface) !important; }
td { color: var(--text-secondary) !important; }
/* La colonne de gauche passe au clair, son texte redevient sombre. */
aside.sidebar, .sidebar { background: var(--bg-sidebar) !important; border-right: 1px solid var(--glass-border); }
.sidebar a, .sidebar span, .sidebar li, .sidebar p, .sidebar h1, .sidebar h2, .sidebar small,
.sidebar .nav-item, .sidebar i { color: var(--text-secondary) !important; }
.sidebar a:hover, .sidebar .nav-item.active, .sidebar .nav-item.active i { color: var(--accent) !important; }
.sidebar .nav-item.active { background: #ffffff !important; }

/* ---- Derniers points mesurés ---- */
footer p, footer small { color: var(--text-secondary) !important; }
.card .btn, .card button[type="submit"], form .btn-primary {
  background: var(--accent) !important; color: #ffffff !important; border-color: var(--accent) !important;
}
main.container p, .login-sub, .hint { color: var(--text-secondary) !important; }

/* ---- Écrans de connexion : ils gardaient un fond sombre plein écran ---- */
#poseur-login-overlay, #login-overlay, #crm-login-overlay, .login-overlay {
  background: var(--bg-dark) !important;
}
#poseur-login-overlay > div, #login-overlay > div, #crm-login-overlay > div, .login-overlay > div {
  background: #ffffff !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.10) !important;
}
#poseur-login-overlay label, #login-overlay label, #crm-login-overlay label, .login-overlay label,
#poseur-login-overlay p, #login-overlay p, #crm-login-overlay p, .login-overlay p {
  color: var(--text-secondary) !important;
}
#poseur-login-overlay h1, #login-overlay h1, #crm-login-overlay h1, .login-overlay h1,
#poseur-login-overlay h2, #login-overlay h2, #crm-login-overlay h2, .login-overlay h2 {
  color: var(--text-primary) !important;
}

/* ---- Espace client : les cartes du tableau de bord sont posées par le script ---- */
.dash-card, #action-panel, .timeline-container, .doc-btn, .vehicle-photo-container,
.dash-opt-row, .dash-section, .payment-card, .status-card {
  background: #ffffff !important;
  border: 1px solid var(--glass-border) !important;
  color: var(--text-primary) !important;
}
.vehicle-photo-container { background: var(--bg-surface) !important; }
.dash-card *, #action-panel *, .timeline-container *, .dash-opt-row * { color: var(--text-primary); }
.dash-card span, .dash-card p, .dash-opt-row span, .timeline-container span, .timeline-container p {
  color: var(--text-secondary) !important;
}
.dash-card strong, .dash-card b, .dash-card h1, .dash-card h2, .dash-card h3, .dash-card h4,
#action-panel h1, #action-panel h2, #action-panel h3, .dash-opt-row strong {
  color: var(--text-primary) !important;
}
.doc-btn { color: var(--text-primary) !important; }
.doc-btn:hover { background: var(--bg-surface) !important; }
/* Les montants restent lisibles et le total garde l'accent de la marque. */
.dash-card .montant, .dash-total, #dash-price-ttc { color: var(--text-primary) !important; }

/* ---- Téléphone : le voile horizontal ne protège plus le texte, il devient vertical ---- */
@media (max-width: 820px) {
  .hero-vignette {
    background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.88) 62%, rgba(255,255,255,0.35) 100%),
                linear-gradient(to top, var(--bg-deep) 0%, transparent 22%) !important;
  }
}

/* ---- Affichage avant la bascule du domaine (30/11/2026) ---- */

/* En-tête : les entrées ne tiennent pas sur une ligne sous 1320 px, le menu passe en panneau. */
.nav .nav-inner { max-width: 1320px; }
#nav-links { gap: 16px; }
#nav-links a { white-space: nowrap; }
@media (max-width: 1319px) {
  #nav-links {
    position: fixed; top: 0; right: -320px; height: 100vh; width: 290px; max-width: 86vw;
    flex-direction: column; align-items: flex-start; justify-content: flex-start;
    padding: 90px 30px 30px; gap: 20px; overflow-y: auto; visibility: hidden;
    background: #ffffff; border-left: 1px solid var(--glass-border);
    transition: right var(--dur-standard) var(--ease-out), visibility var(--dur-standard);
  }
  #nav-links.open { right: 0; visibility: visible; box-shadow: -16px 0 40px rgba(15, 23, 42, 0.16); }
  .nav .burger { display: block; position: relative; z-index: 110; min-width: 44px; min-height: 44px; }
}

/* Barre d'appel du téléphone : elle restait noire sur une page blanche. */
.mobile-cta { background: rgba(255, 255, 255, 0.96) !important; box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.10); }
.mobile-cta .m-tel { background: var(--bg-surface) !important; color: var(--text-primary) !important; }
.mobile-cta .m-devis { color: #ffffff !important; }

/* Formulaire du guide : sa largeur minimale élargissait toute la page sur téléphone. */
@media (max-width: 960px) {
  .guide-wrap { flex-direction: column; align-items: stretch; }
  #form-guide { min-width: 0 !important; width: 100%; }
}

/* Simulateur : le défilé des assureurs et le bandeau de confiance dépassaient de l'écran. */
.insurance-marquee-box { width: 100%; max-width: 1000px; min-width: 0; margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; box-sizing: border-box; overflow: hidden; }
.insurance-marquee-title { flex-wrap: wrap; }
.marquee-wrapper { max-width: 100%; }
@media (max-width: 768px) {
  .trust-banner { flex-wrap: wrap; justify-content: center; row-gap: 8px; }
}

/* Chiffres de l'accueil : du texte collé au bord de sa case, et l'année affichée en petit. */
.hero-badges .hero-badge { padding: 10px 14px; border-radius: 10px; }
.hero-badge b .count { font: inherit; color: inherit; }
