/* =========================================================
   HLR — Reprogrammation (CSS propre & harmonisé)
   Dernière MAJ : 2025-09-14
========================================================= */

/* =============== Variables (thème HLR) =============== */
:root{
  --bg:#0b0b0b;         --card:#141414;      --text:#f5f5f7;  --muted:#bdbdbd;
  --accent:#00ffc2;     --accent-2:#2ee6a6;
  --line:rgba(255,255,255,.10);
  --border:1px solid var(--line);
  --radius:16px;        --shadow:0 12px 32px rgba(0,0,0,.35);
  --container:1200px;
}

/* ====================== Base ========================= */
*{box-sizing:border-box}
html,body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial
}
a{color:inherit;text-decoration:none}
.container{max-width:var(--container);margin:auto;padding:0 20px}
.hidden{display:none}
.muted{color:var(--muted)}
.tiny{font-size:12px}

/* ===================== Boutons ======================= */
/* Primaire (CTA) — texte toujours foncé et lisible, même au hover/focus */
.btn,.btn-primary{
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  padding:12px 18px; border-radius:12px; border:0; cursor:pointer;
  background:linear-gradient(135deg,#00e6ad,#00ffc2);
  color:#041e18; font-weight:700; box-shadow:var(--shadow);
  transition:transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover,.btn:focus{
  transform:translateY(-2px) scale(1.02);
  box-shadow:0 0 24px rgba(0,255,194,.45);
}
.btn *{color:#041e18}             /* icônes/texte internes */

/* Secondaire (ghost sombre) */
.btn-ghost,.btn-accent,.btn-garage{
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  padding:12px 18px; border-radius:12px;
  background:rgba(255,255,255,.10); color:#fff; border:1px solid rgba(255,255,255,.25);
  box-shadow:none; font-weight:700; transition:background .2s ease, color .2s ease;
}
.btn-ghost:hover,.btn-accent:hover,.btn-garage:hover{
  background:rgba(255,255,255,.16);
}

/* ================== Formulaire immat ================= */
.immat-form{margin-top:16px}
.immat-form label{display:block;font-size:13px;color:var(--muted);margin:0 0 6px}
.immat-row{
  display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center
}
.immat-row input{
  padding:12px 14px; border-radius:12px; border:var(--border);
  background:#0c0c0c; color:var(--text);
  font-size:16px; font-weight:600; letter-spacing:2px; text-transform:uppercase
}
.immat-form .btn{min-width:128px}
.state{margin:6px 2px 0}

/* ======================= Filtres ===================== */
.catalog{padding:20px 0 60px}
.filters{
  display:grid; grid-template-columns:repeat(3,1fr); gap:24px; margin:30px 0
}
.fcol{
  background:var(--card); border:var(--border); border-radius:14px;
  padding:18px; box-shadow:0 6px 16px rgba(0,0,0,.35)
}
.fcol label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px}
.fcol input{
  width:100%; background:#101010; color:#fff; border:var(--border);
  border-radius:10px; padding:10px 12px; margin-bottom:8px
}

/* =========== Grilles marques / listes items ========== */
.brand-grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
  gap:12px; max-height:420px; overflow:auto; padding:4px
}
.list{
  display:flex; flex-direction:column; gap:10px;
  max-height:420px; overflow:auto; padding:4px
}

/* Boutons items */
#brandGrid button,#modelList button,#engineList button{
  width:100%; padding:12px 14px; background:#0d0d0d; border:1px solid rgba(255,255,255,.08);
  border-radius:10px; color:#e5e5e5; font-size:15px; font-weight:500; text-align:left;
  cursor:pointer; transition:all .25s ease; display:flex; align-items:center; gap:12px
}
#brandGrid button img{
  width:28px; height:28px; object-fit:contain;
  filter:drop-shadow(0 0 4px rgba(0,255,194,.3))
}
#brandGrid button:hover,#modelList button:hover,#engineList button:hover{
  background:#111; border-color:var(--accent);
  transform:translateY(-2px); box-shadow:0 0 12px rgba(0,255,194,.4)
}
#brandGrid button.active,#modelList button.active,#engineList button.active{
  background:linear-gradient(135deg,#00ffc2,#2EE6A6);
  color:#0b0b0b; font-weight:600; border-color:transparent;
  box-shadow:0 0 20px rgba(0,255,194,.6)
}

/* ======================== Cartes ===================== */
.card{
  margin-top:18px; background:var(--card); border:var(--border); border-radius:16px;
  padding:16px; box-shadow:var(--shadow); display:flex; flex-direction:column; gap:14px
}
.card--glass{
  background:linear-gradient(180deg,var(--card) 0%,#0c121a 100%);
  border:var(--border); border-radius:18px; box-shadow:var(--shadow);
  backdrop-filter:saturate(120%) blur(6px)
}
.card-header{display:flex;justify-content:space-between;align-items:center;gap:12px}
.badge{display:inline-block;background:#1d1d1d;border:var(--border);border-radius:999px;padding:4px 10px;font-size:12px}

/* ===================== Spécs véhicule ================= */
.grid{display:grid;gap:12px;grid-template-columns:repeat(2,1fr)}
.kv-grid{grid-template-columns:repeat(4,1fr)}
.kv{
  background:#101010; border:var(--border); border-radius:12px; padding:12px;
  display:flex; justify-content:space-between; align-items:center
}
.kv span{color:var(--muted);font-size:13px}
.kv strong{font-size:16px}

/* =================== Segmented (stages) =============== */
.segmented{
  display:inline-flex; gap:8px; margin:16px 0;
  background:#0f1312; border:1px solid rgba(255,255,255,.08); border-radius:999px; padding:6px
}
.seg-btn{
  border:0; background:transparent; color:var(--text);
  padding:8px 14px; border-radius:999px; cursor:pointer; font-weight:600
}
.seg-btn[aria-pressed="true"]{background:rgba(0,255,194,.12); color:#b6ffe8}

/* =================== Gains / carte éco ================= */
.gains-card,.eco-card{
  background:#101010; border:var(--border); border-radius:12px;
  padding:14px; display:flex; flex-direction:column; gap:8px
}
.g-line{
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 0; border-bottom:1px solid rgba(255,255,255,.06)
}
.g-line:last-child{border-bottom:0}
.g-note{margin-top:6px}

/* ===================== Options (chips) ================= */
/* Markup attendu :
   <ul class="chips">
     <li><label><input type="checkbox" ...> TEXTE</label></li>
   </ul>
*/
.chips{
  display:flex; flex-wrap:wrap; gap:14px;
  margin:10px 0 0; padding:0; list-style:none
}
.chips > li{margin:0; padding:0}

.chips label{
  display:inline-flex; align-items:center; gap:10px;
  padding:10px 16px; border-radius:999px;
  background:rgba(0,255,194,.06);
  border:1px solid rgba(0,255,194,.25);
  color:#f5f5f7; font-weight:700; cursor:pointer;
  transition:background .2s ease, border-color .2s ease, box-shadow .2s ease
}

/* Checkbox native visible (fiable partout) */
.chips input[type="checkbox"]{
  width:18px; height:18px; margin:0 4px 0 0; flex:0 0 auto;
  -webkit-appearance:checkbox; appearance:checkbox;
  accent-color: var(--accent);
}

/* Hover visuel */
.chips label:hover{
  background:rgba(0,255,194,.12);
  border-color:var(--accent);
}

/* Etat actif (browsers modernes :has) — amélioration progressive */
.chips label:has(input[type="checkbox"]:checked){
  background:rgba(0,255,194,.18);
  border-color:var(--accent);
  box-shadow:inset 0 0 0 2px rgba(0,255,194,.15), 0 0 16px rgba(0,255,194,.18);
  color:#eafff8;
}

/* Focus clavier accessible */
.chips input[type="checkbox"]:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(0,255,194,.28), 0 0 0 1px rgba(0,255,194,.75);
  border-radius:4px;
}

/* ===================== Responsive ===================== */
@media (max-width:1100px){
  .brand-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
}
@media (max-width:1024px){
  .kv-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:900px){
  .filters{grid-template-columns:1fr}
  .grid{grid-template-columns:1fr}
}
