/* ==========================================================================
   TiDevis — page d'accueil
   ========================================================================== */

/* ---------- Ouverture ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(36px, 6vw, 80px) 0 clamp(56px, 8vw, 104px);
}
.hero::before {
  /* papier millimétré, comme une feuille de plan */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grille) 1px, transparent 1px),
    linear-gradient(90deg, var(--grille) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 70% 35%, #000 30%, transparent 78%);
          mask-image: radial-gradient(ellipse 90% 75% at 70% 35%, #000 30%, transparent 78%);
}
.hero-grille { position: relative; display: grid; gap: clamp(40px, 6vw, 72px); align-items: center; }
.hero h1 {
  font-size: clamp(2.5rem, 6.6vw, 4.6rem); font-weight: 850; font-stretch: 116%;
  letter-spacing: -0.038em; line-height: 0.97;
}
/* Hauteur du titre réservée selon la largeur (nombre de lignes avec Archivo, mesuré) : la page ne saute
   pas quand la police arrive après le premier affichage (la police de repli est plus étroite) */
.hero h1 { min-height: calc(4 * 0.97em); }
@media (min-width: 390px) { .hero h1 { min-height: calc(3 * 0.97em); } }
@media (min-width: 510px) { .hero h1 { min-height: calc(2 * 0.97em); } }
@media (min-width: 980px) { .hero h1 { min-height: calc(4 * 0.97em); } }
.surligne {
  background: linear-gradient(transparent 62%, var(--jaune) 62%, var(--jaune) 92%, transparent 92%);
  padding: 0 0.04em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
:root[data-theme="dark"] .surligne { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--jaune) 55%, transparent) 62%, color-mix(in srgb, var(--jaune) 55%, transparent) 92%, transparent 92%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .surligne { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--jaune) 55%, transparent) 62%, color-mix(in srgb, var(--jaune) 55%, transparent) 92%, transparent 92%); } }
.hero-intro { margin-top: 22px; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.55; color: var(--encre-2); max-width: 36em; }

.essai {
  margin-top: 28px; max-width: 580px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-4);
  box-shadow: var(--ombre-2); padding: 8px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.essai:focus-within { border-color: var(--encre); box-shadow: var(--ombre-2), var(--anneau); }
.essai-label { display: block; padding: 12px 14px 0; font-weight: 700; font-size: 0.9375rem; }
.essai textarea {
  border: 0; box-shadow: none !important; background: transparent; min-height: 96px; resize: none;
  padding: 8px 14px 10px; font-size: 1.0625rem;
}
.essai textarea:focus { box-shadow: none; }
.essai-pied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 6px; }
.essai-pied .btn-primaire { flex: 1 1 auto; }
.essai-exemple { color: var(--encre-2); font-size: 0.9688rem; padding: 8px 6px; }
.essai-note { padding: 0 14px 6px; color: var(--orange); font-size: 0.9063rem; font-weight: 550; }
@media (min-width: 520px) { .essai-pied .btn-primaire { flex: 0 0 auto; } }

.hero-preuves { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; }
.hero-preuves li { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.9688rem; color: var(--encre-2); }
.hero-preuves .ic { width: 18px; height: 18px; color: var(--vert); stroke-width: 2.4; }

/* Visuel : le PDF et l'outil sur téléphone */
.hero-visuel { position: relative; width: min(100%, 560px); margin-inline: auto; aspect-ratio: 560 / 600; }
.hero-pdf {
  position: absolute; left: 0; top: 4%; width: 68%;
  border-radius: 6px; overflow: hidden; background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(22, 24, 29, 0.08), 0 30px 60px -12px rgba(22, 24, 29, 0.28);
  transform: rotate(-3deg); transform-origin: 40% 60%;
}
.hero-pdf img { width: 100%; }
.telephone {
  position: absolute; right: 2%; bottom: 0; width: 46%;
  padding: 9px; border-radius: 38px; background: #0E0F12;
  box-shadow: 0 0 0 1px #2C2F36, 0 40px 80px -20px rgba(22, 24, 29, 0.55), 0 12px 24px rgba(22, 24, 29, 0.18);
}
.telephone::before {
  content: ""; position: absolute; top: 17px; left: 50%; transform: translateX(-50%);
  width: 26%; height: 15px; border-radius: 10px; background: #0E0F12; z-index: 2;
}
.telephone-ecran { position: relative; border-radius: 30px; overflow: hidden; background: #F6F4EE; aspect-ratio: 390 / 844; container-type: inline-size; }
.telephone-ecran img, .telephone-ecran video { position: absolute; left: 0; top: 5.2%; width: 100%; height: 94.8%; object-fit: cover; object-position: top; }
.telephone-ecran video { opacity: 0; transition: opacity 400ms ease; }
.telephone-ecran video.is-lue { opacity: 1; }
.telephone-statut {
  position: absolute; left: 0; right: 0; top: 0; height: 5.2%; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; padding: 0 10% 0 11%;
  background: #F6F4EE; color: #16181D; font-size: 4cqw; font-weight: 700; letter-spacing: 0.01em;
}
.telephone-batterie { width: 6.4cqw; height: 3cqw; border: 1.5px solid #16181D; border-radius: 3px; position: relative; }
.telephone-batterie::after { content: ""; position: absolute; inset: 1px; right: 25%; background: #16181D; border-radius: 1px; }
@media (min-width: 980px) {
  .hero-grille { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
  .hero-visuel { margin-right: -8px; }
}
@media (max-width: 979px) {
  .hero-visuel { width: min(100%, 470px); }
}
@media (max-width: 480px) {
  .telephone { border-radius: 30px; padding: 7px; }
  .telephone-ecran { border-radius: 24px; }
  .telephone::before { top: 13px; height: 12px; }
}

/* ---------- Métiers ---------- */
.metiers { padding: 0 0 clamp(40px, 6vw, 64px); }
.metiers-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 10px; }
.metiers-titre { font-weight: 700; font-size: 0.9375rem; color: var(--encre-2); margin-right: 6px; }
.metiers-ligne .chip { min-height: 34px; padding: 4px 14px; font-size: 0.9375rem; font-weight: 600; background: var(--surface); color: var(--encre); }
@media (max-width: 640px) { .metiers-ligne { gap: 8px; } .metiers-ligne .chip { min-height: 30px; padding: 3px 11px; font-size: 0.875rem; } .metiers-titre { width: 100%; } }

/* ---------- Comment ça marche ---------- */
.etapes { list-style: none; display: grid; gap: 20px; counter-reset: etape; }
.etape {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-4);
}
.etape-image { background: var(--surface-3); border-bottom: 1px solid var(--trait); aspect-ratio: 1 / 1; overflow: hidden; }
.etape-image img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.etape-texte { padding: 22px 22px 26px; }
.etape-numero {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--jaune); color: var(--sur-jaune); font-weight: 850; font-stretch: 112%; font-size: 1.0625rem;
  margin-bottom: 14px;
}
.etape h3 { font-size: 1.3125rem; font-weight: 780; font-stretch: var(--mi-large); }
.etape p { margin-top: 8px; color: var(--encre-2); }
.bloc-action { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.bloc-action.centre { justify-content: center; }
@media (min-width: 860px) { .etapes { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Le PDF (bande sombre) ---------- */
.bande { background: var(--bande); color: var(--sur-bande); }
.bande .section-tete p, .bande p { color: var(--sur-bande-2); }
.bande :focus-visible { outline-color: var(--jaune); }
.pdf-grille { display: grid; gap: clamp(36px, 6vw, 72px); align-items: center; }
.pdf-visuel { position: relative; max-width: 520px; width: 100%; margin-inline: auto; }
.pdf-visuel img {
  width: 100%; border-radius: 6px; background: #FFFFFF;
  box-shadow: 0 40px 80px -24px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.inclus-liste { list-style: none; display: grid; gap: 4px; margin-top: 28px; }
.inclus-liste li {
  display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start;
  padding: 14px 0; border-top: 1px solid var(--trait-bande);
}
.inclus-liste li:last-child { border-bottom: 1px solid var(--trait-bande); }
.inclus-liste .pastille { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--jaune) 16%, transparent); color: var(--jaune); }
.inclus-liste .pastille .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.inclus-liste strong { display: block; color: var(--sur-bande); font-weight: 700; }
.inclus-liste div > span { display: block; color: var(--sur-bande-2); font-size: 0.9688rem; margin-top: 2px; }
.pdf-intro { margin-top: 16px; font-size: 1.0625rem; max-width: 52ch; }
.badge-pro-bande { margin-left: 6px; vertical-align: 2px; }
.bande .btn-secondaire { --btn-fond: transparent; --btn-texte: var(--sur-bande); --btn-bord: var(--trait-bande); }
@media (hover: hover) { .bande .btn-secondaire:hover { background: rgba(255, 255, 255, 0.06); } }
@media (min-width: 900px) { .pdf-grille { grid-template-columns: 0.9fr 1fr; } }

/* ---------- Fonctions ---------- */
.fonctions { display: grid; gap: 1px; background: var(--trait); border: 1px solid var(--trait); border-radius: var(--r-4); overflow: hidden; }
.fonction { background: var(--surface); padding: 22px 22px 24px; }
.fonction-tete { display: flex; align-items: center; gap: 12px; }
.fonction .pastille { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--jaune-pale); color: var(--encre); }
.fonction .pastille .ic { width: 22px; height: 22px; }
.fonction h3 { font-size: 1.0938rem; font-weight: 750; }
.fonction p { margin-top: 10px; font-size: 0.9688rem; color: var(--encre-2); }
@media (min-width: 640px) { .fonctions { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .fonctions { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Tarifs ---------- */
.periode { display: flex; justify-content: center; margin-bottom: 28px; }
.periode .segments { min-width: min(100%, 380px); grid-auto-columns: auto; grid-template-columns: 1fr auto; }
.periode .segments span { white-space: nowrap; }
@media (max-width: 359px) { .periode .segments { grid-template-columns: 1fr 1fr; } .periode .segments span { white-space: normal; padding: 6px 8px; } }
.periode .economie { font-style: normal; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: var(--jaune); color: var(--sur-jaune); font-size: 0.75rem; font-weight: 750; }
.offres { display: grid; gap: 20px; align-items: start; max-width: 980px; margin-inline: auto; }
.offre-carte {
  position: relative; display: flex; flex-direction: column; gap: 18px;
  padding: 28px 24px; border-radius: var(--r-4);
  background: var(--surface); border: 1px solid var(--trait);
}
.offre-pro { border: 2px solid var(--encre); box-shadow: var(--ombre-2); }
.offre-carte h3 { font-size: 1.25rem; font-weight: 780; font-stretch: var(--mi-large); display: flex; align-items: center; gap: 10px; }
.offre-prix { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.offre-prix .montant { font-size: clamp(2.6rem, 5vw, 3.25rem); font-weight: 850; font-stretch: 112%; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.offre-prix .periode-texte { color: var(--encre-2); font-weight: 550; }
.offre-sous { color: var(--encre-3); font-size: 0.9375rem; margin-top: -8px; }
.offre-texte { color: var(--encre-2); }
.offre-carte .btn { width: 100%; }
.inclus { list-style: none; display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--trait-doux); }
.inclus li { position: relative; padding-left: 30px; color: var(--encre-2); font-size: 0.9875rem; line-height: 1.45; }
.inclus li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 6px;
  background: var(--vert-pale) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23136C43' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.offre-pro .inclus li::before { background-color: var(--jaune); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316181D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E"); }
.offre-limites { font-size: 0.9063rem; color: var(--encre-3); }
.offre-fondateur {
  position: relative; padding: 20px 16px 14px; border-radius: var(--r-2);
  background: var(--jaune-pale); color: var(--encre); font-size: 0.9375rem; line-height: 1.5; overflow: hidden;
}
.offre-fondateur::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--rayures); }
.tarifs-note { max-width: 760px; margin: 28px auto 0; text-align: center; font-size: 0.875rem; color: var(--encre-3); }
/* Choix mois / année sans script : on montre le prix et le bouton de la période cochée */
.section-tarifs:has(#periode-annee:checked) .si-mois { display: none !important; }
.section-tarifs:not(:has(#periode-annee:checked)) .si-annee { display: none !important; }
@media (min-width: 820px) { .offres { grid-template-columns: 0.9fr 1.1fr; } .offre-carte { padding: 32px 30px; } }

/* ---------- Questions ---------- */
.faq-grille { display: grid; gap: 32px; }
.faq { border-top: 1px solid var(--trait); }
.faq details { border-bottom: 1px solid var(--trait); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 14px 4px; cursor: pointer; list-style: none;
  font-weight: 680; font-size: 1.0625rem; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316181D' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 16px no-repeat;
  transition: transform var(--transition), background-color var(--transition);
}
:root[data-theme="dark"] .faq summary::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F3F1EA' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .faq summary::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F3F1EA' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E"); } }
.faq details[open] summary::after { transform: rotate(45deg); background-color: var(--jaune); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316181D' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E"); }
@media (hover: hover) { .faq summary:hover { color: var(--encre); } }
.faq .reponse { padding: 0 44px 22px 4px; color: var(--encre-2); }
.faq .reponse p + p { margin-top: 10px; }
@media (min-width: 900px) { .faq-grille { grid-template-columns: 0.75fr 1.25fr; gap: 64px; } .faq-grille .section-tete { position: sticky; top: calc(var(--entete-h) + 24px); align-self: start; } }

/* ---------- Testeurs ---------- */
.testeurs-grille { display: grid; gap: 36px; align-items: start; }
.avantages { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.avantages li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.avantages .ic { width: 22px; height: 22px; color: var(--encre); background: var(--jaune); border-radius: 7px; padding: 3px; stroke-width: 2.6; flex: none; }
.form-card {
  display: flex; flex-direction: column; gap: 18px;
  padding: clamp(20px, 4vw, 32px); border-radius: var(--r-4);
  background: var(--surface); border: 1px solid var(--trait); box-shadow: var(--ombre-2);
}
.form-row { display: grid; gap: 18px; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
@media (min-width: 940px) { .testeurs-grille { grid-template-columns: 0.85fr 1.15fr; gap: 64px; } }

/* ---------- Appel final (bande jaune) ---------- */
.cta-finale { background: var(--jaune); color: var(--sur-jaune); padding: clamp(56px, 8vw, 96px) 0; position: relative; overflow: hidden; }
.cta-finale::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: repeating-linear-gradient(-45deg, #16181D 0 10px, transparent 10px 20px); opacity: 0.9; }
.cta-finale-grille { display: grid; gap: 28px; align-items: center; }
.cta-finale h2 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 850; font-stretch: 118%; letter-spacing: -0.035em; line-height: 1.0; max-width: 16ch; }
.cta-finale p { margin-top: 16px; font-size: 1.125rem; max-width: 46ch; color: #2C2E33; }
.cta-finale-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-finale .btn-encre { --btn-fond: #16181D; --btn-texte: #FFC21A; --btn-bord: #16181D; }
@media (hover: hover) { .cta-finale .btn-encre:hover { background: #2A2D34; } }
.cta-finale .btn-secondaire { --btn-fond: transparent; --btn-texte: #16181D; --btn-bord: #16181D; }
@media (hover: hover) { .cta-finale .btn-secondaire:hover { background: rgba(22, 24, 29, 0.08); } }
.cta-finale :focus-visible { outline-color: #16181D; }
@media (min-width: 900px) { .cta-finale-grille { grid-template-columns: 1.3fr auto; } }
