/* permis-strasbourg.fr — Design v5 "Service public propre"
   Stack : Public Sans (USWDS-like, ressemble à Marianne, Google Fonts) + Source Serif pour les chiffres
   Palette : Bleu institutionnel + accent rouge mesuré, neutres clairs
   Reset universel sur native elements pour éliminer toute incohérence */

@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700&display=swap');

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; line-height: 1.5; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button { cursor: pointer; background: none; border: 0; }
img, svg { display: block; max-width: 100%; }

/* ============ TOKENS ============ */
:root {
  /* PALETTE — bleu institutionnel français + accents */
  --c-blue:        #000091;
  --c-blue-hover:  #1212ff;
  --c-blue-soft:   #ececfe;
  --c-blue-dark:   #00006e;

  --c-red:         #E1000F;
  --c-red-hover:   #b50710;
  --c-red-soft:    #fdeded;

  --c-text:        #161616;
  --c-text-soft:   #3a3a3a;
  --c-text-mute:   #666666;
  --c-text-light:  #929292;

  --c-bg:          #ffffff;
  --c-bg-alt:      #f6f6f6;
  --c-bg-soft:     #fafafa;
  --c-bg-emphasis: #f0f0f0;

  --c-border:      #dddddd;
  --c-border-soft: #e5e5e5;
  --c-border-strong: #161616;

  --c-success:     #18753c;
  --c-warning:     #b34000;
  --c-warning-bg:  #fff4e5;

  /* TYPO */
  --ff-sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ff-serif: "Source Serif 4", Georgia, serif;
  --ff-mono: ui-monospace, "SF Mono", Menlo, "Courier New", monospace;

  /* SPACING */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --maxw: 1200px;
  --radius: 0;
}

/* ============ BASE ============ */
body {
  font-family: var(--ff-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-5); }

/* ============ TYPOGRAPHIE ============ */
h1, h2, h3, h4, h5 {
  font-family: var(--ff-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--c-text);
}
h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-4);
}
h2 {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 700;
  margin: 0 0 var(--s-5);
  padding-bottom: var(--s-3);
  border-bottom: 2px solid var(--c-text);
}
h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: var(--s-5) 0 var(--s-3);
}

p { font-size: 1rem; line-height: 1.6; color: var(--c-text-soft); margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--c-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .12s, background-color .12s, text-decoration-thickness .12s;
}
a:hover {
  color: var(--c-blue-hover);
  text-decoration-thickness: 2px;
}
a:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }

.lead {
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.55;
  color: var(--c-text);
  max-width: 760px;
  margin-bottom: var(--s-5);
  font-weight: 400;
}

/* ============ BANDEAU IDENTIFICATION ============ */
.site-id-bar {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  padding: var(--s-3) 0;
  font-size: .8125rem;
}
.site-id-bar .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap;
}
.site-id {
  display: flex; align-items: center; gap: var(--s-3);
  font-weight: 500;
}
.site-id::before {
  content: ""; display: block;
  width: 4px; height: 28px;
  background: linear-gradient(180deg,
    var(--c-blue) 0%, var(--c-blue) 33.33%,
    #ffffff 33.33%, #ffffff 66.66%,
    var(--c-red) 66.66%, var(--c-red) 100%);
  border: 1px solid var(--c-border);
  flex-shrink: 0;
}
.site-id-text { line-height: 1.2; }
.site-id-text strong {
  display: block; font-weight: 700; color: var(--c-text);
  font-size: .8125rem;
}
.site-id-text span {
  display: block; color: var(--c-text-mute);
  font-size: .75rem; margin-top: 2px;
}
.site-id-meta a {
  color: var(--c-text);
  text-decoration: none;
  font-size: .8125rem;
  font-weight: 500;
}
.site-id-meta a:hover { color: var(--c-blue); text-decoration: underline; }

/* ============ HEADER ============ */
.site-header {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 50;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--s-4); padding-bottom: var(--s-4);
  gap: var(--s-5);
}
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--c-text);
  letter-spacing: -.02em;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: var(--s-3);
}
.logo:hover { color: var(--c-blue); text-decoration: none; }
.logo::before {
  content: "P";
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--c-blue);
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.site-header nav {
  display: flex; gap: 0; flex-wrap: wrap;
}
.site-header nav a {
  color: var(--c-text);
  font-weight: 500;
  font-size: .9375rem;
  padding: var(--s-2) var(--s-3);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: border-color .15s, color .15s, background-color .15s;
}
.site-header nav a:hover, .site-header nav a[aria-current="page"] {
  color: var(--c-blue);
  border-color: var(--c-blue);
}

/* ============ MAIN ============ */
.site-main { padding: 0 0 var(--s-7); }
section { margin-bottom: var(--s-8); }

/* ============ BREADCRUMB ============ */
.breadcrumb {
  font-size: .875rem;
  color: var(--c-text-mute);
  padding: var(--s-4) var(--s-5);
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--c-bg-alt);
  border-bottom: 1px solid var(--c-border-soft);
}
.breadcrumb a {
  color: var(--c-text); text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover { color: var(--c-blue); text-decoration: underline; }

/* ============ HERO ============ */
.hero, .ville-hero, .ae-hero, .formule-hero, .alt-hero {
  background: var(--c-bg);
  padding: var(--s-8) 0 var(--s-6);
  border-bottom: 1px solid var(--c-border-soft);
}
.hero { background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-bg-alt) 100%); }
.hero h1, .ville-hero h1, .formule-hero h1, .alt-hero h1, .ae-hero h1 {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: var(--s-4);
  max-width: 880px;
}
.hero h1::before, .ville-hero h1::before {
  content: ""; display: block;
  width: 48px; height: 4px;
  background: var(--c-blue);
  margin-bottom: var(--s-5);
}

/* ============ KICKER ============ */
.kicker {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-blue);
  margin: 0 0 var(--s-3);
  display: inline-block;
}

/* ============ FORMULAIRE RECHERCHE ============ */
.search-form {
  display: flex; max-width: 640px;
  margin-top: var(--s-6);
  background: white;
  border: 1px solid var(--c-text);
}
.search-form input {
  flex: 1;
  padding: var(--s-3) var(--s-4);
  border: 0; outline: 0;
  background: transparent;
  color: var(--c-text);
  font-size: 1rem;
  min-width: 0;
}
.search-form input::placeholder { color: var(--c-text-mute); }
.search-form button {
  padding: var(--s-3) var(--s-5);
  background: var(--c-blue);
  color: white;
  font-weight: 600;
  font-size: .9375rem;
  font-family: inherit;
  transition: background .12s;
}
.search-form button:hover { background: var(--c-blue-hover); }
.search-form input:focus-visible { box-shadow: inset 0 0 0 2px var(--c-blue); }

/* ============ STATS ============ */
.ville-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  padding: 0;
  margin: var(--s-6) 0 0;
  list-style: none;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
}
.ville-stats li {
  padding: var(--s-5);
  border-right: 1px solid var(--c-border);
  font-size: .875rem;
  color: var(--c-text-mute);
}
.ville-stats li:last-child { border-right: 0; }
.ville-stats strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--c-blue);
  margin-bottom: 4px;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
@media (max-width: 720px) {
  .ville-stats { grid-template-columns: repeat(2, 1fr); }
  .ville-stats li { border-bottom: 1px solid var(--c-border); }
  .ville-stats li:nth-child(2n) { border-right: 0; }
  .ville-stats li:nth-last-child(-n+2) { border-bottom: 0; }
}

/* ============ CARDS ============ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-4);
}
.card {
  display: block;
  padding: var(--s-5);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  position: relative;
  padding-right: var(--s-7);
}
.card:hover {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 1px var(--c-blue);
  background: var(--c-bg-soft);
  text-decoration: none;
}
.card h3 {
  margin: 0 0 var(--s-2);
  color: var(--c-blue);
  font-size: 1.0625rem;
  font-weight: 700;
}
.card p {
  color: var(--c-text-soft);
  margin: 0;
  font-size: .9375rem;
  line-height: 1.5;
}
.card::after {
  content: "→";
  position: absolute;
  top: var(--s-5); right: var(--s-5);
  font-size: 1.25rem;
  color: var(--c-blue);
  font-weight: 700;
  line-height: 1;
  transition: transform .15s;
}
.card:hover::after { transform: translateX(3px); }

/* ============ COMPARATEUR TABLE ============ */
.comparateur { margin: var(--s-7) 0; }
.comparateur-tools {
  display: flex; gap: var(--s-3); margin-bottom: var(--s-4);
  flex-wrap: wrap; align-items: center;
}
.comparateur-tools .count {
  color: var(--c-text-mute);
  font-size: .875rem;
}
.comparateur-tools .filter-btn {
  display: inline-block;
  padding: var(--s-2) var(--s-3);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.comparateur-tools .filter-btn:hover {
  border-color: var(--c-blue); color: var(--c-blue);
  text-decoration: none;
}
.comparateur-tools .filter-btn.active {
  background: var(--c-blue); color: white; border-color: var(--c-blue);
}

.table-wrap { overflow-x: auto; border: 1px solid var(--c-border); }
.comparateur-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-bg);
  font-size: .9375rem;
}
.comparateur-table thead {
  background: var(--c-bg-alt);
  border-bottom: 2px solid var(--c-text);
}
.comparateur-table th {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--c-text);
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}
.comparateur-table td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-border-soft);
  vertical-align: middle;
  color: var(--c-text-soft);
}
.comparateur-table tr:last-child td { border-bottom: 0; }
.comparateur-table tbody tr { transition: background .1s; }
.comparateur-table tbody tr:hover { background: var(--c-blue-soft); }
.comparateur-table td strong { color: var(--c-text); font-weight: 600; }
.comparateur-table td a {
  color: var(--c-blue);
  text-decoration: none;
  font-weight: 600;
}
.comparateur-table td a:hover { text-decoration: underline; }
.comparateur-table .col-rating { white-space: nowrap; }

.btn-small {
  display: inline-block;
  padding: var(--s-2) var(--s-3);
  background: var(--c-blue);
  color: white !important;
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 600;
  text-decoration: none !important;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s;
  letter-spacing: 0;
}
.btn-small:hover { background: var(--c-blue-hover); color: white !important; }

.btn-large {
  display: inline-block;
  padding: var(--s-3) var(--s-5);
  background: var(--c-blue);
  color: white !important;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none !important;
  border: 0;
  cursor: pointer;
}
.btn-large:hover { background: var(--c-blue-hover); }

.btn-outline {
  display: inline-block;
  padding: var(--s-3) var(--s-5);
  background: transparent;
  color: var(--c-text) !important;
  border: 1px solid var(--c-text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none !important;
}
.btn-outline:hover { background: var(--c-text); color: white !important; }

/* ============ AE GRID + VILLES GRID ============ */
.ae-grid, .villes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-3);
  list-style: none;
  padding: 0;
  margin: 0;
}
.ae-grid li a, .villes-grid li a {
  display: block;
  padding: var(--s-4);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  text-decoration: none;
  transition: border-color .12s, background .12s;
}
.ae-grid li a:hover, .villes-grid li a:hover {
  border-color: var(--c-blue);
  background: var(--c-blue-soft);
  text-decoration: none;
}
.ae-grid strong, .villes-grid strong {
  display: block;
  color: var(--c-text);
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 1rem;
  line-height: 1.3;
}
.ae-grid small, .villes-grid span {
  color: var(--c-text-mute);
  font-size: .8125rem;
  display: block;
  line-height: 1.4;
}
.rating-mini {
  color: var(--c-warning);
  font-weight: 700;
  font-size: .8125rem;
  margin-top: var(--s-2);
  display: inline-block;
}

/* ============ AE PAGE ============ */
.ae-meta {
  display: flex; gap: var(--s-3); flex-wrap: wrap;
  margin-top: var(--s-5);
}
.ae-rating {
  background: var(--c-warning-bg);
  padding: var(--s-3) var(--s-4);
  border: 1px solid #f9d5a7;
  display: flex; align-items: baseline; gap: var(--s-2);
}
.ae-rating strong {
  font-size: 1.5rem; font-weight: 800;
  color: var(--c-warning);
}
.badge-active {
  background: var(--c-success);
  color: white;
  padding: var(--s-3) var(--s-4);
  font-size: .8125rem;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}

.two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--s-7); margin: var(--s-6) 0;
}
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; gap: var(--s-5); }
}
address { font-style: normal; line-height: 1.8; }
.text-muted {
  color: var(--c-text-mute); font-size: .875rem;
}

/* ============ REVIEWS ============ */
.review {
  background: var(--c-bg-soft);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-3);
  border-left: 3px solid var(--c-blue);
}
.review header {
  display: flex; justify-content: space-between;
  margin-bottom: var(--s-2);
  align-items: center;
  font-size: .9rem;
}
.review header strong { font-weight: 700; color: var(--c-text); }
.review .rating { color: var(--c-warning); font-size: 1rem; }
.review p { margin: 0; font-size: .9375rem; color: var(--c-text-soft); }

/* ============ FAQ ============ */
.faq details {
  background: var(--c-bg);
  padding: 0;
  margin: 0;
  border: 1px solid var(--c-border);
  border-top: 0;
}
.faq details:first-of-type { border-top: 1px solid var(--c-border); }
.faq summary {
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  color: var(--c-text);
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  transition: background .12s;
}
.faq summary:hover { background: var(--c-bg-alt); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--c-blue);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  transition: transform .2s;
}
.faq details[open] summary { background: var(--c-blue-soft); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p {
  margin: 0;
  padding: var(--s-4) var(--s-5);
  color: var(--c-text-soft);
  font-size: .9375rem;
  border-top: 1px solid var(--c-border);
  background: var(--c-bg-soft);
}

/* ============ PAGES STATIQUES ============ */
.page-statique { max-width: 760px; margin: 0 auto; }
.page-statique h2 {
  color: var(--c-text);
  border-bottom: 2px solid var(--c-blue);
  padding-bottom: var(--s-2);
  margin-top: var(--s-7);
}
.page-statique h2:first-child { margin-top: 0; }
.page-statique ul { padding-left: var(--s-5); margin-bottom: var(--s-4); }
.page-statique li { margin: var(--s-2) 0; color: var(--c-text-soft); }

/* ============ FOOTER ============ */
.site-footer {
  background: var(--c-bg);
  color: var(--c-text);
  margin-top: var(--s-9);
  font-size: .875rem;
  border-top: 1px solid var(--c-border);
}
.site-footer::before {
  content: ""; display: block;
  height: 4px;
  background: linear-gradient(90deg,
    var(--c-blue) 0%, var(--c-blue) 33.33%,
    #ffffff 33.33%, #ffffff 66.66%,
    var(--c-red) 66.66%, var(--c-red) 100%);
  border-bottom: 1px solid var(--c-border);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
  padding-top: var(--s-5);
  padding-bottom: var(--s-5);
}
.site-footer p { color: var(--c-text-mute); margin: 0; font-size: .875rem; }
.site-footer nav { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.site-footer a {
  color: var(--c-text); text-decoration: none;
  font-size: .875rem; font-weight: 500;
}
.site-footer a:hover { color: var(--c-blue); text-decoration: underline; }

/* ============ ERROR ============ */
.error-page { text-align: center; padding: var(--s-9) var(--s-5); }
.error-page h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--c-blue);
  margin-bottom: var(--s-4);
  border-bottom: 0; padding-bottom: 0;
}

/* ============ NICETIES ============ */
::selection { background: var(--c-blue); color: white; }
:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }

/* Tabular numbers for stats */
.tnum, .ville-stats strong, .comparateur-table td { font-variant-numeric: tabular-nums; }

/* Skip link a11y */
.skip-link {
  position: absolute; left: -9999px;
}
.skip-link:focus {
  left: var(--s-4); top: var(--s-4); z-index: 100;
  background: var(--c-blue); color: white; padding: var(--s-3);
  text-decoration: none;
}

/* Mobile */
@media (max-width: 720px) {
  .site-header .container { flex-direction: column; align-items: stretch; gap: var(--s-3); }
  .site-header nav { width: 100%; gap: 0; overflow-x: auto; }
  .site-header nav a { padding: var(--s-2) var(--s-3); white-space: nowrap; font-size: .875rem; }
  .container { padding: 0 var(--s-4); }
  .hero, .ville-hero, .formule-hero, .alt-hero { padding: var(--s-6) 0 var(--s-5); }
  h2 { font-size: 1.375rem; }
  .comparateur-table th, .comparateur-table td { padding: var(--s-2) var(--s-3); font-size: .875rem; }
}
