/* CoteCars — design system partagé (pages Acheter / Estimer / Espace Pro) */
:root {
  --vh: 1vh; /* 1 % de la hauteur d'écran, corrigé du zoom (voir plus bas) */
  --blue: #1a47d8;
  --blue-600: #1339b8;
  --blue-50: #eef3ff;
  --blue-100: #dbe5ff;
  --ink: #0f172a;
  --text: #1e293b;
  --text2: #475569;
  --text3: #94a3b8;
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e6e9ef;
  --border2: #d5dae3;
  --green: #059669;
  --green-50: #ecfdf5;
  --green-200: #a7f3d0;
  --orange: #f59e0b;
  --orange-50: #fff8e6;
  --orange-200: #fde68a;
  --red: #dc2626;
  --red-50: #fef2f2;
  --red-200: #fecaca;
  --pink: #db2777;
  --violet: #7c3aed;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .12);
  --font: "Onest", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }

/* ── Boutons ─────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 15px; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(26, 71, 216, .25); }
.btn-primary:hover:not(:disabled) { background: var(--blue-600); }
.btn-orange { background: var(--orange); color: #fff; box-shadow: 0 4px 14px rgba(245, 158, 11, .3); }
.btn-orange:hover { background: #e08e06; }
.btn-outline { background: #fff; border-color: var(--border2); color: var(--text); }
.btn-outline:hover { border-color: var(--text3); background: #fbfcfd; }
.btn-green-soft { background: var(--green-50); border-color: var(--green-200); color: var(--green); }
.btn-green-soft:hover { background: #d1fae5; }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-danger-soft { background: var(--red-50); border-color: var(--red-200); color: var(--red); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.link { color: var(--blue); font-weight: 600; background: none; border: none; padding: 0; }
.link:hover { text-decoration: underline; }

/* ── Champs ─────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--text3); }
.input, .select, .textarea { width: 100%; height: 50px; padding: 0 14px; background: #fff; border: 1px solid var(--border2); border-radius: 10px; font-size: 16px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26, 71, 216, .12); }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16' fill='none' stroke='%23334155' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l3-3 3 3M3 10l3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.select:disabled, .input:disabled { background-color: #f1f3f6; color: var(--text3); cursor: not-allowed; }
.input-sm, .select-sm { height: 40px; font-size: 14.5px; }
.input-group { position: relative; }
.input-group .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 14px; pointer-events: none; }
.input-group .input { padding-right: 44px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 22px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.req { color: var(--red); }
.err-text { color: var(--red); font-size: 13.5px; font-weight: 500; }

/* Checkbox / radio */
.check { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 8px 0; user-select: none; font-size: 15.5px; color: var(--text); }
.check input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border: 1.5px solid var(--border2); border-radius: 6px; margin: 0; flex-shrink: 0; display: grid; place-content: center; background: #fff; transition: all .12s; cursor: pointer; }
.check input:checked { background: var(--blue); border-color: var(--blue); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.check input[type=radio] { border-radius: 6px; }
.check input[type=radio]:checked::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.check .count { margin-left: auto; color: var(--text3); font-size: 14px; }
.check:hover input:not(:checked) { border-color: var(--text3); }

/* Segmented / option cards */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.seg button { height: 50px; border-radius: 10px; border: 1px solid var(--border2); background: #fff; font-weight: 600; color: var(--text2); transition: all .12s; }
.seg button:hover { border-color: var(--text3); }
.seg button.on { border-color: var(--blue); background: var(--blue-50); color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
@media (max-width: 560px) { .seg { grid-auto-flow: row; grid-template-columns: 1fr 1fr; } }

/* ── Cartes / badges ─────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; color: var(--text); background: #fff; white-space: nowrap; }
.pill svg { color: var(--text3); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.nodot::before { display: none; }
.b-orange { color: #c2410c; background: var(--orange-50); border-color: var(--orange-200); }
.b-orange::before { background: var(--orange); }
.b-red { color: var(--red); background: var(--red-50); border-color: var(--red-200); }
.b-green { color: var(--green); background: var(--green-50); border-color: var(--green-200); }
.b-blue { color: var(--blue); background: var(--blue-50); border-color: var(--blue-100); }
.b-violet { color: var(--violet); background: #f5f3ff; border-color: #ddd6fe; }
.b-gray { color: var(--text2); background: #f1f5f9; border-color: var(--border); }
.count-dot { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; }
.soft-tag { display: inline-flex; align-items: center; padding: 5px 12px; background: #f1f3f6; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--text2); }

/* ── Header public ─────────────────────────── */
.site-header { background: #fff; position: sticky; top: 0; z-index: 40; }
.site-header .bar { max-width: 1440px; margin: 0 auto; height: 84px; padding: 0 28px; display: flex; align-items: center; gap: 28px; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.logo span { color: var(--blue); }
.site-search { flex: 1; max-width: 800px; position: relative; }
.site-search input { width: 100%; height: 54px; border-radius: 999px; border: 1px solid var(--border); background: #f8fafc; padding: 0 64px 0 26px; font-size: 16px; outline: none; }
.site-search input:focus { border-color: var(--blue); background: #fff; }
.site-search button { position: absolute; right: 5px; top: 5px; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--blue); color: #fff; display: grid; place-items: center; }
.site-header .right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.user-link { display: flex; align-items: center; gap: 8px; color: var(--blue); font-weight: 600; font-size: 15px; background: none; border: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: none; border: none; color: var(--text3); }
.icon-btn:hover { background: #f1f5f9; color: var(--text); }
.site-nav { border-top: 1px solid #f1f3f6; border-bottom: 1px solid var(--border); background: #fbfbfc; }
.site-nav ul { list-style: none; margin: 0 auto; padding: 0 28px; max-width: 1440px; height: 60px; display: flex; align-items: center; justify-content: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.site-nav a { display: block; padding: 10px 22px; font-size: 16px; color: var(--text); white-space: nowrap; border-radius: 10px; }
.site-nav a:hover { color: var(--blue); }
.site-nav a.on { color: var(--blue); font-weight: 600; }
.site-nav a.hot { color: #15803d; font-weight: 600; }
.crumbs { background: #fff; border-bottom: 1px solid var(--border); }
.crumbs div { max-width: 1320px; margin: 0 auto; padding: 16px 28px; display: flex; align-items: center; gap: 12px; font-size: 16px; color: var(--text2); }
.crumbs b { color: var(--ink); font-weight: 500; }
.container { max-width: 1320px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 900px) {
  .site-header .bar { height: 68px; padding: 0 16px; gap: 12px; }
  .logo { font-size: 20px; }
  .site-search { display: none; }
  .user-link .txt, .site-header .hide-m { display: none; }
  .site-nav ul { justify-content: flex-start; padding: 0 8px; height: 52px; }
  .site-nav a { padding: 8px 12px; font-size: 14.5px; }
  /* Fondu à droite : indique que le menu défile horizontalement */
  .site-nav { position: relative; }
  .site-nav::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 40px; background: linear-gradient(to right, rgba(251, 251, 252, 0), #fbfbfc 85%); pointer-events: none; }
  .crumbs div, .container { padding-left: 16px; padding-right: 16px; }
}

/* ── Modale ─────────────────────────────── */
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(calc(100 * var(--vh)) - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 0; }
.modal-head h3 { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); }
.modal-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--blue-100); border-top-color: var(--blue); animation: spin .7s linear infinite; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 500; z-index: 400; box-shadow: var(--shadow-lg); animation: pop .2s; max-width: calc(100vw - 32px); }
.empty { text-align: center; padding: 60px 20px; color: var(--text2); }
.empty svg { color: var(--text3); margin: 0 auto 12px; }
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 50%, #eef1f5 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ── Pied de page responsive ── */
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr !important; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 22px 16px !important; padding-top: 28px !important; } .footer-brand { grid-column: 1 / -1; } .footer-brand p { display: none; } .footer-grid a { font-size: 14px; } }

/* ── Éléments partagés supplémentaires ── */
.section-title { margin: 0 0 20px; font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.section-sub { margin: -12px 0 24px; color: var(--text2); font-size: 16.5px; }
.plate { display: flex; align-items: stretch; border: 2.5px solid var(--ink); border-radius: 10px; overflow: hidden; background: #fff; height: 60px; }
.plate .eu { width: 38px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 6px; flex-shrink: 0; }
.plate .dept { width: 38px; background: var(--blue); flex-shrink: 0; }
.plate input { border: 0; outline: none; flex: 1; min-width: 0; font-size: 26px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; text-align: center; font-family: inherit; color: var(--ink); background: transparent; }
.plate:focus-within { box-shadow: 0 0 0 4px rgba(26, 71, 216, .15); }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); }
.tier { padding: 26px 24px; position: relative; border-right: 1px solid var(--border); }
.tier:last-child { border-right: 0; }
.tier.reco { background: var(--blue-50); box-shadow: inset 0 3px 0 var(--blue); }
.reco-tag { position: absolute; top: 10px; right: 12px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 99px; }
@media (max-width: 700px) { .tiers { grid-template-columns: 1fr; } .tier { border-right: 0; border-bottom: 1px solid var(--border); } }
.blurred { filter: blur(7px); user-select: none; pointer-events: none; }
.lock-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(255,255,255,.72); border-radius: inherit; text-align: center; padding: 20px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-drop { border: 2px dashed var(--border2); border-radius: 16px; padding: 30px; text-align: center; color: var(--text2); cursor: pointer; transition: all .12s; display: block; }
.photo-drop:hover { border-color: var(--blue); background: var(--blue-50); color: var(--blue); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: #eef1f5; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(15,23,42,.7); color: #fff; display: grid; place-items: center; }
.thumb .main-tag { position: absolute; left: 6px; bottom: 6px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 18px; }
.eq-grid .check { padding: 6px 0; font-size: 14.5px; }
.eq-grid .check input { width: 19px; height: 19px; }
.prose { font-size: 16.5px; line-height: 1.75; color: var(--text); }
.prose h2 { font-size: 24px; margin: 38px 0 14px; color: var(--ink); letter-spacing: -.01em; }
.prose h3 { font-size: 19px; margin: 28px 0 10px; color: var(--ink); }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--blue); font-weight: 600; }

/* ── Échelle globale : le site est affiché à 90 % sur ordinateur (le mobile reste à 100 %) ──
   Les hauteurs d'écran utilisent var(--vh), compensé du zoom pour rester à 100 % de la fenêtre. */
@media (min-width: 900px) {
  html { zoom: .9; }
  :root { --vh: calc(1vh / .9); }
}

/* Contenu de repli lisible sans JavaScript (HTML pré-rempli et rendu serveur) : React le remplace au chargement */
.ssr { padding-top: 28px; padding-bottom: 40px; max-width: 980px; color: var(--text); line-height: 1.65; }
/* Masqué pendant le démarrage de React (évite le flash de la page texte) ; il reste dans le HTML pour les moteurs de recherche.
   Si l'application ne démarre pas (JavaScript bloqué ou en erreur), il réapparaît au bout de 3 s. */
.ssr { visibility: hidden; animation: ssr-show 0s linear 3s forwards; }
@keyframes ssr-show { to { visibility: visible; } }
@keyframes ssr-hide { to { visibility: hidden; } }
#root:has(> .ssr)::before { content: ""; position: fixed; top: 45%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite, ssr-hide 0s linear 3s forwards; }
.ssr h1 { font-size: 34px; color: var(--ink); margin: 14px 0 10px; line-height: 1.15; }
.ssr h2 { font-size: 22px; color: var(--ink); margin: 26px 0 10px; }
.ssr a { color: var(--blue); }
.ssr img { max-width: 100%; height: auto; border-radius: 16px; }
.ssr .ssr-price { font-size: 22px; font-weight: 700; color: var(--ink); }
.ssr .ssr-nav, .ssr .ssr-crumbs { font-size: 14.5px; color: var(--text2); }
.ssr details { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }

/* Coupure des lignes : titres équilibrés (pas de mot seul sur la dernière ligne), paragraphes sans veuve */
h1, h2, h3, .seo-hero h1 { text-wrap: balance; }
p, li, summary, .lead { text-wrap: pretty; }
/* Fil d'Ariane sur une seule ligne (défilement horizontal sur mobile) */
.crumbs div { white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.crumbs div::-webkit-scrollbar { display: none; }
.crumbs div > * { flex-shrink: 0; }
@media (max-width: 640px) { .crumbs div { font-size: 14.5px; gap: 8px; padding-top: 12px; padding-bottom: 12px; } }
/* Téléphone : les fenêtres s'ouvrent en feuille depuis le bas, comme dans une app */
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { max-width: none !important; border-radius: 22px 22px 0 0; max-height: calc(92 * var(--vh)); animation: sheet .22s ease-out; padding-bottom: env(safe-area-inset-bottom); }
  .modal-head { padding: 18px 18px 0; }
  .modal-body { padding: 16px 18px 20px; }
}
@media (max-width: 640px) { .section-title { font-size: 23px; margin-bottom: 14px; } }
/* Téléphone : les 3 prix sur une ligne chacun (libellé à gauche, prix à droite) */
@media (max-width: 640px) {
  .tier:has(.t-p) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 14px 18px; }
  .tier .t-l { grid-column: 1; grid-row: 1; }
  .tier .t-s { grid-column: 1; grid-row: 2; font-size: 13px !important; }
  .tier .t-p { grid-column: 2; grid-row: 1 / span 2; font-size: 26px !important; margin: 0 !important; }
  .tier:has(.t-p) .reco-tag { display: none; }
  .tier.reco .t-s::after { content: " · recommandé"; color: var(--blue); font-weight: 700; }
}
