/* ============================================================
   Simulateur DPE 2027 — page autonome, aucune dépendance.
   Palette : charcoal #1f2937 · vert #059669
   Les hexagones utilisent la palette officielle de l'étiquette
   DPE 2021, une couleur par lettre.
   ============================================================ */

:root {
  --charcoal: #1f2937;
  --vert: #059669;
  --vert-fonce: #047857;
  --texte: #1a1a1a;
  --texte-doux: #666;
  --texte-tenu: #999;
  --bordure: #d0d0d0;
  --separateur: #d1d5db;
  --fond: #fdfdfc;
  --orange-marque: #ff6600;

  --hex-largeur: 178px;
  --hex-hauteur: 200px;

  --sortie: cubic-bezier(0.16, 1, 0.3, 1);
  --flottement: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page { max-width: 900px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

/* --------------------------------------------------- 0. MARQUE */

.marque {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 0.5rem 1.25rem; margin-bottom: 2rem;
  animation: fade-up 0.3s ease-out both;
}
.marque__lien {
  font-size: 1.1rem; font-weight: 800; letter-spacing: 0.25em;
  color: var(--charcoal); text-decoration: none;
}
.marque__initiale { color: var(--orange-marque); }
.marque__lien:focus-visible { outline: 2px solid var(--vert); outline-offset: 4px; }
.marque__lieu {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.15em; color: var(--texte-tenu);
}

.retour {
  display: inline-block; margin-bottom: 3rem;
  font-size: 0.8rem; color: var(--texte-tenu); text-decoration: none;
  animation: fade-up 0.3s ease-out both;
}
.retour:hover { color: var(--vert); }
.retour:focus-visible { outline: 2px solid var(--vert); outline-offset: 3px; }

/* ----------------------------------------------------- 1. HERO */

.hero {
  max-width: 650px; margin: 0 auto; text-align: center;
  animation: fade-up 0.3s ease-out 0.1s both;
}
.hero__title {
  margin: 0 0 1rem; font-size: 2.8rem; font-weight: 800;
  line-height: 1.1; letter-spacing: -0.02em; color: var(--charcoal);
}
.hero__subtitle {
  margin: 0; font-size: 1.05rem; font-weight: 400;
  line-height: 1.6; color: var(--texte-doux);
}
.hero__subtitle sup { font-size: 0.65em; vertical-align: 0.45em; }

/* --------------------------------------------- 2. SAISIE ADEME */

.search { max-width: 500px; margin: 3rem auto 0; animation: fade-up 0.3s ease-out 0.2s both; }

.search__label {
  display: block; margin-bottom: 0.5rem; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--charcoal);
}
.search__row { display: flex; gap: 0.75rem; align-items: stretch; }

.search__input {
  flex: 1; min-width: 0; padding: 1rem; font: inherit; font-size: 1rem;
  color: var(--texte); background: #fff; border: 1px solid var(--bordure);
  border-radius: 0; outline: none; transition: border-color 0.3s ease;
}
.search__input::placeholder { color: #b4b4b4; }
.search__input:focus {
  border-color: #b0b0b0;
  box-shadow: inset 0 -2px 0 0 var(--vert);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search__button {
  flex: 0 0 auto; min-height: 44px; padding: 1rem 1.75rem;
  font: inherit; font-weight: 600; color: #fff;
  background: var(--charcoal); border: 1px solid var(--charcoal);
  border-radius: 0; cursor: pointer;
  transition: background 0.35s var(--sortie), transform 0.35s var(--sortie), border-color 0.35s var(--sortie);
}
.search__button:hover:not(:disabled) {
  background: var(--vert-fonce); border-color: var(--vert-fonce); transform: translateY(-2px);
}
.search__button:focus-visible { outline: 2px solid var(--vert); outline-offset: 2px; }
.search__button:disabled { opacity: 0.4; cursor: not-allowed; }

.search__aide { margin: 0.75rem 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--texte-tenu); }
.search__aide a { color: var(--vert); text-decoration: underline; text-underline-offset: 2px; }

.search__status { min-height: 1.5rem; margin: 0.5rem 0 0; font-size: 0.9rem; }
.search__error { color: #b91c1c; }

/* ------------------------------------- 3. COMPARAISON AV/APRÈS */

.results { margin-top: 4rem; }

.results__bien {
  margin: 0 0 2.5rem; text-align: center; font-size: 0.85rem;
  letter-spacing: 0.02em; color: var(--texte-doux);
  animation: fade-up 0.3s ease-out both;
}

.comparison {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; max-width: 800px; margin: 0 auto;
}

.hexagon-badge { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hexagon-badge--current { animation: slide-in-left 0.4s ease-out both; }
.hexagon-badge--future { animation: fade-in 0.2s linear 0.6s both; }

.hexagon-badge__label {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--texte-tenu);
}
.hexagon-badge--future .hexagon-badge__label { color: var(--vert); }

.hexagon-badge__figure {
  position: relative; width: var(--hex-largeur); height: var(--hex-hauteur);
  display: grid; place-items: center; transition: transform 0.35s var(--sortie);
}
.hexagon-badge__svg {
  width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
}
.hexagon-badge--future .hexagon-badge__svg {
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.18));
  animation: hex-bounce 0.6s var(--sortie) 0.6s both;
  transform-origin: 50% 50%;
}
.hexagon-badge__classe {
  position: absolute; font-size: 5rem; font-weight: 800;
  line-height: 1; letter-spacing: -0.03em;
}
.hexagon-badge__desc { margin-top: 0.25rem; font-size: 0.9rem; color: var(--texte-doux); }
.hexagon-badge--future .hexagon-badge__desc { color: var(--vert); font-weight: 500; }

.hexagon-badge--tone-neutral .hexagon-badge__svg { filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1)); }
.hexagon-badge--tone-neutral .hexagon-badge__desc { color: var(--texte-doux); font-weight: 400; }

.transition { position: relative; width: 300px; height: 120px; }
.transition__arc { width: 100%; height: 100%; overflow: visible; }
.transition__path {
  stroke-dasharray: 260; stroke-dashoffset: 260;
  animation: draw-arc 0.35s ease-out 0.2s forwards;
}

.particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute; top: 45%; left: 50%; width: 4px; height: 4px;
  background: var(--vert); border-radius: 50%; opacity: 0;
  animation: particle-float 0.4s var(--flottement) both;
}

/* ------------------------------------------ 4. IMPACT (DELTA) */

.delta {
  max-width: 600px; margin: 3.5rem auto 0; padding: 2rem;
  background: #fff; border-left: 4px solid var(--vert);
  animation: fade-up 0.6s ease-out 0.8s both;
}
.delta__title {
  margin: 0 0 1.5rem; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--vert);
}
.delta__grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2rem; align-items: center; }
.delta__metric { display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-start; }
.delta__icon { width: 16px; height: 16px; fill: var(--vert); }
.delta__label { font-size: 0.9rem; color: var(--texte-doux); }
.delta__value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; color: var(--vert); }
.delta__value--stable { color: var(--charcoal); }
.delta__sub { font-size: 0.8rem; color: var(--texte-tenu); }
.delta__separator { width: 1px; height: 60px; background: var(--separateur); }
.delta__note { margin: 1.5rem 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--texte-tenu); }

/* ------------------------------------ 4bis. CAPTURE D'E-MAIL */

.lead {
  max-width: 600px; margin: 1.5rem auto 0; padding: 2rem;
  background: var(--charcoal); color: #fff;
  animation: fade-up 0.6s ease-out 1s both;
}
.lead__title { margin: 0 0 0.5rem; font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.lead__text { margin: 0 0 1.5rem; font-size: 0.9rem; line-height: 1.6; color: #cbd5e1; }
.lead__form { display: flex; flex-direction: column; gap: 0.75rem; }
.lead__input {
  width: 100%; padding: 0.85rem 1rem; font: inherit; font-size: 1rem;
  color: #fff; background: transparent; border: 1px solid #4b5563;
  border-radius: 0; outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.lead__input::placeholder { color: #7b8794; }
.lead__input:focus { border-color: #6b7280; box-shadow: inset 0 -2px 0 0 var(--vert); }
.lead__input[aria-invalid="true"] { border-color: #f87171; }
.lead__button {
  width: 100%; min-height: 44px; padding: 0.85rem 1.5rem;
  font: inherit; font-weight: 600; color: #fff;
  background: var(--vert); border: 1px solid var(--vert);
  border-radius: 0; cursor: pointer;
  transition: background 0.35s var(--sortie), transform 0.35s var(--sortie), border-color 0.35s var(--sortie);
}
.lead__button:hover { background: var(--vert-fonce); border-color: var(--vert-fonce); transform: translateY(-2px); }
.lead__button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lead__error { margin: 0.75rem 0 0; font-size: 0.85rem; color: #fca5a5; }
.lead__rgpd { margin: 1rem 0 0; font-size: 0.75rem; line-height: 1.6; color: #9aa5b1; }
.lead--sent { border-left: 4px solid var(--vert); }
.lead__confirmation { margin: 0; font-size: 0.95rem; line-height: 1.6; }
.lead__confirmation strong { color: #6ee7b7; font-weight: 600; word-break: break-all; }

/* --------------------------------------------------- 5. CTA */

.cta { margin-top: 5rem; text-align: center; animation: fade-up 0.3s ease-out 0.4s both; }
.cta__text { margin: 0 0 1rem; font-size: 0.9rem; color: var(--texte-tenu); }
.cta__actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: center; }
.cta__tel {
  font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--charcoal); text-decoration: none;
  border-bottom: 2px solid var(--vert); padding-bottom: 2px;
  transition: color 0.35s var(--sortie);
}
.cta__tel:hover { color: var(--vert); }
.cta__button {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0.75rem 1.75rem; font-weight: 600; color: var(--charcoal);
  text-decoration: none; background: transparent;
  border: 1px solid var(--charcoal); transition: background 0.35s var(--sortie);
}
.cta__button:hover { background: #f5f5f5; }
.cta__button:focus-visible, .cta__tel:focus-visible { outline: 2px solid var(--vert); outline-offset: 3px; }
.cta__mentions { max-width: 560px; margin: 2.5rem auto 0; font-size: 0.75rem; line-height: 1.6; color: #adadad; }

/* ------------------------------------------- 6. PIED DE PAGE */

.pied { margin-top: 5rem; padding-top: 3rem; border-top: 1px solid #e5e5e5; }
.pied__grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 2.5rem; }
.pied__marque { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 800; letter-spacing: 0.22em; color: var(--charcoal); }
.pied__titre {
  margin: 0 0 0.75rem; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--charcoal);
}
.pied__ligne { margin: 0 0 0.4rem; font-size: 0.85rem; line-height: 1.6; color: var(--texte-doux); }
.pied__lien { color: var(--texte-doux); text-decoration: none; border-bottom: 1px solid #d8d8d8; }
.pied__lien:hover { color: var(--vert); border-bottom-color: var(--vert); }
.pied__dl { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.85rem; margin: 0; font-size: 0.8rem; line-height: 1.5; }
.pied__dl dt { color: var(--texte-tenu); }
.pied__dl dd { margin: 0; color: var(--texte-doux); }

.legal { margin-top: 3rem; border-top: 1px solid #ededed; }
.legal__bloc { border-bottom: 1px solid #ededed; }
.legal__titre {
  padding: 1rem 0; font-size: 0.85rem; font-weight: 600;
  color: var(--charcoal); cursor: pointer; list-style: none;
}
.legal__titre::-webkit-details-marker { display: none; }
.legal__titre::before { content: "+"; display: inline-block; width: 1.25rem; font-weight: 400; color: var(--vert); }
.legal__bloc[open] .legal__titre::before { content: "−"; }
.legal__titre:focus-visible { outline: 2px solid var(--vert); outline-offset: 2px; }
.legal__corps {
  max-width: 68ch; padding: 0 0 1.75rem 1.25rem;
  font-size: 0.82rem; line-height: 1.7; color: var(--texte-doux);
}
.legal__corps h3 {
  margin: 1.5rem 0 0.4rem; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--charcoal);
}
.legal__corps h3:first-child { margin-top: 0; }
.legal__corps p, .legal__corps ul { margin: 0 0 0.75rem; }
.legal__corps ul { padding-left: 1.1rem; }
.legal__corps li { margin-bottom: 0.3rem; }
.legal__corps strong { color: var(--charcoal); }
.legal__mediateur { padding-left: 1rem; border-left: 2px solid var(--separateur); }
.legal__lien { color: var(--vert); text-decoration: underline; text-underline-offset: 2px; }

.pied__copyright { margin: 2rem 0 0; font-size: 0.72rem; line-height: 1.6; color: var(--texte-tenu); }

/* ------------------------------------------------ KEYFRAMES */

@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in-left { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes hex-bounce { 0% { transform: scale(0.8); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes draw-arc { to { stroke-dashoffset: 0; } }
@keyframes particle-float {
  0% { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.4); }
}

/* --------------------------------------------- INTERACTIONS */

@media (hover: hover) and (min-width: 768px) {
  .hexagon-badge__figure:hover { transform: scale(1.05); }
  .hexagon-badge__figure:hover .hexagon-badge__svg { filter: drop-shadow(0 8px 24px rgba(0,0,0,0.16)); }
  .hexagon-badge--future .hexagon-badge__figure:hover .hexagon-badge__svg { filter: drop-shadow(0 10px 30px rgba(0,0,0,0.26)); }
}

/* ----------------------------------------------- RESPONSIVE */

@media (max-width: 767px) {
  :root { --hex-largeur: 120px; --hex-hauteur: 135px; }
  .page { padding: 2rem 1.25rem 3rem; }
  .hero__title { font-size: 2rem; }
  .hero__subtitle { font-size: 1rem; }
  .search__row { flex-direction: column; }
  .search__button { width: 100%; justify-content: center; }
  .comparison { grid-template-columns: 1fr; gap: 2.5rem; }
  .transition { display: none; }
  .hexagon-badge__classe { font-size: 3.4rem; }
  .marque { margin-bottom: 1.5rem; }
  .retour { margin-bottom: 2rem; }
  .delta { padding: 1.5rem; }
  .lead { padding: 1.5rem; }
  .delta__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .delta__separator { width: 100%; height: 1px; }
}

@media (max-width: 640px) { .hero__title { font-size: 1.85rem; } }

/* ------------------------------- PRÉFÉRENCE DE MOUVEMENT */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .transition__path { stroke-dashoffset: 0; }
  .hexagon-badge__figure:hover { transform: none; }
}
