/* Identité du test alignée sur la landing (29/09/2026) : Montserrat, un seul vert, surligneur jaune. */
:root {
  --ink: #10231b;
  --muted: #56615b;
  --line: #e1e7e3;
  --line-strong: #b9c4be;
  --accent: #0e8541;
  --accent-dark: #0a6632;
  --accent-soft: #eef7f2;
  --control-radius: 10px;
  --marker: #ffe14d;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
}
body, button, input, select, textarea { font-family: inherit; }
.site-header { font-family: inherit; }

/* Progression : même vert, barre arrondie, fond blanc */
.quiz-progress { border-bottom: 1px solid var(--line); background: #fff; }
.quiz-progress-copy strong { color: var(--ink); font-weight: 800; }
.quiz-progress-copy strong.complete { color: var(--accent); }
.quiz-progress-track { height: 8px; border-radius: 999px; background: #e3e8e5; }
.quiz-progress-track span { border-radius: 999px; background: var(--accent); }
.quiz-progress-track::after { display: none; }

/* Questions */
.step-panel > legend { color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
.step-help, .estimate-note { color: #33403a; font-weight: 500; }
.field > span:first-child, .choice-field > legend { color: var(--ink); font-weight: 700; }
.person-position { color: var(--accent); }

/* Choix visibles : gros boutons à toucher */
.visible-choice {
  min-height: 58px;
  border: 2px solid var(--line-strong);
  font-weight: 700;
  transition: border-color .15s ease, background-color .15s ease;
}
.visible-choice input { accent-color: var(--accent); }
.visible-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.visible-choice:active { background: var(--accent-soft); }

/* Champs et sélecteurs */
.native-select,
.field input:not([type="radio"]):not([type="checkbox"]),
.field select,
.field-date select,
.input-affix { border-width: 2px; border-color: var(--line-strong); font-weight: 600; }
.input-affix input { border: 0 !important; }
.native-select:focus,
.field input:not([type="radio"]):not([type="checkbox"]):focus,
.field select:focus { border-color: var(--accent); }
.add-button, .text-button, .review-edit { color: var(--accent); font-weight: 700; }

/* Boutons d'action : comme la landing, sans ombre */
.next-button {
  min-height: 52px;
  border: 0;
  border-radius: var(--control-radius);
  background: var(--accent);
  font-size: .98rem;
  font-weight: 800;
}
.next-button:active { background: var(--accent-dark); }
.back-button { border: 2px solid var(--line-strong); font-weight: 700; }
* { -webkit-tap-highlight-color: transparent; }

/* Consentement */
.consent-checkbox input:checked { background-color: var(--accent); border-color: var(--accent); }
.consent-checkbox { color: #33403a; }

/* Récapitulatif */
.review-list { border-width: 2px; border-color: var(--line); }
.review-row-label { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.review-row strong { color: var(--ink); font-weight: 700; }

/* Calcul */
.spinner { border-color: #e3e8e5; border-top-color: var(--accent); }
.calculation-loading h2 { color: var(--ink); font-weight: 800; }
@keyframes calc-step { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Résultat */
.confirmation-panel h2 { color: var(--ink); font-size: clamp(1.45rem, 6.4vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.confirmation-result { padding: 18px 14px; border: 2px solid var(--accent); border-radius: 12px; background: #fbfff9; }
.confirmation-result > p:first-child { color: var(--ink); font-size: .95rem; font-weight: 700; }
.confirmation-saving { color: var(--ink); font-weight: 900; letter-spacing: -.02em; }
.confirmation-saving mark { padding: 0 .12em; color: var(--ink); background: linear-gradient(transparent 12%, var(--marker) 12%, var(--marker) 92%, transparent 92%); }
.confirmation-saving sup { font-size: .3em; }
.confirmation-sub { margin: 2px 0 0 !important; color: #33403a; font-size: .88rem; font-weight: 600; }
.confirmation-copy { color: #1f2a26; font-size: .95rem; font-weight: 500; line-height: 1.45; }
.confirmation-copy a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.callback-process h3 { color: var(--ink); font-weight: 800; }
.process-number { background: var(--accent) !important; color: #fff !important; border: 0 !important; }
.callback-process li strong { color: var(--ink); font-size: .92rem; }
.callback-process .process-copy { color: #33403a; font-size: .84rem; }

/* Le test tient dans l'écran, pied de page compris : sans marge de défilement, Safari ne peut plus
   rester décalé vers le bas après la fermeture du clavier (en-tête et progression à moitié cachés). */
body.quiz-active .page-shell { min-height: 0; }
body.quiz-active .site-footer {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  padding: 8px 16px max(8px, env(safe-area-inset-bottom));
  font-size: .66rem;
}
body.quiz-active .site-footer nav { gap: 14px; }

/* Reste à rembourser calculé : tout le champ s'éclaire, unité comprise, sans angle droit. */
.input-affix.calculated b { background: transparent; }
.input-affix.just-calculated input { animation: none; }
.input-affix.just-calculated { animation: calculated-pulse 2.6s ease-out; }

/* ===== Esthétique du test (29/09/2026 soir) =====
   Squelette inchangé (mêmes écrans, mêmes cases, même ordre). Seules la taille, la largeur et la
   disposition changent : cases pleine largeur et égales, deux choix côte à côte, champs appariés
   à moitié-moitié, couleurs de la landing au lieu du noir. */
:root { --box-line: #c5d6cc; --box-radius: 12px; --box-h: 58px; }
#step-root { max-width: 520px; }
.step-panel > legend { font-size: clamp(1.35rem, 5.6vw, 1.6rem); line-height: 1.2; }
.step-help, .estimate-note { font-size: .92rem; line-height: 1.4; }

/* Choix : grandes cases égales, texte centré, sélection en vert */
.visible-choice-list { display: grid; grid-template-columns: 1fr; justify-items: stretch; gap: 12px; }
.visible-choice-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.visible-choice {
  position: relative;
  width: 100%;
  max-width: none;
  min-height: 64px;
  justify-content: center;
  padding: 12px 38px;
  border: 2px solid var(--box-line);
  border-radius: var(--box-radius);
  color: var(--ink);
  background: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}
.visible-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.visible-choice::before {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--box-line);
  border-radius: 50%;
  background: #fff;
  content: "";
  transform: translateY(-50%);
}
.visible-choice:has(input:checked) { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.visible-choice:has(input:checked)::before {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Cpath d='M2 6l4 4 8-8' fill='none' stroke='white' stroke-width='2.4'/%3E%3C/svg%3E") center / 11px 9px no-repeat;
}
.visible-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-field > legend { margin-bottom: 8px; }

/* Champs et menus : pleine largeur, même hauteur, bordure verte claire */
.field { gap: 7px; }
.field > span:first-child, .choice-field > legend { font-size: .95rem; }
.native-select,
.field input:not([type="radio"]):not([type="checkbox"]),
.field select,
.field-date select,
.input-affix {
  --control-width: 100%;
  width: 100%;
  max-width: none;
  height: var(--box-h);
  border: 2px solid var(--box-line);
  border-radius: var(--box-radius);
  color: var(--ink);
  background-color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}
.field > input, .field > .input-affix:not(.duration-number), .field > .input-affix:has([data-loan-field="rate"]) { width: 100%; }
.native-select, .field select, .field-date select {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 0 44px 0 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%230e8541' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 14px 9px;
}
.native-select:has(option[value=""]:checked), .field select:has(option[value=""]:checked) { color: var(--muted); font-weight: 600; }
.field input:not([type="radio"]):not([type="checkbox"]) { padding: 0 16px; }
.field input::placeholder { color: #8a948f; font-weight: 500; }
.input-affix { overflow: hidden; }
.input-affix input { height: 100% !important; padding: 0 16px !important; background: transparent !important; }
.input-affix b { min-width: 44px; border-left: 0; color: var(--accent-dark); background: transparent; font-weight: 800; }
.input-affix:focus-within,
.native-select:focus,
.field input:not([type="radio"]):not([type="checkbox"]):focus,
.field select:focus { border-color: var(--accent); outline: 3px solid rgba(14, 133, 65, .16); outline-offset: 0; }
.input-affix input:focus { outline: 0 !important; }

/* Première mensualité : année et mois à moitié-moitié */
.date-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.date-pair > select, .optional-month { width: 100%; flex: none; }
.optional-month small { font-size: .72rem; }

/* Durée : nombre à gauche, ans / mois à droite, même hauteur */
.duration-entry { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.duration-number { width: 100% !important; height: var(--box-h) !important; min-height: 0 !important; }
.duration-number input { text-align: center; }
.duration-unit-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; height: var(--box-h) !important; }
.duration-unit-choice {
  width: 100% !important;
  height: var(--box-h) !important;
  min-height: 0 !important;
  padding: 0 6px !important;
  border: 2px solid var(--box-line);
  border-radius: var(--box-radius);
  color: var(--ink);
  font-size: 1rem !important;
  font-weight: 700;
}
.duration-unit-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.duration-unit-choice:has(input:checked) { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }

/* Date de naissance : trois cases qui remplissent la largeur */
.birth-date { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.5fr) !important; width: 100% !important; gap: 8px; }
.birth-date input { text-align: center; padding: 0 6px !important; }
.birth-date i { color: var(--box-line); font-weight: 700; }

/* Identité et profil : une colonne, cases pleine largeur */
.identity-grid, .contact-grid, .field-grid { gap: 16px; }
.full-field { grid-column: 1 / -1; }

/* Consentement : case plus grande, verte */
.consent-checkbox { grid-template-columns: 24px minmax(0, 1fr); gap: 10px; font-size: .8rem; }
.consent-checkbox input { width: 24px; height: 24px; margin: 0; border: 2px solid var(--box-line); border-radius: 6px; }
.consent-checkbox input:checked { background-size: 14px 11px; }

/* Récapitulatif : même bordure que les cases */
.review-list { border: 2px solid var(--box-line); border-radius: var(--box-radius); }
.review-row { border-bottom-color: #e3ece6; }

/* Boutons : Suivant prend toute la place, Retour reste discret */
.form-actions { gap: 10px; margin-top: 18px; }
.next-button { flex: 1; min-height: 58px; border-radius: var(--box-radius); font-size: 1.08rem; }
.back-button { flex: 0 0 auto; min-height: 58px; padding: 0 16px; border: 2px solid var(--box-line); border-radius: var(--box-radius); color: var(--ink); }

@media (max-width: 800px) {
  #magnolia-replica { padding-right: 16px; padding-left: 16px; }
  #step-root { padding-top: 24px; }
  .step-panel > legend { margin-bottom: 12px; }
  .step-help, .estimate-note { margin-bottom: 16px; font-size: .88rem; }
  .field-grid-3, .identity-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) and (max-height: 700px) {
  :root { --box-h: 52px; }
  #step-root { padding-top: 16px; }
  .step-panel > legend { font-size: 1.25rem; margin-bottom: 8px; }
  .step-help, .estimate-note { margin-bottom: 12px; font-size: .82rem; }
  .visible-choice { min-height: 56px; }
  .identity-grid, .contact-grid, .field-grid { gap: 12px; }
  .next-button, .back-button { min-height: 52px; }
  .form-actions { margin-top: 12px; }
}
@media (max-width: 800px) and (max-height: 640px) {
  :root { --box-h: 48px; }
  .visible-choice { min-height: 50px; }
  .identity-grid, .contact-grid, .field-grid { gap: 10px; }
}

/* Questions alignées en haut, bouton juste sous les cases : le titre reste à la même place d'un écran
   à l'autre et il n'y a plus de vide entre la dernière case et « Suivant ». */
#magnolia-replica { grid-template-rows: auto auto auto; align-content: start; }
#step-root.center-step { align-content: start; }
.review-row-label { font-size: .7rem; }
.review-row strong { font-size: .9rem; }
.review-row-detail { font-size: .74rem; }
.review-edit { font-size: .78rem; }
@media (max-width: 800px) and (max-height: 700px) {
  .review-row strong { font-size: .8rem; }
  .review-row-detail, .review-row-label { font-size: .66rem; }
}
.add-button { justify-content: flex-start; text-align: left; font-size: .9rem; }
.visible-choice-row .visible-choice { padding-right: 12px; padding-left: 36px; }
@media (max-width: 800px) and (max-height: 640px) {
  :root { --box-h: 46px; }
  #step-root { padding-top: 12px; }
  .step-panel > legend { font-size: 1.15rem; margin-bottom: 6px; }
  .step-help, .estimate-note { margin-bottom: 8px; font-size: .78rem; line-height: 1.3; }
  .field { gap: 4px; }
  .field > span:first-child, .choice-field > legend { font-size: .85rem; min-height: 0; }
  .choice-field > legend { margin-bottom: 4px; }
  .visible-choice { min-height: 48px; font-size: .98rem; }
  .identity-grid, .contact-grid, .field-grid { gap: 8px; }
  .borrower-card h2 { margin-bottom: 8px; font-size: .95rem; }
  .add-button { margin-top: 2px; padding: 4px 0; font-size: .82rem; }
  .next-button, .back-button { min-height: 48px; }
  .form-actions { margin-top: 10px; }
  .optional-month small { font-size: .64rem; }
}
/* Le titre (« Et sur la personne… », « Personne 2 sur 2 ») dit déjà de qui il s'agit. */
.borrower-card h2 { display: none; }
.contact-panel .contact-grid { gap: 12px; }
.contact-panel .step-help { margin-bottom: 12px; }
.consents { margin-top: 12px; }
@media (max-width: 800px) and (max-height: 700px) {
  .contact-panel .contact-grid { gap: 8px; }
  .consents { margin-top: 8px; }
  .consent-checkbox { padding: 2px 0; font-size: .74rem; line-height: 1.3; }
}
body.quiz-active .site-footer { padding-top: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
@media (max-width: 800px) and (max-height: 640px) {
  .contact-panel .contact-grid { gap: 5px; }
  .contact-panel .step-help { margin-bottom: 6px; font-size: .74rem; }
  .consent-checkbox { font-size: .7rem; line-height: 1.25; }
  body.quiz-active .site-footer { padding-top: 4px; font-size: .62rem; }
}
@media (max-width: 800px) { #magnolia-replica { padding-bottom: 2px; } .form-actions { margin-bottom: 0; } }
@media (max-width: 800px) and (max-height: 640px) { .contact-panel > legend { margin-bottom: 4px; } }

/* Écrans à choix : les cases remplissent l'écran, avec un pictogramme (comme les tests concurrents).
   Trois choix : empilés, pictogramme à gauche. Deux choix : grandes cases côte à côte, pictogramme au-dessus. */
.choice-icon { flex: 0 0 auto; width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.visible-choice-list .visible-choice.has-icon {
  justify-content: flex-start;
  gap: 16px;
  min-height: clamp(64px, 12svh, 88px);
  padding: 12px 52px 12px 20px;
  text-align: left;
}
.visible-choice-list .visible-choice.has-icon::before { right: 18px; left: auto; }
.visible-choice-row .visible-choice.has-icon {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: clamp(104px, 22svh, 150px);
  padding: 16px 12px;
}
.visible-choice-row .visible-choice.has-icon .choice-icon { width: 40px; height: 40px; }
.visible-choice-row .visible-choice.has-icon::before { top: 12px; right: 12px; left: auto; transform: none; }
.visible-choice.has-icon:has(input:checked) .choice-icon { stroke: var(--accent-dark); }

/* Retour : simple lien, Suivant reste le seul vrai bouton */
.back-button { min-height: 48px; padding: 0 6px; border: 0 !important; color: var(--muted); background: transparent; font-weight: 700; }
.back-button:active { background: transparent; color: var(--ink); }
/* Messages d'erreur lisibles, en rouge (l'ancienne règle « .field small » les rendait gris et minuscules) */
.field small.field-error-inline, .field .field-error, .field-error-inline { color: var(--danger); font-size: .84rem; font-weight: 700; line-height: 1.3; }
.visible-choice-row + .field-error-inline, .choice-field .field-error-inline { margin-top: 6px; }
/* Ordinateur : les boutons restent dans la colonne des cases */
.form-actions, .form-error { width: 100%; max-width: 520px; margin-right: auto; margin-left: auto; }
/* Écran de calcul : il tenait 34 px trop bas (hauteur minimale sans l'en-tête ni la progression). */
@media (max-width: 800px) { .calculation-loading { min-height: calc(100svh - 190px); } }
@media (max-width: 800px) and (max-height: 700px) { .calculation-loading { min-height: calc(100svh - 170px); } }
.review-row { cursor: pointer; }

/* Ligne « formulaire sécurisé » au-dessus du pied de page, sur chaque écran de questions */
.form-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin: 0;
  padding: 10px 16px 2px;
  color: #3d4a44;
  font-size: .76rem;
  font-weight: 700;
}
.form-secure svg { flex: 0 0 auto; width: 17px; height: 17px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Écrans à choix (logement, banque, seul/à deux) : le bloc question + cases est centré dans la hauteur
   disponible, pour que les cases tombent au milieu de l'écran au lieu de rester collées en haut. */
#magnolia-replica:has(#step-root.choice-step) { grid-template-rows: minmax(0, 1fr) auto auto; }
#step-root.choice-step { align-content: center; padding-bottom: 8vh; }

/* Écran de calcul : roue et titre au centre, sans liste qui s'affiche au fur et à mesure */
.calculation-loading { align-content: center; gap: 22px; }
.calculation-loading .spinner { width: 58px; height: 58px; border-width: 5px; }
.calculation-loading h2 { margin: 0; font-size: clamp(1.6rem, 7vw, 2rem); line-height: 1.15; }
@media (max-width: 800px) and (max-height: 600px) {
  :root { --box-h: 43px; }
  .form-secure { padding: 5px 16px 0; font-size: .7rem; }
  .form-secure svg { width: 14px; height: 14px; }
  #step-root { padding-top: 10px; }
  .identity-grid, .contact-grid, .field-grid { gap: 7px; }
  .next-button { min-height: 46px; }
  .form-actions { margin-top: 8px; }
}
@media (max-width: 800px) and (max-height: 600px) {
  .contact-panel > legend { font-size: 1.1rem; }
  .contact-panel .step-help { line-height: 1.25; }
  .consents { margin-top: 5px; }
}


/* Banques : toutes les banques en cases, par ordre alphabétique, sur trois colonnes */
.bank-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bank-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(42px, 6.4svh, 54px);
  padding: 4px 6px;
  border: 2px solid var(--box-line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}
.bank-tile input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bank-tile:has(input:checked) { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.bank-tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 800px) and (max-height: 640px) { .bank-grid { gap: 6px; } .bank-tile { min-height: 40px; font-size: .76rem; } }

/* Calcul : trois étapes qui tournent puis se cochent, l'une après l'autre (environ 3,5 s) */
.calculation-loading { gap: 26px; }
.calculation-loading h2 { order: 0; }
.calculation-steps { display: grid; gap: 14px; width: min(100%, 300px); margin: 0; padding: 0; list-style: none; text-align: left; }
.calculation-steps li { display: flex; align-items: center; gap: 12px; color: #9aa39f; font-size: 1rem; font-weight: 700; transition: color .2s ease; }
.calculation-steps li.active, .calculation-steps li.done { color: var(--ink); }
.calculation-status { position: relative; flex: 0 0 auto; width: 22px; height: 22px; border: 2.5px solid #d9e0dc; border-radius: 50%; }
.calculation-steps li.active .calculation-status { border-color: #d9e0dc; border-top-color: var(--accent); animation: spin .7s linear infinite; }
.calculation-steps li.done .calculation-status {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Cpath d='M2 6l4 4 8-8' fill='none' stroke='white' stroke-width='2.4'/%3E%3C/svg%3E") center / 11px 9px no-repeat;
}
@media (max-width: 800px) and (max-height: 700px) {
  .bank-grid { gap: 6px; }
  .bank-tile { min-height: 38px; font-size: .76rem; }
  .contact-panel .contact-grid { gap: 6px; }
  .contact-panel .step-help { margin-bottom: 8px; font-size: .8rem; line-height: 1.3; }
}
@media (max-width: 800px) and (max-height: 640px) {
  .bank-tile { min-height: 35px; padding: 2px 4px; font-size: .72rem; }
  .bank-grid + * { margin-top: 0; }
}
@media (max-width: 800px) and (max-height: 580px) {
  .bank-tile { min-height: 33px; }
  fieldset:has(.bank-grid) .step-help { display: none; }
}
/* Écrans étroits (360 px) : les noms de banques et le consentement passent sur plus de lignes. */
@media (max-width: 370px) {
  .bank-tile { min-height: 40px; font-size: .74rem; }
  .bank-grid { gap: 6px; }
  .contact-panel .contact-grid { gap: 8px; }
  .contact-panel .step-help { margin-bottom: 8px; font-size: .8rem; line-height: 1.3; }
  .consent-checkbox { font-size: .72rem; line-height: 1.28; }
}
@media (max-width: 800px) and (max-height: 700px) { .consents { margin-top: 6px; } }
@media (max-width: 800px) and (max-height: 640px) { .bank-tile { min-height: 35px; } }
@media (max-width: 800px) and (max-height: 600px) {
  .contact-panel .contact-grid { gap: 5px; }
  .contact-panel .step-help { margin-bottom: 6px; font-size: .74rem; }
  .consent-checkbox { font-size: .7rem; line-height: 1.25; }
}
@media (max-width: 800px) and (max-height: 580px) { .bank-tile { min-height: 33px; } }

/* Page de résultat : une carte aux couleurs du test (bandeau vert, montant vert), sans surligneur jaune */
.confirmation-panel h2 { margin-bottom: 14px; font-size: clamp(1.55rem, 7vw, 1.9rem); }
.confirmation-result { overflow: hidden; padding: 0 0 16px; border: 2px solid var(--accent); border-radius: 14px; background: #fff; text-align: center; }
.confirmation-result > .result-kicker {
  margin: 0 0 12px;
  padding: 9px 12px;
  color: #fff;
  background: var(--accent);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.confirmation-saving { margin: 0 !important; padding: 0 12px; color: var(--accent-dark); font-size: clamp(3rem, 15vw, 4.2rem); font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.confirmation-saving sup { color: var(--ink); font-size: .28em; font-weight: 700; }
.confirmation-result > .confirmation-sub { margin: 6px 12px 0 !important; color: #33403a; font-size: .9rem; font-weight: 600; }
.result-monthly { margin: 12px 16px 0 !important; padding-top: 12px; border-top: 1px dashed var(--box-line); color: var(--ink); font-size: .95rem; font-weight: 600; }
.result-monthly strong { color: var(--accent-dark); font-weight: 900; }

/* Ligne sécurisée, version retenue : noir, cadenas plein de la même couleur que le texte, deux lignes.
   Sous 700 px de haut, elle passe sur une ligne pour que chaque écran tienne sans défiler. */
.form-secure { gap: 11px; padding-top: 12px; color: #1d2622; font-size: .86rem; font-weight: 800; text-align: left; }
.form-secure svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.form-secure svg .lock-body { fill: currentColor; stroke: none; }
.form-secure svg .lock-hole { fill: #fff; stroke: none; }
.secure-copy { display: grid; gap: 1px; }
.secure-copy small { max-width: 255px; color: #56615b; font-size: .7rem; font-weight: 500; line-height: 1.3; }
.secure-copy em { display: none; font-style: normal; }
@media (max-width: 800px) and (max-height: 700px) {
  .form-secure { gap: 8px; padding-top: 8px; color: #3f4944; font-size: .78rem; }
  .form-secure svg { width: 20px; height: 20px; }
  .secure-copy { display: flex; flex-wrap: wrap; gap: 0 5px; }
  .secure-copy small { display: none; }
  .secure-copy em { display: inline; font-weight: 500; }
}
@media (max-width: 800px) and (max-height: 600px) { .form-secure { padding-top: 4px; font-size: .7rem; } .form-secure svg { width: 16px; height: 16px; } }
.bank-tile { min-height: clamp(42px, 5.6svh, 50px); }
@media (max-width: 370px) {
  .form-secure { gap: 8px; padding-top: 8px; color: #3f4944; font-size: .76rem; }
  .form-secure svg { width: 20px; height: 20px; }
  .secure-copy { display: flex; flex-wrap: wrap; gap: 0 5px; }
  .secure-copy small { display: none; }
  .secure-copy em { display: inline; font-weight: 500; }
}
@media (max-width: 800px) and (max-height: 700px) { .bank-tile { min-height: 38px; } }
@media (max-width: 800px) and (max-height: 640px) { .bank-tile { min-height: 35px; } }
@media (max-width: 800px) and (max-height: 580px) { .bank-tile { min-height: 33px; } }
@media (max-width: 370px) and (max-height: 700px) { .bank-tile { min-height: 36px; } }
@media (max-width: 370px) and (max-height: 600px) { .form-secure { padding-top: 4px; font-size: .7rem; } .form-secure svg { width: 16px; height: 16px; } }

/* Bandeau de gain sous la barre de progression : fond vert clair, texte noir, montant en vert. */
.gain-band { width: 100%; margin: 0; padding: 9px 16px; border-bottom: 1px solid #d3e8dc; color: var(--ink); background: var(--accent-soft); font-size: .9rem; font-weight: 700; text-align: center; }
.gain-band strong { color: var(--accent-dark); font-weight: 900; }
@media (max-width: 800px) and (max-height: 640px) { .gain-band { padding: 6px 12px; font-size: .8rem; } }

/* Banques : cases plus hautes, faciles à toucher (au moins 46 px) */
.bank-grid { gap: 8px; }
.bank-tile { min-height: 50px; font-size: .82rem; }
@media (max-width: 800px) and (max-height: 700px) { .bank-grid { gap: 7px; } .bank-tile { min-height: 47px; } }
@media (max-width: 800px) and (max-height: 640px) { .bank-tile { min-height: 44px; font-size: .76rem; } }
@media (max-width: 370px) { .bank-tile { font-size: .76rem; } }

/* Ligne sécurisée : police système du téléphone (San Francisco, Roboto), plus technique, une seule graisse
   de base pour toute la ligne afin qu'elle ne paraisse pas mélanger deux polices. */
.form-secure, .form-secure * { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.form-secure b { font-weight: 600; letter-spacing: 0; }
.secure-copy small, .secure-copy em { font-weight: 400; letter-spacing: 0; }

/* Bandeau : écrans chargés exclus en JS ; sur les petits écrans, aussi l'écran du nom */
@media (max-width: 800px) and (max-height: 600px) { body[data-step$="identity"] .gain-band { display: none; } }

/* Banques : 44 px minimum partout (taille tactile recommandée) ; l'aide saute sur les écrans bas */
@media (max-width: 800px) and (max-height: 700px) { .bank-tile { min-height: 44px; } fieldset:has(.bank-grid) .step-help { display: none; } }
@media (max-width: 800px) and (max-height: 640px) { .bank-tile { min-height: 44px; } .bank-grid { gap: 6px; } }
@media (max-width: 800px) and (max-height: 580px) { .bank-tile { min-height: 42px; } }
@media (max-width: 370px) and (max-height: 700px) { .bank-tile { min-height: 44px; } }

/* Résultat : titre du cadre en police habituelle, sans majuscules espacées ; tout plus compact pour
   voir les trois étapes sans défiler */
.confirmation-result > .result-kicker { margin-bottom: 8px; padding: 7px 12px; font-size: .95rem; font-weight: 800; letter-spacing: 0; text-transform: none; }
.confirmation-panel { padding-top: 0; }
.confirmation-panel h2 { margin: 0 0 10px; font-size: clamp(1.4rem, 6.4vw, 1.75rem); }
.confirmation-result { padding-bottom: 12px; }
.confirmation-saving { font-size: clamp(2.6rem, 13vw, 3.6rem); }
.result-monthly { margin-top: 8px !important; padding-top: 8px; font-size: .9rem; }
.callback-process { margin-top: 12px; padding-top: 0; border-top: 0; }
.callback-process h3 { margin-bottom: 8px; font-size: 1.05rem; }
.callback-process ol { gap: 8px; }
.callback-process li strong { font-size: .9rem; }
.callback-process li strong a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.callback-process .process-copy { font-size: .8rem; line-height: 1.32; }
.callback-process .dr-tp { white-space: nowrap; }
.callback-process .dr-tp img { vertical-align: -1px; }
.result-legal { margin-top: 10px; }
@media (max-width: 800px) and (max-height: 700px) {
  .confirmation-panel h2 { font-size: 1.35rem; margin-bottom: 8px; }
  .confirmation-saving { font-size: 2.6rem; }
  .confirmation-result > .confirmation-sub { font-size: .82rem; }
  .callback-process .process-copy { font-size: .76rem; }
}
@media (max-width: 370px) { .bank-tile { min-height: 46px; } }
@media (max-width: 370px) and (max-height: 700px) { .bank-tile { min-height: 44px; } }

/* Pas de mot seul sur une ligne : les textes courts sont répartis en lignes égales (Safari 17.5+, Chrome 114+),
   les plus longs évitent la dernière ligne orpheline quand le navigateur le permet. */
.step-panel > legend, .step-panel > legend span, .step-help, .estimate-note, .field > span:first-child,
.choice-field > legend, .visible-choice span, .bank-tile span, .consent-checkbox span, .calculation-loading h2,
.calculation-steps li, .confirmation-panel h2, .confirmation-sub, .result-monthly, .callback-process li strong,
.callback-process .process-copy, .confirmation-copy, .result-legal, .form-error, .field-error-inline,
.review-row strong, .review-row-detail, .gain-band, .secure-copy { text-wrap: balance; }

/* ===== 30/09 soir : aides, confiance, calcul, résultat ===== */

/* Aide visible : une courte phrase surlignée en vert, qu'on lit sans effort */
.help-chip { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 14px; padding: 6px 11px; border-radius: 8px; color: var(--accent-dark); background: var(--accent-soft); font-size: .9rem; font-weight: 700; line-height: 1.3; }
.help-chip svg { flex: 0 0 auto; width: 17px; height: 17px; fill: var(--accent-dark); }
.help-chip + * { clear: both; }
@media (max-width: 800px) and (max-height: 700px) { .help-chip { margin-bottom: 10px; padding: 5px 10px; font-size: .84rem; } }
@media (max-width: 800px) and (max-height: 600px) { .help-chip { margin-bottom: 6px; padding: 4px 9px; font-size: .78rem; } }

/* Bouton « i » et sa bulle */
.info-tip {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent-dark);
  background: #fff;
  font: 800 .78rem/1 Georgia, "Times New Roman", serif;
  vertical-align: 2px;
  cursor: pointer;
}
.info-tip[aria-expanded="true"] { color: #fff; background: var(--accent); }
.step-panel > legend .info-tip { width: 24px; height: 24px; vertical-align: 4px; }
.info-bubble {
  position: absolute;
  z-index: 50;
  padding: 11px 14px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 35, 27, .14);
  font: 600 .88rem/1.4 "Montserrat", Arial, sans-serif;
  text-wrap: balance;
  animation: bubble-in .14s ease-out;
}
.info-bubble::before {
  position: absolute;
  left: calc(var(--arrow-x, 50%) - 8px);
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  background: #fff;
  content: "";
  transform: rotate(45deg);
}
.info-bubble.below::before { top: -8px; border-right: 0; border-bottom: 0; }
.info-bubble.above::before { bottom: -8px; border-top: 0; border-left: 0; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* Ligne de confiance : une ligne, centrée, gris foncé, cadenas plein un peu plus grand que le texte */
.form-secure { gap: 7px; padding: 10px 16px 0; color: #3a4440; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: .8rem; font-weight: 400; text-align: center; white-space: nowrap; }
.form-secure b { font-weight: 700; }
.form-secure svg { width: 17px; height: 17px; }
.form-secure svg .lock-shackle { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.form-secure svg .lock-body { fill: currentColor; stroke: none; }
.form-secure svg .lock-hole { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
@media (max-width: 800px) and (max-height: 700px) { .form-secure { padding-top: 7px; font-size: .76rem; } .form-secure svg { width: 16px; height: 16px; } }
@media (max-width: 800px) and (max-height: 600px) { .form-secure { padding-top: 4px; font-size: .7rem; } .form-secure svg { width: 14px; height: 14px; } }
@media (max-width: 370px) { .form-secure { font-size: .74rem; } }

/* Calcul : cercle qui tourne, puis se remplit et se coche ; compteur d'économie trouvée */
.calculation-status { width: 24px; height: 24px; border: 0 !important; background: none !important; animation: none !important; }
.calculation-status svg { width: 24px; height: 24px; overflow: visible; }
.status-track { fill: #fff; stroke: #d9e0dc; stroke-width: 2.5; transition: fill .25s ease, stroke .25s ease; }
.status-arc { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 18 45; opacity: 0; transform-origin: 12px 12px; }
.status-tick { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .3s ease .12s; }
.calculation-steps li.active .status-arc { opacity: 1; animation: spin .8s linear infinite; }
.calculation-steps li.done .status-track { fill: var(--accent); stroke: var(--accent); }
.calculation-steps li.done .status-tick { stroke-dashoffset: 0; }
.calculation-steps li.done .calculation-status svg { animation: status-pop .32s ease-out; }
@keyframes status-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.calculation-found { margin: 0; padding: 10px 16px; border-radius: 10px; color: var(--ink); background: var(--accent-soft); font-size: 1rem; font-weight: 700; }
.calculation-found strong { color: var(--accent-dark); font-size: 1.15rem; font-weight: 900; font-variant-numeric: tabular-nums; }

/* Résultat : prochaine étape mise en avant (l'appel), puis deux étapes courtes côte à côte */
.next-call { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border: 2px solid var(--box-line); border-radius: 14px; background: #fff; text-align: left; }
.next-call-icon { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--accent); }
.next-call-icon svg { width: 22px; height: 22px; fill: #fff; }
.next-call-copy { display: grid; gap: 2px; min-width: 0; }
.next-call-kicker { margin: 0; color: var(--accent-dark); font-size: .76rem; font-weight: 800; }
.next-call-copy strong { color: var(--ink); font-size: 1rem; font-weight: 800; line-height: 1.25; }
.next-call-copy strong a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.next-call-copy > span { color: #33403a; font-size: .84rem; line-height: 1.35; }
.next-call-copy .dr-tp img { vertical-align: -1px; }
.next-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; }
.next-steps li { display: grid; justify-items: center; gap: 4px; padding: 12px 10px; border: 2px solid var(--box-line); border-radius: 14px; text-align: center; }
.next-step-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: var(--accent-soft); }
.next-step-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-dark); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.next-steps strong { color: var(--ink); font-size: .86rem; font-weight: 800; line-height: 1.25; text-wrap: balance; }
.next-steps span:not(.next-step-icon) { color: #56615b; font-size: .76rem; line-height: 1.3; }
@media (max-width: 800px) and (max-height: 700px) {
  .next-call { margin-top: 10px; padding: 10px 12px; }
  .next-call-icon { width: 38px; height: 38px; }
  .next-steps li { padding: 9px 8px; }
}
/* Banques : cases hautes (48 px) dès que l'écran le permet ; sur les petits écrans, 44 px et un léger
   défilement (écran sans clavier, donc sans risque). */
@media (min-height: 641px) { .bank-tile { min-height: 48px; } }
@media (min-height: 760px) { .bank-tile { min-height: 52px; } }
@media (min-height: 641px) and (max-height: 699px) { .bank-tile { min-height: clamp(44px, calc(14svh - 46.5px), 50px); } }
.next-call-copy strong, .next-call-copy > span, .next-steps span, .calculation-found, .help-chip span { text-wrap: balance; }
.info-tip { -webkit-appearance: none; appearance: none; margin-top: 0; margin-bottom: 0; line-height: 1; }

/* ===== 30/09 nuit ===== */
/* Chaque écran : le bloc question + boutons est centré dans la hauteur ; les boutons un peu plus bas. */
#magnolia-replica, #magnolia-replica:has(#step-root.choice-step) { grid-template-rows: auto auto auto; align-content: center; }
#step-root.choice-step { padding-bottom: 0; }
.form-actions { margin-top: 26px; }
@media (max-width: 800px) and (max-height: 700px) { .form-actions { margin-top: 18px; } }
@media (max-width: 800px) and (max-height: 600px) { .form-actions { margin-top: 10px; } }

/* Ligne de confiance : un peu moins large, et remontée par rapport aux mentions légales */
.form-secure { gap: 6px; margin-bottom: 8px; font-size: .74rem; letter-spacing: -.01em; }
.form-secure svg { width: 15px; height: 15px; }
@media (max-width: 800px) and (max-height: 700px) { .form-secure { margin-bottom: 6px; font-size: .72rem; } .form-secure svg { width: 14px; height: 14px; } }
@media (max-width: 800px) and (max-height: 600px) { .form-secure { margin-bottom: 2px; font-size: .68rem; } }

/* Consentement : plus d'espace sous l'email, texte plus petit et sur toute la largeur (comme les autres tests) */
.consents { margin-top: 18px; }
.consent-checkbox, .consent-checkbox span { font-size: .72rem; line-height: 1.4; text-wrap: wrap; color: #4a5550; }
.consent-checkbox { grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
.consent-checkbox input { width: 22px; height: 22px; }
@media (max-width: 800px) and (max-height: 700px) { .consents { margin-top: 14px; } .consent-checkbox, .consent-checkbox span { font-size: .68rem; line-height: 1.35; } }
@media (max-width: 800px) and (max-height: 600px) { .consents { margin-top: 8px; } .consent-checkbox, .consent-checkbox span { font-size: .64rem; } }

/* Boutons toujours au même endroit : en bas de la zone du test ; la question est centrée au-dessus. */
#magnolia-replica, #magnolia-replica:has(#step-root.choice-step) { grid-template-rows: minmax(0, 1fr) auto auto; align-content: stretch; }
#step-root, #step-root.choice-step { align-content: center; padding-bottom: 8px; }
.form-actions { margin-top: 14px; }
@media (max-width: 800px) and (max-height: 700px) { .form-actions { margin-top: 10px; } }
/* « Retour » : un vrai bouton entouré, de la même hauteur que « Suivant » */
.back-button { min-height: 58px; padding: 0 18px; border: 2px solid var(--box-line) !important; border-radius: var(--box-radius); color: var(--ink); background: #fff; font-size: .95rem; font-weight: 700; }
.back-button:active { background: var(--accent-soft); }
@media (max-width: 800px) and (max-height: 700px) { .back-button { min-height: 52px; } }
@media (max-width: 800px) and (max-height: 640px) { .back-button { min-height: 48px; } }
/* Banques : hauteur de case calculée pour remplir l'écran jusqu'à « Retour » */
.bank-grid .bank-tile { min-height: var(--bank-tile, 44px); }
body[data-step="bank"] #step-root { align-content: start; }
body[data-step="bank"] #magnolia-replica { padding-bottom: 14px; }
/* Boutons et montant sur une seule ligne (pas de mot ou d'astérisque renvoyé à la ligne) */
.next-button, .back-button, .confirmation-saving { white-space: nowrap; }
@media (max-width: 400px) { .next-button { gap: 7px; padding: 0 12px; font-size: .98rem; } .back-button { padding: 0 14px; } }

/* Résultat : les trois étapes de la landing, reliées par un trait ; la personne voit où elle en est. */
.result-path { position: relative; display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; text-align: left; }
.result-path li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; align-items: start; padding: 9px 12px; border: 2px solid var(--box-line); border-radius: 12px; background: #fff; }
.result-path li + li::before { position: absolute; top: -12px; left: 28px; width: 2px; height: 14px; background: #a7d4b9; content: ""; }
.path-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--accent-soft); }
.path-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--accent-dark); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.path-icon svg .fill { fill: var(--accent-dark); stroke: none; }
.result-path li > div { display: grid; gap: 2px; min-width: 0; align-self: center; }
.result-path strong { color: var(--ink); font-size: .92rem; font-weight: 800; line-height: 1.25; text-wrap: balance; }
.result-path strong a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.result-path li > div > span { color: #33403a; font-size: .8rem; line-height: 1.35; text-wrap: balance; }
.result-path .path-note { color: #56615b; font-size: .74rem; }
.result-path .dr-tp { white-space: nowrap; }
.result-path .dr-tp img { vertical-align: -1px; }
.path-kicker { margin: 0; color: var(--accent-dark); font-size: .74rem; font-weight: 800; }
.result-path .path-done { padding: 6px 12px; border-color: #d3e8dc; background: var(--accent-soft); }
.result-path .path-done .path-icon { width: 26px; height: 26px; margin-left: 4px; border-radius: 50%; background: var(--accent); }
.result-path .path-done .path-icon svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 2.6; }
.result-path .path-done strong { color: var(--accent-dark); font-size: .86rem; }
.result-path .path-current { border-color: var(--accent); }
.result-path .path-current .path-icon { background: var(--accent); }
.result-path .path-current .path-icon svg .fill { fill: #fff; }

/* Coordonnées : le bandeau seulement là où il reste de la place */
@media (max-height: 739px) { body[data-step="contact-details"] .gain-band { display: none; } }
@media (max-height: 819px) { body[data-step="contact-details"] .gain-band { display: none; } }
@media (max-width: 370px) { .contact-panel .help-chip { font-size: .8rem; padding: 5px 9px; margin-bottom: 8px; } .contact-panel > legend { margin-bottom: 8px; } }
@media (max-width: 370px) and (max-height: 600px) { .contact-panel .help-chip { font-size: .72rem; padding: 3px 8px; margin-bottom: 4px; } .contact-panel > legend { margin-bottom: 4px; font-size: 1.05rem; } }

/* Premier écran du test : les trois bénéfices de la landing, pour rassurer (on est bien dans le test) */
.test-perks { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px 16px; margin: 0 0 14px; color: var(--accent-dark); font-size: .88rem; font-weight: 800; }
.test-perks span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.test-perks svg { width: 16px; height: 16px; }
.test-perks svg circle { fill: var(--accent); }
.test-perks svg path { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.test-perks + * { clear: both; }
.review-panel .help-chip { margin-bottom: 10px; }
@media (max-width: 800px) and (max-height: 700px) { .test-perks { margin-bottom: 10px; font-size: .82rem; } }
