@import url('/assets/fonts/fonts.css');

:root {
  --bleu-nuit: #0F1E3D;
  --bleu: #1B3064;
  --bleu-clair: #3D6CB8;
  --rouge: #C8232C;
  --rouge-fonce: #A01B22;
  --texte: #141728;
  --texte-doux: #3A3D4E;
  --fond: #FFFFFF;
  --fond-doux: #F4F5F8;
  --bord: #CDD0D8;
  --rayon: 12px;
  --largeur: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Libre Franklin', system-ui, sans-serif;
  font-size: 1.125rem;            /* 18 px */
  line-height: 1.6;
  color: var(--texte);
  background: var(--fond);
  overflow-wrap: break-word;
}
h1, h2, h3 { font-family: 'Lora', Georgia, serif; line-height: 1.2; color: var(--bleu-nuit); margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.25rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--bleu); }
:focus-visible { outline: 3px solid var(--rouge); outline-offset: 3px; }

.conteneur { max-width: var(--largeur); margin: 0 auto; padding: 0 16px; }
.section { padding: 64px 0; }
.section--douce { background: var(--fond-doux); }

.lien-evitement { position: absolute; left: -9999px; }
.lien-evitement:focus { left: 16px; top: 16px; background: #fff; padding: 12px; z-index: 10; }

/* En-tête */
.site-header { border-bottom: 1px solid var(--bord); background: var(--fond); }
.site-header .conteneur { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; font-family: 'Lora', Georgia, serif; font-weight: 700; font-size: 1.6rem; letter-spacing: .08em; color: var(--bleu-nuit); text-decoration: none; }
.logo img { width: 44px; height: 44px; flex: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 48px; color: var(--texte-doux); text-decoration: none; font-weight: 600; }
.site-header nav a:hover { color: var(--rouge); }
@media (max-width: 599px) {
  .site-header nav a:not(:first-child) { display: none; }   /* mobile : seul « Estimer ma valeur » reste */
}

/* Pied de page */
.site-footer { background: var(--bleu-nuit); color: #fff; padding: 40px 0; }
.site-footer a { color: #fff; display: inline-flex; min-height: 48px; align-items: center; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 0 24px; }
.site-footer p { margin: 0; color: #D6DAE4; }

/* Haut de page */
.hero { background: linear-gradient(160deg, var(--bleu-nuit) 0%, var(--bleu) 70%); color: #fff; padding: 20px 0 32px; }
.hero h1 { color: #fff; font-size: clamp(1.75rem, 6vw, 3.25rem); margin-bottom: .3em; }
.hero__grille { display: grid; gap: 16px; }
.surtitre { text-transform: uppercase; letter-spacing: .12em; font-size: 1.125rem; font-weight: 700; color: #F3B4B7; margin: 0 0 .4em; }
.hero__sous-titre { font-size: 1.2rem; margin-bottom: .4em; }
.hero__fort { font-weight: 700; margin-bottom: 0; }
.hero__mobile-texte { display: none; }
.hero__mobile-texte p { margin: 0 0 .5em; }

.mini-sim { background: #fff; color: var(--texte); border-radius: var(--rayon); padding: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.25); display: grid; gap: 6px; }
.mini-sim__titre { font-family: 'Lora', Georgia, serif; font-weight: 700; font-size: 1.25rem; color: var(--bleu-nuit); margin: 0 0 4px; }
.mini-sim label { font-weight: 600; }
.mini-sim select {
  width: 100%; min-height: 52px; font: inherit; color: var(--texte);
  border: 2px solid var(--bord); border-radius: 8px; padding: 8px 12px; background: #fff; margin-bottom: 6px;
}
.mini-sim button, .bouton {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 56px; width: 100%; padding: 12px 20px; font: inherit; font-weight: 700; font-size: 1.15rem;
  color: #fff; background: var(--rouge); border: 0; border-radius: 8px; cursor: pointer; text-decoration: none;
}
.mini-sim button:hover, .bouton:hover { background: var(--rouge-fonce); }
.mini-sim__note { margin: 4px 0 0; text-align: center; color: var(--texte-doux); font-size: 1.125rem; }

.reassurance { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 28px; font-weight: 600; }
.reassurance li::before { content: "✓ "; color: #F3B4B7; }

@media (max-width: 859px) {
  .hero__sous-titre, .hero__fort {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .hero__mobile-texte { display: block; }
}
@media (min-width: 860px) {
  .hero { padding: 64px 0; }
  .hero__grille { grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
  .mini-sim { padding: 28px; }
}

/* Méthode */
.etapes { list-style: none; counter-reset: etape; padding: 0; margin: 0 0 24px; display: grid; gap: 24px; }
.etapes li { counter-increment: etape; position: relative; padding-left: 64px; }
.etapes li::before {
  content: counter(etape); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%;
  background: var(--bleu); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 1.2rem;
}
.mention { color: var(--texte-doux); font-style: italic; border-left: 4px solid var(--rouge); padding-left: 16px; }

/* Questions */
.cartes { display: grid; gap: 16px; }
.carte { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 24px; }
.carte p { margin: 0; color: var(--texte-doux); }

/* Confidentialité */
.engagements { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.engagements li { position: relative; padding-left: 36px; }
.engagements li::before { content: "✓"; position: absolute; left: 0; color: var(--rouge); font-weight: 700; }

@media (min-width: 700px) { .cartes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) {
  .etapes { grid-template-columns: repeat(3, 1fr); }
  .etapes li { padding: 64px 0 0; }
  .cartes { grid-template-columns: repeat(3, 1fr); }
  .engagements { grid-template-columns: repeat(2, 1fr); }
}

.conteneur--etroit { max-width: 820px; }
#faq details { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); margin-bottom: 12px; }
#faq summary { cursor: pointer; min-height: 56px; padding: 14px 48px 14px 20px; font-weight: 700; list-style: none; position: relative; }
#faq summary::-webkit-details-marker { display: none; }
#faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--rouge); }
#faq details[open] summary::after { content: "−"; }
#faq .reponse { padding: 0 20px 16px; color: var(--texte-doux); }
.rappel { text-align: center; }
.rappel__titre { font-family: 'Lora', Georgia, serif; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; color: var(--bleu-nuit); }
.rappel .bouton { max-width: 480px; }

.page-legale h2 { font-size: 1.35rem; margin-top: 1.6em; }
.page-legale ul { padding-left: 1.2em; }

/* Texte agrandi (réglage Android à 200 %) : autoriser les éléments de grille à rétrécir sous la largeur du plus long mot */
.etapes li, .carte, .engagements li { min-width: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }

/* Simulateur */
.surtitre--sombre { color: var(--rouge); }
.resultat__nature { font-weight: 600; color: var(--texte-doux); }
.mini-sim--page { box-shadow: none; border: 1px solid var(--bord); max-width: 560px; }
.page-simulateur h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
.page-simulateur .bouton { max-width: 520px; }
.formulaire fieldset { border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px 20px 8px; margin: 0 0 24px; min-width: 0; }
.formulaire legend { font-family: 'Lora', Georgia, serif; font-weight: 700; font-size: 1.3rem; color: var(--bleu-nuit); padding: 0 6px; }
.champ { margin-bottom: 20px; }
.champ > label, .champ > .question { display: block; font-weight: 600; margin-bottom: 6px; }
.champ .aide { color: var(--texte-doux); margin: 4px 0 0; }
.facultatif { font-weight: 400; color: var(--texte-doux); }
.case { display: flex; gap: 12px; align-items: flex-start; min-height: 48px; margin-bottom: 16px; cursor: pointer; }
.erreur { color: var(--rouge-fonce); font-weight: 700; margin: 6px 0 0; }
.avertissement { background: #FFF6E0; border-left: 4px solid #B7791F; padding: 12px 16px; margin: 6px 0 0; }
.resume-erreurs { background: #FDECEC; border-left: 4px solid var(--rouge); padding: 12px 16px; margin-bottom: 24px; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fourchette { font-family: 'Lora', Georgia, serif; font-size: clamp(1.8rem, 6vw, 2.8rem); font-weight: 700; color: var(--bleu-nuit); margin: .2em 0; }
.calcul { width: 100%; border-collapse: collapse; margin: 16px 0 24px; }
.calcul th, .calcul td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.calcul { table-layout: fixed; }
.calcul th { overflow-wrap: anywhere; }
.calcul td:last-child { text-align: right; width: 40%; }
.sources li { margin-bottom: 8px; }
.encart { background: var(--fond-doux); border-radius: var(--rayon); padding: 20px; margin: 24px 0; }
@media print {
  .site-header nav, .site-footer, .ne-pas-imprimer, .lien-evitement { display: none !important; }
  body { font-size: 12pt; }
  .section { padding: 0; }
}

.bouton--secondaire { background: #fff; color: var(--bleu-nuit); border: 2px solid var(--bleu-nuit); }
.bouton--secondaire:hover { background: var(--fond-doux); }

/* Champs de formulaire : rendu propre au site (remplace l'apparence native du navigateur) */
.page-simulateur main { background: var(--fond-doux); }
.champ input[type=text], .champ input[type=email], .champ input[type=tel], .champ input[type=password],
.champ select, .mini-sim select {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-height: 56px; font: inherit; color: var(--texte); background-color: #fff;
  border: 1.5px solid #B9BFCC; border-radius: 10px; padding: 12px 16px; margin-bottom: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.champ input::placeholder { color: #767C8C; opacity: 1; }
.champ input:hover, .champ select:hover, .mini-sim select:hover { border-color: #767C8C; }
.champ input:focus, .champ select:focus, .mini-sim select:focus {
  outline: none; border-color: var(--bleu); box-shadow: 0 0 0 4px rgba(27, 48, 100, .16);
}
.champ select, .mini-sim select {
  padding-right: 48px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231B3064' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center;
}
.mini-sim select { margin-bottom: 8px; }
.champ--erreur input, .champ--erreur select { border-color: var(--rouge); }
.saisie-montant { position: relative; }
.saisie-montant input { padding-right: 48px; }
.suffixe { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--texte-doux); font-weight: 600; pointer-events: none; }

.facultatif {
  display: inline-block; margin-left: 8px; padding: 0 10px; border-radius: 999px;
  background: #E9ECF2; color: var(--texte-doux); font-weight: 600; font-size: 1.125rem; line-height: 1.6; vertical-align: baseline;
}

/* Tuiles de choix (boutons radio) */
/* Mobile : tuiles pleine largeur ; grille dès que la place le permet. Réponses longues : une colonne. */
.choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.choix--long { grid-template-columns: 1fr; }
@media (min-width: 700px) { .choix--long { grid-template-columns: repeat(2, 1fr); } }
.choix label {
  /* grille : le libellé prend toute la largeur restante (en flex, il revenait à la ligne à chaque mot) */
  display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px;
  border: 1.5px solid #B9BFCC; border-radius: 10px; background: #fff; cursor: pointer; font-weight: 600;
  transition: border-color .15s ease, background-color .15s ease;
}
.choix label > span { min-width: 0; }
.choix label:hover { border-color: #767C8C; }
.choix label:has(input:checked) { border-color: var(--bleu); background: #EEF3FB; box-shadow: inset 0 0 0 1px var(--bleu); }
.choix input[type=radio] {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0;
  width: 24px; height: 24px; border: 2px solid #767C8C; border-radius: 50%; background: #fff; cursor: pointer;
}
.choix input[type=radio]:checked { border-color: var(--bleu); background: radial-gradient(circle, var(--bleu) 0 5px, #fff 6px); }
.choix input:focus-visible, .case input:focus-visible { outline: 3px solid var(--rouge); outline-offset: 3px; }

/* Cases à cocher */
.case { padding: 14px 16px; border: 1.5px solid #B9BFCC; border-radius: 10px; background: #fff; }
.case:has(input:checked) { border-color: var(--bleu); background: #EEF3FB; }
.case input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none; margin: 2px 0 0;
  width: 26px; height: 26px; border: 2px solid #767C8C; border-radius: 6px; background: #fff center / 16px no-repeat; cursor: pointer;
}
.case input[type=checkbox]:checked {
  background-color: var(--bleu); border-color: var(--bleu);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12' viewBox='0 0 16 12'%3E%3Cpath d='M1.5 6l4.5 4.5L14.5 1.5' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Blocs de questions en cartes */
.formulaire fieldset { background: #fff; border: 1px solid var(--bord); border-radius: 14px; padding: 24px 20px 8px; box-shadow: 0 2px 12px rgba(15, 30, 61, .06); }
.formulaire legend { float: left; width: 100%; padding: 0; margin: 0 0 18px; font-size: 1.35rem; }
.formulaire legend + * { clear: both; }
.formulaire > .champ, .formulaire > .case { max-width: 640px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
.sources__titre { font-size: 1.3rem; margin-top: 1.6em; }
