/* Mon Artensia — téléphone d'abord.
 *
 * Trois règles qui ne se négocient pas, parce qu'elles viennent de ce
 * qu'on a déjà raté sur l'intranet :
 *   · JAMAIS de défilement horizontal. Une seule carte trop large et la
 *     page entière glisse sous le doigt ;
 *   · 44 px de haut minimum pour tout ce qui se touche ;
 *   · 16 px de gouttière, partout, y compris sous l'encoche.
 *
 * Aucune police externe : tout ce qui se charge vient de chez nous, et
 * ici rien ne se charge du tout — la pile système suffit et s'affiche
 * sans attendre.
 */

:root {
  --rouge: #C4203A;
  --rouge-sombre: #9c1a2e;
  --fond: #f6f4f1;
  --carte: #ffffff;
  --texte: #22201f;
  --texte-doux: #5d5854;
  --trait: #e3ded8;
  --dore: #b8860b;
  --vert: #1f8a4c;
  --orange: #b26a00;
  --gouttiere: 16px;
  --rayon: 12px;
  --touche: 44px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  /* La page ne glisse JAMAIS latéralement. */
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Place pour la barre du bas + la zone sûre des téléphones à encoche. */
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* `hidden` doit gagner contre `display:flex` des écrans. */
[hidden] { display: none !important; }

#app {
  max-width: 34rem;
  margin: 0 auto;
  padding: var(--gouttiere);
}

.ecran { display: flex; flex-direction: column; gap: var(--gouttiere); }

/* ── En-tête ─────────────────────────────────────────────────────── */
.entete { padding: 8px 0 0; }
.marque {
  color: var(--rouge);
  font-size: 1.6rem;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.bonjour { font-size: 1.45rem; margin: 0; }
.accroche { color: var(--texte-doux); margin: 0; }

/* ── Cartes ──────────────────────────────────────────────────────── */
.carte {
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: var(--gouttiere);
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Une carte ne dépasse jamais, même avec un mot très long dedans. */
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* ── Champs ──────────────────────────────────────────────────────── */
.champ { display: flex; flex-direction: column; gap: 6px; }
.etiquette { font-weight: 600; font-size: 0.95rem; }

input[type="tel"], input[type="text"] {
  min-height: var(--touche);
  padding: 10px 12px;
  font-size: 1.05rem;         /* 16 px minimum : en dessous, iOS zoome */
  border: 1px solid var(--trait);
  border-radius: 8px;
  background: #fff;
  color: var(--texte);
  width: 100%;
}
input:focus-visible {
  outline: 3px solid rgba(196, 32, 58, 0.35);
  outline-offset: 1px;
  border-color: var(--rouge);
}

#champ-code {
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  text-align: center;
}

.groupe { border: 0; padding: 0; margin: 0; display: flex;
          flex-direction: column; gap: 8px; }
.groupe legend { padding: 0; margin-bottom: 4px; }

.choix {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: var(--touche);
  padding: 8px 0;
  cursor: pointer;
}
.choix input { width: 22px; height: 22px; margin-top: 2px; flex: none;
               accent-color: var(--rouge); }
.consentement { font-size: 0.95rem; }
.consentement a { color: var(--rouge); }

/* ── Boutons ─────────────────────────────────────────────────────── */
.bouton {
  min-height: var(--touche);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 1.02rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  width: 100%;
}
.bouton.principal { background: var(--rouge); color: #fff; }
.bouton.principal:active { background: var(--rouge-sombre); }
.bouton.principal[disabled] { opacity: 0.55; cursor: progress; }
.bouton.discret {
  background: transparent;
  color: var(--texte-doux);
  border-color: var(--trait);
}

/* ── Messages ────────────────────────────────────────────────────── */
.aide { color: var(--texte-doux); font-size: 0.95rem; margin: 0; }
.erreur {
  color: #8a1020;
  background: #fdeaed;
  border: 1px solid #f3c2ca;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
  font-size: 0.95rem;
}

.bandeau-equipe {
  background: #fff4e0;
  border: 1px solid #f0d7a8;
  color: var(--orange);
  border-radius: var(--rayon);
  padding: 10px 12px;
  margin: 0;
  font-size: 0.93rem;
}

/* ── Barre du bas ────────────────────────────────────────────────── */
.barre-bas {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--carte);
  border-top: 1px solid var(--trait);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.onglet {
  flex: 1;
  min-height: 56px;
  border: 0;
  background: transparent;
  color: var(--texte-doux);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.onglet.actif { color: var(--rouge); box-shadow: inset 0 2px 0 var(--rouge); }

/* Le thème sombre du téléphone ne doit pas rendre le texte illisible :
   on garde un fond clair, choisi, plutôt qu'un fond hérité. */
@media (prefers-color-scheme: dark) {
  :root { --fond: #f6f4f1; --carte: #ffffff; --texte: #22201f; }
}

/* ── Cartes de contrat ───────────────────────────────────────────── */
.liste-contrats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gouttiere);
}
.contrat {
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: var(--gouttiere);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.contrat-titre {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.contrat-produit { font-weight: 600; }
.contrat-prime { color: var(--vert); font-weight: 600; white-space: nowrap; }
.contrat-ligne { margin: 2px 0; font-size: 0.95rem; color: var(--texte-doux); }
/* Une valeur absente se dit, elle ne s'invente pas. */
.contrat-ligne.absent { font-style: italic; opacity: .8; }

/* ── Écran d'un contrat ──────────────────────────────────────────── */
.retour {
  width: auto;
  align-self: flex-start;
  min-height: var(--touche);
  padding: 8px 14px;
  margin-bottom: 8px;
}
/* La carte de contrat est cliquable : elle doit le montrer, et rester
   atteignable au clavier comme au doigt. */
.contrat[role="button"] { cursor: pointer; }
.contrat[role="button"]:focus-visible {
  outline: 3px solid rgba(196, 32, 58, 0.35);
  outline-offset: 2px;
}
.contrat-chevron { color: var(--texte-doux); font-size: 0.9rem; margin-top: 8px; }

/* Tarif estimatif (2026-09-29) */
.pot-de-miel { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.est-fourchette { font-size: 1.6rem; font-weight: 700; margin: 0 0 0.5rem; }
.est-reponse { display: block; width: 100%; text-align: left; margin: 0 0 0.6rem; }

/* ── Tarif estimatif : l'écran des coordonnées au style d'artensia.fr ─────
 * Recopié de `DevisForm.astro` (artensia-site-v2) et de la charte v6
 * (`tokens.css`), à la demande de Jawad du 2026-10-02 : même police, mêmes
 * couleurs, étiquette au-dessus, une colonne, largeurs égales. Les valeurs
 * sont celles du site, pas des approximations : si le site change, on
 * reprend ses nombres ici. Tout est sous `.est-devis` pour ne rien changer
 * aux écrans du portail. */
.est-devis {
  --e-rouge: #a91d3a; --e-rouge-fonce: #8e1731; --e-texte: #111111;
  --e-gris: #6a6a6a; --e-bord: #ece6e0; --e-fond-doux: #faf7f4;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  color: var(--e-texte);
  background: #fff;
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}
.est-devis__titre { font-size: 1.75rem; font-weight: 700; line-height: 1.15; margin: 0; }
.est-devis__accroche { margin: 12px 0 0; font-size: 1.0625rem; line-height: 1.55; }
.est-champs { margin-top: 28px; display: grid; grid-template-columns: 1fr; gap: 14px; }
.est-devis .qfield { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.est-devis .qfield__label { font-size: 0.875rem; font-weight: 700; }
.est-devis .qfield input,
.est-devis .qfield select {
  /* Une seule hauteur pour tous les champs, liste comprise : sans elle,
   * la liste déroulante sort plus basse que les champs de saisie. */
  width: 100%; box-sizing: border-box; padding: 11px 14px; height: 48px; min-height: 0;
  background: #fff; border: 1px solid var(--e-bord); border-radius: 14px;
  font: inherit; color: var(--e-texte);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.est-devis .qfield input:focus,
.est-devis .qfield select:focus {
  outline: none; border-color: var(--e-rouge);
  box-shadow: 0 0 0 3px rgba(169, 29, 58, .14);
}
.est-devis .qfield__notice { margin: 6px 0 0; font-size: .8125rem; font-style: italic; line-height: 1.45; color: #4b5563; }
.est-devis .qfield__notice[hidden] { display: none; }
.est-consent {
  margin-top: 20px; display: flex; gap: 12px; align-items: flex-start;
  font-size: .875rem; color: var(--e-gris); line-height: 1.5;
}
.est-consent input { margin-top: 3px; flex: none; width: 18px; height: 18px; accent-color: var(--e-rouge); }
.est-err {
  margin: 14px 0 0; padding: 10px 14px; background: #fdf2f4; border: 1px solid #f5c0c8;
  border-radius: 12px; color: #8e1731; font-size: .875rem;
}
.est-err[hidden] { display: none; }
.est-actions { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.est-devis .qbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 22px; border-radius: 9999px; font: inherit;
  font-weight: 700; font-size: 1rem; cursor: pointer; transition: background-color .18s ease;
}
.est-devis .qbtn--lg { padding: 15px 30px; font-size: 1.0625rem; }
.est-devis .qbtn--primary { background: var(--e-rouge); color: #fff; border: 1px solid var(--e-rouge); }
.est-devis .qbtn--primary:hover:not(:disabled) { background: var(--e-rouge-fonce); border-color: var(--e-rouge-fonce); }
.est-devis .qbtn--primary:disabled { opacity: .6; cursor: not-allowed; }
.est-devis .qbtn--ghost { background: #fff; color: var(--e-texte); border: 1px solid var(--e-bord); }
.est-devis .qbtn--ghost:hover { background: var(--e-fond-doux); }
