:root {
  --orange: #f77f00;
  --orange-dark: #d96a00;
  --green: #009a44;
  --green-dark: #00723a;
  --ink: #1b1b1b;
  --bg: #fafaf7;
  --bg-alt: #f2f2ec;
  --card-bg: #ffffff;
  --border: #e5e5e0;
  --text-muted: #5a5a55;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: var(--green-dark);
}

img {
  max-width: 100%;
}

/* ---------- Nav ---------- */

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: 0.3px;
  text-decoration: none;
  color: var(--ink);
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

nav.mainnav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

nav.mainnav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

nav.mainnav a:hover {
  color: var(--orange);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  padding: 56px 24px 24px;
  text-align: center;
}

.hero img.logo {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  margin-bottom: 22px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.hero h1 {
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 900;
  margin: 0 auto 16px;
  max-width: 760px;
  color: var(--ink);
}

.hero p.tagline {
  font-size: clamp(15px, 2.5vw, 19px);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  white-space: pre-line;
}

.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.button.primary {
  background: var(--orange);
  color: white;
}

.button.secondary {
  background: white;
  color: var(--green-dark);
  border: 1.5px solid var(--green);
}

.button.on-dark {
  background: var(--orange);
  color: white;
}

/* Scene devant laquelle le bus SVG traverse le hero : un arret avec des
   passagers qui attendent (point d'interrogation), fixe, puis le bus qui
   passe en boucle. */
.bus-lane {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  height: 84px;
  overflow: hidden;
  pointer-events: none;
}

.bus-lane .road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  height: 2px;
  background: var(--border);
}

.bus-lane .bus-stop {
  position: absolute;
  right: 4px;
  bottom: 14px;
  width: 90px;
  height: 84px;
}

.bus-lane svg.bus {
  position: absolute;
  bottom: 14px;
  width: 130px;
  height: 56px;
  animation: drive-across 9s linear infinite;
}

@keyframes drive-across {
  from { left: -160px; }
  to { left: 110%; }
}

/* Les passagers sont impatients tant que le bus n'est pas arrive, puis
   heureux au moment ou il arrive - meme duree/timing-function que
   drive-across pour rester synchronise sans JavaScript. */
.mood-wait {
  animation: mood-wait-cycle 9s linear infinite;
}

.mood-happy {
  opacity: 0;
  animation: mood-happy-cycle 9s linear infinite;
}

@keyframes mood-wait-cycle {
  0%, 72% { opacity: 1; }
  80%, 100% { opacity: 0; }
}

@keyframes mood-happy-cycle {
  0%, 72% { opacity: 0; transform: translateY(0) scale(1); }
  78% { opacity: 1; transform: translateY(-5px) scale(1.05); }
  86% { opacity: 1; transform: translateY(0) scale(1); }
  92% { opacity: 1; transform: translateY(-4px) scale(1.04); }
  98%, 100% { opacity: 0; transform: translateY(0) scale(1); }
}

/* Petit balancement d'impatience pendant l'attente, independant du cycle
   du bus. */
.bob-1 {
  animation: impatient-bob 1.1s ease-in-out infinite;
  transform-origin: 16px 70px;
}

.bob-2 {
  animation: impatient-bob 1.3s ease-in-out infinite 0.3s;
  transform-origin: 70px 70px;
}

@keyframes impatient-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(-3deg); }
}

@media (prefers-reduced-motion: reduce) {
  .bus-lane svg.bus {
    animation: none;
    left: calc(100% - 150px);
  }
  .mood-wait, .mood-happy, .bob-1, .bob-2 {
    animation: none;
  }
  .mood-wait {
    opacity: 1;
  }
  .mood-happy {
    opacity: 0;
  }
}

/* ---------- Sections generiques ---------- */

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 56px 0;
}

section.alt-bg {
  background: var(--bg-alt);
}

.section-title {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 900;
  text-align: center;
  margin: 0 0 40px;
}

.full-bleed {
  width: 100%;
  background: var(--bg-alt);
}

.full-bleed > .inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 24px;
}

.full-bleed.accent {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ---------- Etapes "comment ca marche" ---------- */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.step-card {
  background: white;
  border-radius: 18px;
  padding: 28px 22px;
  box-shadow: 0 6px 24px rgba(0, 114, 58, 0.1);
  text-align: center;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange);
  color: white;
  font-weight: 800;
  margin-bottom: 14px;
}

.step-card svg {
  display: block;
  margin: 0 auto 14px;
  width: 64px;
  height: 64px;
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.step-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Stats ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  text-align: center;
}

.stat-number {
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 900;
  color: var(--orange);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.stat-card.in-view .stat-number {
  opacity: 1;
  transform: translateY(0);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ---------- Roles (comment ca marche detail) ---------- */

.role-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  margin-bottom: 20px;
}

.role-card h3 {
  margin-top: 0;
}

/* ---------- Filtres anti-fraude ---------- */

.filter-card {
  border-left: 4px solid var(--green);
  background: var(--bg-alt);
  border-radius: 0 14px 14px 0;
  padding: 18px 22px;
  margin-bottom: 16px;
}

.filter-card h4 {
  margin: 0 0 6px;
  color: var(--green-dark);
}

.filter-card p {
  margin: 0;
}

/* ---------- FAQ accordion ---------- */

.faq-category {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green-dark);
  font-weight: 800;
  margin: 36px 0 14px;
}

.faq-category:first-of-type {
  margin-top: 0;
}

details.faq-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 20px;
  margin-bottom: 10px;
}

details.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--orange);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

details.faq-item[open] summary::after {
  content: "\2212";
}

details.faq-item p {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 14.5px;
}

/* ---------- Table (politique) ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13.5px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-weight: 700;
  background: var(--bg-alt);
}

/* ---------- Politique / bandeau ---------- */

.policy-banner {
  background: var(--green-dark);
  color: white;
  padding: 40px 24px;
  text-align: center;
}

.policy-banner h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 5vw, 32px);
}

.policy-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

.toc {
  background: var(--bg-alt);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 28px 0;
}

.toc h2 {
  font-size: 15px;
  margin: 0 0 10px;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  font-size: 13.5px;
}

.notice {
  background: #fff8ec;
  border: 1px solid #f2d9a8;
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 14px;
  margin-bottom: 32px;
}

h2 {
  font-size: 21px;
  margin-top: 42px;
  margin-bottom: 12px;
  color: var(--ink);
}

h3 {
  font-size: 16.5px;
  margin-top: 24px;
  margin-bottom: 8px;
}

p, li {
  font-size: 15px;
  color: #2c2c2a;
}

ul, ol {
  padding-left: 22px;
}

/* ---------- Commitments list (a-propos) ---------- */

.commitments {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.commitments li {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  font-weight: 600;
  font-size: 14.5px;
}

.commitments li::before {
  content: "\2713";
  color: var(--green);
  font-weight: 900;
  margin-right: 8px;
}

/* ---------- Contact form ---------- */

form.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 520px;
}

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14.5px;
  font-family: inherit;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

#contact-status {
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 10px;
}

#contact-status.ok {
  background: #eafaf0;
  color: var(--green-dark);
  border: 1px solid #bdeed1;
}

#contact-status.error {
  background: #fdeeea;
  color: #b3401d;
  border: 1px solid #f3c6b4;
}

/* ---------- Footer ---------- */

footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

footer a {
  color: var(--text-muted);
  margin: 0 8px;
}

@media (max-width: 480px) {
  .toc ol {
    columns: 1;
  }
}
