/* =====================================================
   Voiture Citoyenne — CSS 2013
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

:root {
  --vert:       #72af23;
  --vert-dark:  #4e7a15;
  --vert-light: #d4f0a0;
  --orange:     #ff6600;
  --rouge:      #cc2200;
  --gris-clair: #f5f7f2;
  --gris-bord:  #d8e0cc;
  --texte:      #1a1a1a;
  --blanc:      #ffffff;
  --note-bg:    #edf7d8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--texte);
  background: var(--gris-clair);
  line-height: 1.6;
}

/* ---- HEADER ---- */
.site-header {
  background: var(--blanc);
  border-bottom: 3px solid var(--vert);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 0;
  text-decoration: none;
}

.logo-img { height: 52px; }

.logo-text {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--vert-dark);
  line-height: 1.15;
}

.logo-sub {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: .75rem;
  font-weight: 400;
  color: #666;
  letter-spacing: .04em;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
}

nav a {
  font-size: .85rem;
  font-weight: 500;
  color: var(--vert-dark);
  text-decoration: none;
  padding: .4rem .8rem;
  border-radius: 4px;
  transition: background .15s, color .15s;
}

nav a:hover, nav a.active {
  background: var(--vert-light);
  color: var(--vert-dark);
}

/* ---- LAYOUT ---- */
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* ---- CARDS / SECTIONS ---- */
.card {
  background: var(--blanc);
  border: 1px solid var(--gris-bord);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.card-red {
  border-left: 4px solid var(--rouge);
}

.card-green {
  border-left: 4px solid var(--vert);
}

h1, h2, h3 {
  font-family: 'DM Serif Display', serif;
}

h1 {
  font-size: 2rem;
  color: var(--vert-dark);
  margin-bottom: .5rem;
}

h2 {
  font-size: 1.4rem;
  color: var(--orange);
  margin: 1.25rem 0 .6rem;
}

h3 {
  font-size: 1.1rem;
  color: var(--vert-dark);
  margin: 1rem 0 .4rem;
}

p { margin-bottom: .8rem; }

/* ---- HERO BANNER (accueil) ---- */
.hero {
  background: linear-gradient(135deg, var(--vert-dark) 0%, var(--vert) 60%, #9fcf3d 100%);
  color: var(--blanc);
  border-radius: 10px;
  padding: 2.5rem 2.5rem 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '🚗';
  position: absolute;
  right: 2rem;
  bottom: -10px;
  font-size: 8rem;
  opacity: .12;
  pointer-events: none;
}

.hero h1 {
  color: var(--blanc);
  font-size: 2.4rem;
  margin-bottom: .4rem;
}

.hero p {
  color: rgba(255,255,255,.9);
  font-size: 1.05rem;
  max-width: 680px;
}

/* ---- VALEURS GRID ---- */
.valeurs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.valeur-item {
  background: var(--note-bg);
  border: 1px solid var(--gris-bord);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  text-align: center;
}

.valeur-item .icon { font-size: 1.8rem; margin-bottom: .4rem; }
.valeur-item strong { display: block; color: var(--vert-dark); font-size: .9rem; }

/* ---- PALMARES FILTER ---- */
.filter-form {
  background: var(--blanc);
  border: 1px solid var(--gris-bord);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 160px;
}

.filter-group label {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #555;
}

.filter-group select {
  font-family: 'DM Sans', sans-serif;
  font-size: .92rem;
  border: 1.5px solid var(--gris-bord);
  border-radius: 6px;
  padding: .45rem .7rem;
  background: var(--blanc);
  color: var(--texte);
  cursor: pointer;
  transition: border-color .15s;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--vert);
}

.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: .92rem;
  font-weight: 600;
  padding: .5rem 1.4rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.btn-primary {
  background: var(--vert);
  color: var(--blanc);
}

.btn-primary:hover {
  background: var(--vert-dark);
  transform: translateY(-1px);
}

/* ---- RESULTS TABLE ---- */
.results-meta {
  font-size: .88rem;
  color: #555;
  margin-bottom: .75rem;
}

.results-meta strong { color: var(--vert-dark); }

.table-wrap {
  overflow-x: auto;
}

table.palmares {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

table.palmares thead th {
  background: var(--vert-dark);
  color: var(--blanc);
  padding: .65rem 1rem;
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

table.palmares thead th:first-child { border-radius: 6px 0 0 0; }
table.palmares thead th:last-child  { border-radius: 0 6px 0 0; }

table.palmares tbody tr {
  border-bottom: 1px solid var(--gris-bord);
  transition: background .1s;
}

table.palmares tbody tr:hover { background: #f0f9e0; }

table.palmares td {
  padding: .6rem 1rem;
  color: var(--texte);
}

table.palmares td.rank {
  font-weight: 700;
  color: #888;
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 60px;
}

table.palmares td.modele a {
  color: var(--vert-dark);
  font-weight: 600;
  text-decoration: none;
}

table.palmares td.modele a:hover { color: var(--orange); text-decoration: underline; }

table.palmares td.note {
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
}

.note-badge {
  display: inline-block;
  background: var(--note-bg);
  border: 1px solid var(--vert-light);
  border-radius: 5px;
  padding: .15rem .55rem;
  color: var(--vert-dark);
}

.carb-badge {
  font-size: .78rem;
  padding: .1rem .45rem;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.carb-es  { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.carb-go  { background: #cfe2ff; color: #0a4a8c; border: 1px solid #9ec5fe; }
.carb-fap { background: #d1e7dd; color: #0a5236; border: 1px solid #a3cfbb; }

/* ---- FICHE VEHICULE ---- */
.fiche-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fiche-title h1 { margin-bottom: .25rem; }
.fiche-title .version { color: #555; font-size: 1rem; }

.note-globale {
  background: var(--vert);
  color: var(--blanc);
  border-radius: 12px;
  padding: .75rem 1.5rem;
  text-align: center;
  min-width: 120px;
}

.note-globale .valeur {
  font-family: 'DM Serif Display', serif;
  font-size: 2.5rem;
  line-height: 1;
  display: block;
}

.note-globale .label {
  font-size: .78rem;
  opacity: .85;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}

.note-item {
  background: var(--gris-clair);
  border: 1px solid var(--gris-bord);
  border-radius: 8px;
  padding: .85rem 1rem;
}

.note-item .n-label {
  font-size: .78rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .25rem;
}

.note-item .n-val {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: var(--vert-dark);
  line-height: 1;
}

.note-item .n-max {
  font-size: .8rem;
  color: #999;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .5rem 2rem;
}

.data-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dotted var(--gris-bord);
  padding: .35rem 0;
  font-size: .9rem;
}

.data-row .dk { color: #555; }
.data-row .dv { font-weight: 500; }

/* ---- BACK LINK ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--vert-dark);
  font-weight: 500;
  text-decoration: none;
  font-size: .9rem;
  margin-bottom: 1.25rem;
}

.back-link:hover { text-decoration: underline; }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--vert-dark);
  color: rgba(255,255,255,.75);
  text-align: center;
  padding: 1.25rem;
  font-size: .83rem;
  margin-top: 2rem;
}

.site-footer a { color: rgba(255,255,255,.9); }

/* ---- ALERT ---- */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: .9rem;
}

.alert-info { background: #e8f4fd; border: 1px solid #bee3f8; color: #1a4a6e; }
.alert-warn { background: #fff8e0; border: 1px solid #f0d060; color: #6b5000; }

/* ---- RESPONSIVE ---- */
@media (max-width: 700px) {
  .header-inner { flex-direction: column; align-items: flex-start; padding: .75rem 1rem; }
  nav { gap: .15rem; }
  nav a { font-size: .8rem; padding: .3rem .6rem; }
  .hero { padding: 1.5rem 1.25rem; }
  .hero h1 { font-size: 1.7rem; }
  .filter-form { flex-direction: column; }
  .filter-group { min-width: 100%; }
  .page-wrap { padding: 1rem 1rem 2rem; }
  table.palmares thead th, table.palmares td { padding: .5rem .6rem; }
}
