/* Parcours de comparaison v2 (docs/chantiers/parcours-v2.md).
   Préfixe pv- ; chargée uniquement sur les écrans du parcours (content_for :head).
   Charte : vert #047857, gris chauds stone, Inter + Fraunces (.font-display). */

.pv-shell { --pv-green: #047857; --pv-green-dark: #065f46; --pv-green-2: #10b981; --pv-green-3: #d1fae5; --pv-mint: #ecfdf5;
  --pv-text: #1c1917; --pv-muted: #57534e; --pv-soft: #78716c; --pv-border: #e7e5e4; --pv-field: #f5f5f4; --pv-bg: #fafaf9;
  --pv-amber: #b45309; --pv-amber-bg: #fef3c7;
  --pv-shadow: 0 25px 50px -12px rgba(28,25,23,.15); --pv-radius: 20px;
  min-height: 100vh; background: var(--pv-bg); color: var(--pv-text); -webkit-font-smoothing: antialiased; }
.pv-shell * { box-sizing: border-box; }

/* En-tête du parcours */
.pv-top { position: sticky; top: 0; z-index: 30; background: rgba(250,250,249,.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--pv-border); }
.pv-top-inner { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 20px; }
.pv-logo { font-family: 'Fraunces', Georgia, serif; font-size: 24px; color: var(--pv-text); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.pv-logo em { color: var(--pv-green); font-style: italic; }
.pv-reassure { margin-left: auto; display: none; gap: 14px; font-size: 13px; color: var(--pv-muted); white-space: nowrap; }
.pv-reassure span { display: inline-flex; align-items: center; gap: 6px; }
.pv-reassure svg { width: 15px; height: 15px; color: var(--pv-green); }
@media (min-width: 900px) { .pv-reassure { display: flex; } }

/* Barre d'étapes */
.pv-steps { max-width: 1180px; margin: 0 auto; padding: 0 20px 12px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pv-step { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--pv-soft); font-weight: 500; }
.pv-step i { display: block; height: 4px; border-radius: 999px; background: var(--pv-border); transition: background .4s; }
.pv-step.is-done i, .pv-step.is-current i { background: var(--pv-green); }
.pv-step.is-current { color: var(--pv-green); font-weight: 600; }
.pv-step.is-done { color: var(--pv-text); }
.pv-step span { display: none; }
@media (min-width: 640px) { .pv-step span { display: block; } }
.pv-step-mobile { display: block; font-size: 12px; color: var(--pv-muted); padding: 0 20px 10px; }
@media (min-width: 640px) { .pv-step-mobile { display: none; } }

/* Grille écran : contenu + dossier */
.pv-main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }
.pv-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 1024px) { .pv-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; } .pv-grid.pv-grid--inverse { grid-template-columns: 380px minmax(0, 1fr); } }
.pv-aside { position: sticky; top: 92px; }
@media (max-width: 1023px) { .pv-aside { position: static; } .pv-grid--dossier-haut .pv-aside { order: -1; } .pv-grid--dossier-bas .pv-aside { order: 1; } }

/* Cartes et typographie */
.pv-card { background: #fff; border: 1px solid var(--pv-border); border-radius: var(--pv-radius); box-shadow: var(--pv-shadow); }
.pv-card-body { padding: 28px; }
@media (max-width: 640px) { .pv-card-body { padding: 20px; } }
.pv-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--pv-green); background: var(--pv-mint); border: 1px solid #a7f3d0; border-radius: 999px; padding: 6px 12px; }
.pv-title { font-family: 'Fraunces', Georgia, serif; font-weight: 450; font-variation-settings: "opsz" 60, "SOFT" 50; font-size: clamp(28px, 4vw, 40px); line-height: 1.08; letter-spacing: -0.015em; margin: 14px 0 10px; }
.pv-title em { color: var(--pv-green); font-style: italic; }
.pv-sub { font-size: 17px; line-height: 1.55; color: var(--pv-muted); margin: 0; }
.pv-h2 { font-family: 'Fraunces', Georgia, serif; font-weight: 450; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 6px; }
.pv-help { font-size: 14px; color: var(--pv-soft); }
.pv-muted { color: var(--pv-muted); }
.pv-small { font-size: 13px; }

/* Champs */
.pv-label { display: block; font-size: 14px; font-weight: 600; color: var(--pv-text); margin-bottom: 8px; }
.pv-field { position: relative; }
.pv-field > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--pv-soft); pointer-events: none; }
.pv-shell .pv-input { width: 100%; height: 58px; border: 2px solid var(--pv-border); border-radius: 14px; background: #fff; padding: 0 16px 0 48px; font: inherit; font-size: 17px; color: var(--pv-text); outline: none; transition: border-color .2s, box-shadow .2s; }
.pv-shell .pv-input:focus { border-color: var(--pv-green); box-shadow: 0 0 0 4px rgba(4,120,87,.12); }
.pv-input--sans-icone { padding-left: 16px; }
.pv-shell .pv-input.is-invalid { border-color: #dc2626; }
.pv-erreur { color: #b91c1c; font-size: 13px; margin-top: 6px; display: none; }
.pv-erreur.is-visible { display: block; }

/* Boutons (préfixés .pv-shell : le reset Tailwind [type=submit]{background-color:initial} a la même spécificité qu'une classe) */
.pv-shell .pv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 56px; padding: 0 28px; border-radius: 999px; border: 0;
  background: var(--pv-green); color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 0 12px 24px -12px rgba(4,120,87,.55); transition: background .2s, transform .15s, box-shadow .2s; }
.pv-shell .pv-btn:hover { background: var(--pv-green-dark); transform: translateY(-1px); }
.pv-shell .pv-btn:disabled, .pv-btn.is-disabled { background: #a8a29e; box-shadow: none; cursor: not-allowed; transform: none; }
.pv-shell .pv-btn svg { width: 18px; height: 18px; }
.pv-shell .pv-btn--block { width: 100%; }
.pv-shell .pv-btn--ghost { background: #fff; color: var(--pv-text); border: 1.5px solid var(--pv-border); box-shadow: none; }
.pv-shell .pv-btn--ghost:hover { background: var(--pv-field); transform: none; }
.pv-shell .pv-btn--lien { background: transparent; color: var(--pv-muted); box-shadow: none; padding: 0 8px; height: 44px; }
.pv-shell .pv-btn--lien:hover { background: transparent; color: var(--pv-text); transform: none; }
.pv-shell .pv-btn--sm { height: 44px; padding: 0 18px; font-size: 14px; }

/* Cartes d'option (une question à la fois) */
.pv-options { display: grid; gap: 12px; }
.pv-options--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .pv-options--2 { grid-template-columns: 1fr; } }
.pv-shell .pv-option { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 2px solid var(--pv-border); border-radius: 16px; background: #fff; cursor: pointer; text-align: left; font: inherit; color: var(--pv-text); transition: border-color .18s, background .18s, transform .18s; }
.pv-shell .pv-option:hover { border-color: #a7f3d0; background: var(--pv-mint); }
.pv-shell .pv-option.is-selected { border-color: var(--pv-green); background: var(--pv-mint); }
.pv-option-ico { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; background: var(--pv-field); display: inline-flex; align-items: center; justify-content: center; color: var(--pv-green); }
.pv-shell .pv-option.is-selected .pv-option-ico { background: var(--pv-green); color: #fff; }
.pv-option-txt { flex: 1; font-weight: 600; font-size: 16px; }
.pv-option-txt small { display: block; font-weight: 400; color: var(--pv-soft); font-size: 13px; margin-top: 2px; }
.pv-option-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--pv-border); display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.pv-shell .pv-option.is-selected .pv-option-radio { background: var(--pv-green); border-color: var(--pv-green); }
.pv-option-radio svg { width: 14px; height: 14px; }

/* Dossier immeuble */
.pv-dossier { overflow: hidden; }
.pv-dossier-media { position: relative; aspect-ratio: 16 / 10; background: var(--pv-field); overflow: hidden; }
.pv-dossier-media img, .pv-dossier-media .pv-map { position: absolute; inset: 0; width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; }
.pv-dossier-media .pv-map { background: #e7e5e4; }
.pv-dossier-media .pv-media-vide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--pv-soft); }
.pv-badge { position: absolute; z-index: 600; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.96); color: var(--pv-text); border: 1px solid var(--pv-border); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 8px 20px -10px rgba(28,25,23,.35); }
.pv-badge--tl { top: 12px; left: 12px; } .pv-badge--tr { top: 12px; right: 12px; } .pv-badge--bl { bottom: 12px; left: 12px; }
.pv-badge--vert { background: var(--pv-green); color: #fff; border-color: var(--pv-green); }
.pv-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--pv-green-2); display: inline-block; }
.pv-dossier-body { padding: 18px 20px 20px; }
.pv-dossier-titre { font-weight: 600; font-size: 17px; line-height: 1.25; }
.pv-dossier-adresse { font-size: 14px; color: var(--pv-muted); margin-top: 2px; }
.pv-lignes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.pv-ligne { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--pv-border); border-radius: 12px; background: #fff; }
.pv-ligne-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--pv-field); display: inline-flex; align-items: center; justify-content: center; color: var(--pv-green); }
.pv-ligne-ico svg { width: 18px; height: 18px; }
.pv-ligne-lib { font-size: 12px; color: var(--pv-soft); }
.pv-ligne-val { font-size: 15px; font-weight: 600; line-height: 1.2; }
.pv-ligne--fort { border-color: #a7f3d0; background: var(--pv-mint); }
.pv-ligne--fort .pv-ligne-ico { background: var(--pv-green); color: #fff; }
.pv-ligne.is-coche { animation: pv-in .35s ease both; }
.pv-dossier-note { margin-top: 14px; font-size: 12px; color: var(--pv-soft); line-height: 1.45; }
@media (max-width: 1023px) {
  .pv-dossier .pv-dossier-media { aspect-ratio: 21 / 10; }
  .pv-dossier .pv-lignes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pv-dossier--compact .pv-dossier-media { aspect-ratio: 21 / 8; }
  .pv-dossier-note { display: none; }
}

/* Carte Leaflet */
.pv-map .leaflet-container { background: #e7e5e4; font: inherit; }
.pv-map .leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.75); }
.pv-parcelle { stroke: #10b981; stroke-width: 3; fill: #10b981; fill-opacity: .18; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: pv-trace 1.6s ease-out forwards; }
.pv-point-marqueur { width: 18px; height: 18px; border-radius: 50%; background: var(--pv-green); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(16,185,129,.35); }
.pv-candidat { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid var(--pv-green); color: var(--pv-green); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px -8px rgba(28,25,23,.5); }
.pv-candidat.is-actif { background: var(--pv-green); color: #fff; }

/* Reconnaissance : séquence */
.pv-scan { position: absolute; inset: 0; z-index: 600; pointer-events: none; }
.pv-scan::before { content: ""; position: absolute; left: 0; right: 0; top: -20%; height: 20%; background: linear-gradient(180deg, rgba(16,185,129,0), rgba(16,185,129,.35)); animation: pv-scan 1.4s ease-in-out 1; }
.pv-fade-media { transition: opacity .6s ease; }
.pv-fade-media.is-cache { opacity: 0; }
.pv-statut { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--pv-muted); min-height: 24px; }
.pv-statut .pv-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--pv-border); border-top-color: var(--pv-green); animation: pv-spin .8s linear infinite; }
.pv-statut.is-ok { color: var(--pv-green); font-weight: 600; }

/* Preuves et réassurance */
.pv-preuves { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 14px; color: var(--pv-muted); }
.pv-preuves span { display: inline-flex; align-items: center; gap: 6px; }
.pv-preuves svg { width: 16px; height: 16px; color: var(--pv-green); }
.pv-avis { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--pv-border); }
.pv-avis-etoiles { color: #f59e0b; display: inline-flex; gap: 2px; }
.pv-avis-etoiles svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.pv-avis p { margin: 4px 0 0; font-size: 14px; color: var(--pv-muted); line-height: 1.45; }

/* Aperçu des devis (étape coordonnées) */
.pv-apercu { display: grid; gap: 10px; }
.pv-apercu-carte { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--pv-border); border-radius: 14px; background: #fff; }
.pv-apercu-logo { width: 44px; height: 44px; border-radius: 10px; background: var(--pv-field); flex: none; }
.pv-apercu-nom { flex: 1; }
.pv-apercu-nom i { display: block; height: 11px; border-radius: 6px; background: var(--pv-field); }
.pv-apercu-nom i + i { width: 55%; margin-top: 7px; }
.pv-flou { filter: blur(6px); -webkit-user-select: none; -moz-user-select: none; user-select: none; }
.pv-apercu-prix { text-align: right; }
.pv-apercu-prix b { display: block; font-size: 18px; letter-spacing: -0.01em; }
.pv-apercu-prix small { font-size: 12px; color: var(--pv-soft); }
.pv-fourchette { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pv-fourchette b { font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: 30px; letter-spacing: -0.01em; }

/* Animations */
.pv-in { animation: pv-in .45s cubic-bezier(.2,.7,.2,1) both; }
.pv-in-2 { animation-delay: .12s; } .pv-in-3 { animation-delay: .24s; } .pv-in-4 { animation-delay: .36s; } .pv-in-5 { animation-delay: .48s; }
@keyframes pv-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pv-trace { to { stroke-dashoffset: 0; } }
@keyframes pv-scan { from { top: -20%; } to { top: 100%; } }
@keyframes pv-spin { to { transform: rotate(360deg); } }
@keyframes pv-pop { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: none; } }
.pv-pop { animation: pv-pop .5s cubic-bezier(.2,1.2,.4,1) both; }
@media (prefers-reduced-motion: reduce) { .pv-in, .pv-pop, .pv-parcelle, .pv-scan::before, .pv-ligne.is-coche { animation: none !important; } .pv-parcelle { stroke-dashoffset: 0; } }

/* Code SMS */
.pv-code { display: flex; gap: 10px; justify-content: center; }
.pv-shell .pv-code input { width: 52px; height: 64px; text-align: center; font-size: 28px; font-weight: 600; border: 2px solid var(--pv-border); border-radius: 14px; outline: none; }
.pv-shell .pv-code input:focus { border-color: var(--pv-green); box-shadow: 0 0 0 4px rgba(4,120,87,.12); }
@media (max-width: 400px) { .pv-code input { width: 44px; height: 56px; font-size: 24px; } }

/* Résultats compacts (même esprit que l'animation de la home) */
.pv-resultat { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--pv-border); border-radius: 16px; background: #fff; }
.pv-resultat-logo { width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--pv-border); background: #fff; overflow: hidden; flex: none; display: flex; align-items: center; justify-content: center; }
.pv-resultat-logo img { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; }
.pv-resultat-main { flex: 1; min-width: 0; }
.pv-resultat-nom { font-weight: 600; font-size: 17px; }
.pv-resultat-meta { font-size: 13px; color: var(--pv-soft); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; }
.pv-resultat-prix { text-align: right; flex: none; }
.pv-resultat-prix b { display: block; font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: 24px; letter-spacing: -0.01em; }
.pv-resultat-prix small { font-size: 12px; color: var(--pv-soft); }
.pv-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 8px; }
.pv-tag--vert { background: var(--pv-green-3); color: var(--pv-green-dark); }
.pv-tag--ambre { background: var(--pv-amber-bg); color: var(--pv-amber); }

/* Étape adresse sur mobile : la carte aérienne en fond du haut d'écran, le
   formulaire posé dessus en chevauchement (sur ordinateur : grille inchangée) */
@media (max-width: 1023px) {
  .pv-adresse { display: flow-root; position: relative; }
  .pv-adresse-fond { position: absolute; left: -20px; right: -20px; top: -28px; height: 46vh; min-height: 300px; max-height: 420px; border: 0; border-radius: 0; box-shadow: none; overflow: hidden; }
  .pv-adresse-media { aspect-ratio: auto !important; height: 100%; }
  .pv-adresse-fond::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(180deg, rgba(250,250,249,0), rgba(250,250,249,.9)); pointer-events: none; z-index: 500; }
  .pv-adresse-carte { position: relative; z-index: 2; margin-top: calc(46vh - 28px - 150px); }
  .pv-adresse-carte .pv-title { font-size: clamp(26px, 7.5vw, 34px); }
  .pv-adresse-carte .pv-sub { font-size: 15px; }
  .pv-adresse-carte .pv-avis { display: none; }
}
@media (max-width: 1023px) and (max-height: 700px) {
  .pv-adresse-fond { height: 40vh; min-height: 240px; }
  .pv-adresse-carte { margin-top: calc(40vh - 28px - 130px); }
}

@media (max-width: 1023px) {
  .pv-adresse.is-saisie .pv-adresse-carte .pv-kicker, .pv-adresse.is-saisie .pv-adresse-carte .pv-sub, .pv-adresse.is-saisie .pv-adresse-carte .pv-preuves { display: none; }
  .pv-adresse.is-saisie .pv-adresse-carte .pv-title { font-size: 22px; margin: 0 0 10px; }
  .pv-adresse.is-saisie .pv-adresse-carte .pv-card-body { padding-top: 16px; }
  .pv-adresse.is-saisie .pv-adresse-carte { margin-top: calc(46vh - 28px - 70px); }
  .pv-adresse-carte { transition: margin-top .3s ease; }
}
