/* Drive To Safe — feuille de style du site de préinscription */
:root {
  --indigo: #352474;
  --indigo-fonce: #1d1442;
  --violet: #6a57d6;
  --fond: #ffffff;
  --fond-teinte: #f4f2fb;
  --texte: #1c1a2b;
  --texte-doux: #5a5870;
  --trait: #e2def2;
  --vert: #1f9d55;
  --orange: #e8890c;
  --rouge: #d92d20;
  --rayon: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--texte);
  background: var(--fond);
}
img { max-width: 100%; height: auto; }
a { color: var(--indigo); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; color: var(--indigo-fonce); letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.conteneur { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.etroit { max-width: 780px; }

/* En-tête */
.entete { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--trait); }
.entete-ligne { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.logo img { display: block; width: 190px; }
.menu { display: flex; gap: 22px; margin-left: auto; }
.menu a { text-decoration: none; color: var(--texte); font-size: .95rem; font-weight: 500; }
.menu a:hover { color: var(--violet); }

/* Boutons */
.bouton {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  background: linear-gradient(180deg, var(--violet), var(--indigo)); color: #fff;
  font: inherit; font-weight: 700; padding: 14px 26px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(53,36,116,.28); transition: transform .15s, box-shadow .15s;
}
.bouton:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(53,36,116,.34); }
.bouton:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #b9aef5; outline-offset: 2px; }
.bouton-petit { padding: 9px 18px; font-size: .92rem; box-shadow: none; }
.bouton-large { width: 100%; padding: 16px; font-size: 1.05rem; }
.bouton[disabled] { opacity: .6; cursor: wait; }
.lien-fleche { font-weight: 600; text-decoration: none; }
.lien-fleche::after { content: " →"; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--fond-teinte), #fff); padding: 64px 0 72px; }
.hero-grille { display: block; max-width: 820px; text-align: center; margin-bottom: 36px; }
.hero-grille .chapo { margin-left: auto; margin-right: auto; }
.hero-grille .hero-actions { justify-content: center; }
.animation { max-width: 980px; margin: 0 auto; background: #fff; border-radius: 22px; padding: 14px; box-shadow: 0 24px 60px rgba(29,20,66,.18); }
.animation svg { display: block; width: 100%; height: auto; }
.centre { text-align: center; margin-top: 14px; }
.surtitre { color: var(--violet); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .82rem; margin-bottom: 14px; }
.chapo { font-size: 1.15rem; color: var(--texte-doux); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin: 26px 0 14px; }
.note { font-size: .9rem; color: var(--texte-doux); }

/* Démonstration animée */
.demo { display: flex; justify-content: center; }
.ecran { width: 100%; max-width: 330px; background: var(--indigo-fonce); border-radius: 28px; padding: 14px; box-shadow: 0 24px 60px rgba(29,20,66,.35); }
.ecran-barre { display: flex; justify-content: center; padding: 2px 0 10px; }
.ecran-barre span { width: 70px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); }
.ecran-carte { position: relative; height: 300px; border-radius: 18px; overflow: hidden; background: #e9edf3; }
.route { position: absolute; background: #c9d0dc; }
.route-h { left: 0; right: 0; top: 50%; height: 46px; transform: translateY(-50%); }
.route-v { top: 0; bottom: 0; left: 50%; width: 46px; transform: translateX(-50%); }
.voiture, .deux-roues { position: absolute; border-radius: 6px; }
.voiture { width: 22px; height: 36px; left: calc(50% - 11px); bottom: 14px; background: var(--indigo); animation: avance-voiture 6s linear infinite; }
.deux-roues { width: 22px; height: 10px; top: calc(50% - 5px); left: -30px; background: var(--rouge); border-radius: 5px; animation: avance-moto 6s linear infinite; }
.alerte { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: #fff; }
.pastille { flex: none; width: 22px; height: 22px; border-radius: 50%; animation: couleur 6s linear infinite; }
.alerte-texte { position: relative; flex: 1; height: 1.4em; font-size: .98rem; color: var(--indigo-fonce); }
.t { position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; animation: 6s linear infinite; }
.t1 { animation-name: texte1; } .t2 { animation-name: texte2; } .t3 { animation-name: texte3; }

@keyframes avance-moto { 0% { left: -30px; } 80% { left: calc(50% - 40px); } 100% { left: calc(50% - 40px); } }
@keyframes avance-voiture { 0% { bottom: 14px; } 80% { bottom: calc(50% - 76px); } 100% { bottom: calc(50% - 76px); } }
@keyframes couleur {
  0%, 30% { background: var(--vert); box-shadow: 0 0 0 0 rgba(31,157,85,.4); }
  36%, 62% { background: var(--orange); box-shadow: 0 0 0 6px rgba(232,137,12,.22); }
  68%, 100% { background: var(--rouge); box-shadow: 0 0 0 10px rgba(217,45,32,.22); }
}
@keyframes texte1 { 0%, 30% { opacity: 1; } 34%, 100% { opacity: 0; } }
@keyframes texte2 { 0%, 32% { opacity: 0; } 36%, 62% { opacity: 1; } 66%, 100% { opacity: 0; } }
@keyframes texte3 { 0%, 64% { opacity: 0; } 68%, 100% { opacity: 1; } }

/* Sections */
.section { padding: 72px 0; }
.section-teintee { background: var(--fond-teinte); }
.intro { font-size: 1.1rem; color: var(--texte-doux); max-width: 44em; margin-bottom: 36px; }

.chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.chiffre { border: 1px solid var(--trait); border-radius: var(--rayon); padding: 26px; background: #fff; }
.chiffre strong { display: block; font-size: 2.3rem; line-height: 1.1; color: var(--indigo); margin-bottom: 10px; }
.chiffre span { display: block; }
.chiffre small { display: block; margin-top: 12px; color: var(--texte-doux); font-size: .82rem; }

.etapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.etapes li { background: #fff; border-radius: var(--rayon); padding: 26px; border: 1px solid var(--trait); }
.numero { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--indigo); color: #fff; font-weight: 700; margin-bottom: 14px; }
.etapes p { margin: 0; color: var(--texte-doux); }

.niveaux { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.niveau { display: flex; gap: 14px; align-items: flex-start; background: #fff; border-radius: var(--rayon); padding: 18px 20px; border: 1px solid var(--trait); font-size: .97rem; }
.niveau span { flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 4px; }
.niveau b { display: block; }
.vert span { background: var(--vert); } .orange span { background: var(--orange); } .rouge span { background: var(--rouge); }

.cartes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.carte { border: 1px solid var(--trait); border-top: 4px solid var(--violet); border-radius: var(--rayon); padding: 24px; background: #fff; }
.carte p { margin: 0; color: var(--texte-doux); font-size: .97rem; }

.histoire { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.histoire p { font-size: 1.15rem; }
.signature { font-size: .95rem !important; color: var(--texte-doux); }
.engagements { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.engagements li { background: #fff; border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px 20px; }

/* Inscription */
.section-inscription { background: linear-gradient(160deg, var(--indigo), var(--indigo-fonce)); color: #fff; }
.section-inscription h2 { color: #fff; }
.section-inscription p { color: rgba(255,255,255,.86); font-size: 1.08rem; }
.inscription-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.formulaire { background: #fff; color: var(--texte); border-radius: 20px; padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.champ { margin-bottom: 16px; }
.champ label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 6px; }
.facultatif { font-weight: 400; color: var(--texte-doux); }
.champ input, .champ select { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #cfc9e6; border-radius: 10px; background: #fff; color: var(--texte); }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consentement { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--texte-doux); margin-bottom: 18px; }
.consentement input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.message { margin: 14px 0 0; min-height: 1.4em; font-weight: 600; font-size: .98rem !important; }
.message.ok { color: var(--vert) !important; }
.message.erreur { color: var(--rouge) !important; }

/* Questions */
details { border-bottom: 1px solid var(--trait); padding: 16px 0; }
summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; color: var(--indigo-fonce); }
details p { margin: 12px 0 0; color: var(--texte-doux); }

/* Pied de page */
.pied { background: var(--indigo-fonce); color: rgba(255,255,255,.8); padding: 28px 0; font-size: .92rem; }
.pied a { color: #fff; }
.pied p { margin: 0; }
.pied-ligne { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* Page de texte (mentions légales) */
.page-texte { padding: 56px 0 72px; }
.page-texte h1 { font-size: 2rem; }
.page-texte h2 { font-size: 1.3rem; margin-top: 1.8em; }

/* Mobile */
@media (max-width: 900px) {
  .menu { display: none; }
  .entete-ligne { justify-content: space-between; }
  .logo img { width: 150px; }
  .hero { padding: 40px 0 48px; }
  .hero-grille, .histoire, .inscription-grille { grid-template-columns: 1fr; gap: 32px; }
  .chiffres, .etapes, .niveaux { grid-template-columns: 1fr; }
  .cartes { grid-template-columns: 1fr 1fr; }
  .section { padding: 52px 0; }
}
@media (max-width: 520px) {
  .cartes { grid-template-columns: 1fr; }
  .bouton-petit { padding: 8px 14px; font-size: .85rem; }
  .formulaire { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .voiture, .deux-roues, .pastille, .t { animation: none; }
  .pastille { background: var(--orange); }
  .t2 { opacity: 1; }
  .deux-roues { left: 22%; }
}
