/* ============================================================
   Urbanito - OUTILS (tools.css)
   Hub /outils + pages outils (calculateurs, convertisseurs, lookup).
   Fluide (tokens clamp), piloté par [data-accent], zéro pixel fixe.
   ============================================================ */

/* Le hub /outils réutilise .hub-grid + .hubcard (design system, components.css).
   Aucune carte propre aux outils ici : pas de doublon, pas de barre d'accent. */

/* ---------- PAGE OUTIL : en-tête compact + ATELIER form | résultat ----------
   Flux fluide : en-tête sobre, puis on remplit à gauche et le résultat
   s'affiche en direct juste à droite ; la reco arrive en pleine largeur dessous. */
.section--tool { padding-top: var(--space-md); padding-bottom: var(--space-2xl); }

.tool-head { display: flex; flex-direction: column; gap: var(--space-2xs); max-width: 60rem; margin-bottom: var(--space-md); }
.tool-head__title { font-size: var(--fs-xl); line-height: 1.12; color: var(--ink); }
.tool-head__lead { font-size: var(--fs-base); color: var(--text); line-height: 1.5; }

/* Atelier : UN SEUL bloc (carte ombrée à coins arrondis) qui contient TOUT -
   formulaire, résultat ET modèles recommandés. Séparations par simples filets. */
.tool-work {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.tool-work__top {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
}
.tool-work__side { padding: var(--space-lg); min-width: 0; }
.tool-work__side--out {
  display: flex; flex-direction: column; justify-content: center;
  border-left: 1px solid var(--line);
}
.tool-work__label { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-sm); }
/* Reco À L'INTÉRIEUR du bloc : pleine largeur, séparée par un filet du haut */
.tool-work .tool-reco { margin-top: 0; padding: var(--space-lg); border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .tool-work__top { grid-template-columns: 1fr; }
  .tool-work__side--out { border-left: none; border-top: 1px solid var(--line); justify-content: flex-start; }
}

/* Variante "Que dit la loi" : contrôle slim en haut + résultat pleine largeur */
.tool-controls { max-width: 34rem; margin-bottom: var(--space-lg); }
.tool-controls .tool-form { padding: var(--space-md); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.tool-app { min-width: 0; }

/* Formulaire : grille nue (le panneau de l'atelier fournit le cadre) */
.tool-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-md);
}
.tool-field { display: flex; flex-direction: column; gap: var(--space-2xs); }
.tool-field__label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.tool-field__unit { font-weight: 600; color: var(--muted); }
.tool-field__num { position: relative; display: flex; align-items: center; }
.tool-field__input {
  width: 100%;
  font: inherit;
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
select.tool-field__input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23687a72' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  background-size: .7rem;
  padding-right: calc(var(--space-md) * 2 + .7rem);
  cursor: pointer;
}
.tool-field__num .tool-field__input { padding-right: 3.2rem; }
.tool-field__suffix {
  position: absolute;
  right: var(--space-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
}
.tool-field__input:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(var(--acc-rgb), .15);
}
.tool-field__help { font-size: var(--fs-xs); color: var(--muted); line-height: 1.45; }

/* ---------- Résultat chiffré (dans le panneau de droite) ---------- */
.tool-result { min-width: 0; }
.tool-figure {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  text-align: center;
  padding: var(--space-sm) 0 var(--space-md);
}
.tool-figure__big {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-3xl);
  line-height: 1;
  color: var(--acc);
}
.tool-figure__head { font-size: var(--fs-md); font-weight: 700; color: var(--ink); line-height: 1.25; }
.tool-figure__sub { font-size: var(--fs-sm); color: var(--muted); }
.tool-notes {
  margin-top: var(--space-sm);
  display: grid;
  gap: var(--space-xs);
  list-style: none;
}
.tool-notes li {
  position: relative;
  padding-left: 1.6rem;
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: 1.5;
}
.tool-notes li::before {
  content: "";
  position: absolute;
  left: 0; top: .5em;
  width: .55rem; height: .55rem;
  border-radius: 50%;
  background: var(--acc);
}

/* ---------- "Que dit la loi" : rendu riche ---------- */
.law { display: flex; flex-direction: column; gap: var(--space-lg); }

/* Verdict : bandeau statut + grande stat vitesse */
.law__verdict {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(130% 160% at 0% 0%, rgba(var(--acc-rgb), .14), transparent 60%),
    var(--surface);
  border: 1px solid rgba(var(--acc-rgb), .25);
  box-shadow: var(--shadow-sm);
}
.law__verdict-main { flex: 1 1 16rem; min-width: 0; }
.law__statut { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--acc); }
.law__verdict-txt { font-family: var(--font-display); font-size: var(--fs-lg); line-height: 1.2; color: var(--ink); margin-top: var(--space-2xs); }
.law__speed {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius); background: rgba(var(--acc-rgb), .10);
}
.law__speed-num { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2xl); line-height: 1; color: var(--acc); }
.law__speed-lbl { font-size: var(--fs-2xs); color: var(--muted); margin-top: .3em; max-width: 12rem; }

/* Règles en cartes (icône + label + pastille statut + détail) */
.law__rules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-sm);
}
.lrule {
  display: flex; gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.lrule__ico {
  flex: none;
  display: inline-grid; place-items: center;
  width: 2.2rem; height: 2.2rem;
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
}
.lrule__body { min-width: 0; }
.lrule__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); }
.lrule__label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.lrule__detail { font-size: var(--fs-xs); color: var(--muted); line-height: 1.45; margin-top: var(--space-2xs); }

/* Pastilles de statut (couleur sémantique) */
.lr-pill { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .02em; padding: .2em .6em; border-radius: 999px; white-space: nowrap; }
.lr-pill--req  { color: #B23A26; background: rgba(201, 80, 58, .13); }
.lr-pill--no   { color: #B23A26; background: rgba(201, 80, 58, .13); }
.lr-pill--rec  { color: #9A6512; background: rgba(201, 138, 43, .16); }
.lr-pill--ok   { color: #178455; background: rgba(31, 163, 104, .14); }
.lr-pill--info { color: var(--muted); background: var(--bg-alt); }

/* Équipement + sanctions */
.law__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: var(--space-md); }
.law__block { padding: var(--space-lg); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.law__h { font-family: var(--font-display); font-size: var(--fs-md); color: var(--ink); margin-bottom: var(--space-sm); }
.law__equip { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.law__equip li { font-size: var(--fs-xs); color: var(--text); background: var(--bg-alt); border-radius: var(--radius-sm); padding: .4em .7em; }
.law__sanctions { list-style: none; display: grid; gap: 0; }
.law__sanctions li {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-md);
  padding: var(--space-sm) 0; border-top: 1px solid var(--line);
}
.law__sanctions li:first-child { border-top: none; }
.law__sanc-k { font-size: var(--fs-sm); color: var(--text); }
.law__sanc-v { font-size: var(--fs-sm); font-weight: 700; color: #B23A26; white-space: nowrap; }

/* Checklist conformité */
.law__check { padding: var(--space-lg); background: rgba(var(--acc-rgb), .06); border: 1px solid rgba(var(--acc-rgb), .2); border-radius: var(--radius); }
.law__checklist { list-style: none; display: grid; gap: var(--space-xs); }
.law__checklist li { position: relative; padding-left: 1.7rem; font-size: var(--fs-sm); color: var(--ink); line-height: 1.45; }
.law__checklist li::before {
  content: "\2713"; position: absolute; left: 0; top: 0;
  width: 1.2rem; height: 1.2rem; display: grid; place-items: center;
  font-size: .8rem; font-weight: 700; color: #fff; background: var(--acc); border-radius: 50%;
}

.tool-lookup__warn {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink);
  background: rgba(var(--acc-rgb), .08);
  border: 1px solid rgba(var(--acc-rgb), .22);
  border-radius: var(--radius-sm);
}

/* ---------- Reco produit ---------- */
.tool-reco { margin-top: var(--space-lg); }
.tool-reco__head { margin-bottom: var(--space-sm); }
.tool-reco__eyebrow { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--acc); }
.tool-reco__title { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--ink); line-height: 1.15; }

/* Contenu éditorial sous l'outil : même alignement que l'outil, largeur lisible */
.tool-prose { max-width: 64rem; }
.tool-prose > h2 { font-size: var(--fs-lg); color: var(--ink); margin: var(--space-xl) 0 var(--space-sm); }
.tool-prose > h2:first-child { margin-top: 0; }
.tool-prose p { font-size: var(--fs-base); line-height: 1.6; color: var(--text); margin-bottom: var(--space-sm); }
.tool-prose .faq { margin-top: var(--space-xs); }
.tool-reco__note { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--space-md); line-height: 1.5; }
/* La reco réutilise la grille .pgrid + la carte canonique .pcard (components.css).
   Aucune carte propre aux outils : tailles et disposition homogènes avec le site. */
.tool-work .tool-reco .pgrid--3 { gap: var(--space-md); }

.tool-cross { margin-top: var(--space-md); text-align: center; }

/* ---------- Mobile : compact ---------- */
@media (max-width: 560px) {
  .law__verdict { padding: var(--space-md); }
  .law__speed { width: 100%; }
}
