/* ============================================================
   RECO EXPRESS
   Design System Héloïse Conseil : navy + sky, cyan/pink en ponctuation.
   Akkurat partout, Sigurd en display uniquement.
   Mobile d'abord.
   ============================================================ */

/* ---------- Typographies de marque ---------- */

@font-face {
  font-family: "Akkurat";
  src: url("fonts/akkurat.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Akkurat";
  src: url("fonts/akkurat-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* Sigurd est un accent display : une seule graisse, l'italique éditorial. */
@font-face {
  font-family: "Sigurd";
  src: url("fonts/sigurd-bold-italic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  /* Brand */
  --hc-navy: #213b85;
  --hc-sky: #88b6e2;
  --cyan-500: #06b6d4;
  --pink-500: #ec4899;

  --navy-50: #eff2f9;
  --navy-100: #d6def0;
  --navy-600: #213b85;
  --navy-700: #1a2f6a;
  --navy-800: #142450;
  --navy-900: #0d1838;

  --sky-50: #f3f8fc;
  --sky-100: #e1edf7;
  --sky-300: #a7c8e8;
  --sky-400: #88b6e2;
  --sky-500: #6699d2;
  --sky-600: #4d7fbf;
  --sky-700: #3a679f;

  /* Neutres */
  --ink-50: #f5f6fa;
  --ink-100: #ebedf2;
  --ink-200: #d8dae3;
  --ink-300: #b6bac8;
  --ink-500: #6c7186;
  --ink-600: #4a4f63;
  --ink-700: #2c3144;
  --ink-900: #0b1020;
  --paper: #ffffff;

  --success: #17714a;
  --danger: #b9344a;

  /* Rôles dans la page */
  --fond: var(--ink-50);
  --carte: var(--paper);
  --titre: var(--hc-navy);
  --encre: var(--ink-900);
  --encre-douce: var(--ink-600);
  --trait: var(--ink-200);
  --trait-doux: var(--ink-100);
  --choisi-trait: var(--hc-navy);
  --choisi-fond: var(--navy-50);
  --sur-navy: var(--paper);

  /* Typo */
  --font-display: "Sigurd", Georgia, "Times New Roman", serif;
  --font-sans: "Akkurat", "Inter", "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;

  /* Formes */
  --r-champ: 8px;
  --r-carte: 16px;
  --r-pill: 999px;
  --large: 36rem;

  --ombre-sm: 0 1px 2px rgba(13, 24, 56, .06), 0 1px 0 rgba(13, 24, 56, .04);
  --ombre-md: 0 8px 24px -8px rgba(13, 24, 56, .18), 0 2px 6px rgba(13, 24, 56, .06);
  --focus: 0 0 0 3px rgba(33, 59, 133, .25);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: var(--navy-900);
    --carte: var(--navy-800);
    --titre: var(--sky-400);
    --encre: #eef2fa;
    --encre-douce: #94aad4;
    --trait: #24386f;
    --trait-doux: #1b2b58;
    --choisi-trait: var(--sky-400);
    --choisi-fond: #1c2f63;
    --sur-navy: var(--navy-900);
    --success: #6ec49b;
    --danger: #ef8496;
    --focus: 0 0 0 3px rgba(136, 182, 226, .3);
    --ombre-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --ombre-md: 0 8px 24px -8px rgba(0, 0, 0, .5);
  }
}

/* Dès qu'il y a de la place, la colonne s'élargit un peu. En dessous, on reste
   sur une mesure de lecture confortable au pouce. */
@media (min-width: 46rem) {
  :root { --large: 40rem; }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Barre de marque ---------- */

.barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1.6rem;
  max-width: var(--large);
  margin: 0 auto;
}

/* En haut, l'identité de l'app. La signature Héloïse Conseil est en pied de page,
   comme une mention d'éditeur : discrète, mais présente à chaque écran. */
.marque { display: flex; align-items: center; gap: .6rem; }
.app-marque { display: block; width: 32px; height: 32px; }
.app-nom {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.01em;
  color: var(--titre);
}

/* Le logo Héloïse Conseil est entièrement vectorisé, aucune police à charger. */
.logo { display: block; height: 52px; width: auto; }
.logo-clair { display: none; }
@media (prefers-color-scheme: dark) {
  .logo-sombre { display: none; }
  .logo-clair { display: block; }
}

.langue {
  border: 1px solid var(--trait);
  background: transparent;
  color: var(--encre-douce);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .12em;
  padding: .35rem .7rem;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.langue:hover { border-color: var(--hc-navy); color: var(--titre); }

/* ---------- Jauge ---------- */

.jauge {
  max-width: var(--large);
  margin: 0 auto .3rem;
  padding: 0 1.25rem;
}
.jauge::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--trait-doux);
  border-radius: 2px;
  margin-top: -2px;
}
.jauge-barre {
  height: 2px;
  width: 0;
  /* Cyan : la seule ponctuation d'accent du parcours. */
  background: var(--cyan-500);
  border-radius: 2px;
  position: relative;
  z-index: 1;
  transition: width .35s ease;
}

/* ---------- Scène ---------- */

.scene {
  max-width: var(--large);
  margin: 0 auto;
  padding: .2rem 1.25rem calc(4rem + env(safe-area-inset-bottom));
}

.ecran { animation: entree .32s ease both; }
@keyframes entree { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .ecran { animation: none; }
  .jauge-barre { transition: none; }
}

/* ---------- Titres ---------- */

h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -.025em;
  color: var(--titre);
  margin: .75rem 0 1rem;
}

/* L'italique de marque : Sigurd, en sky. Un seul par écran. */
h1 em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  /* sky-600 et non sky-500 : le sky de la charte tombe a 2.8 de contraste sur
     fond clair, illisible. sky-600 passe le seuil et reste nettement plus
     clair que le navy du reste du titre. */
  color: var(--sky-600);
}
@media (prefers-color-scheme: dark) { h1 em { color: var(--sky-300); } }

h2 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--titre);
  margin: .5rem 0 .5rem;
}
h1:focus-visible, h2:focus-visible { outline: none; }

.salutation { color: var(--encre-douce); margin: 1.5rem 0 0; font-size: 1rem; }
/* Plusieurs paragraphes qui se suivent : espacement serré entre eux,
   et de l'air seulement avant le bouton. */
.chapo { color: var(--ink-700); font-size: 1.0625rem; line-height: 1.6; margin: 0 0 1rem; max-width: 46ch; }
.chapo:last-of-type { margin-bottom: 2rem; }
/* Amorce en gras et en bleu de la charte. sky-700 et non le sky de marque :
   en corps de texte, #88b6e2 tombe a 2,0 de contraste sur fond clair. */
.chapo strong { font-weight: 700; color: var(--sky-700); }
/* Lien vers le profil, dans le fil du texte. */
.chapo a { color: var(--sky-700); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.chapo a:hover { color: var(--hc-navy); }
@media (prefers-color-scheme: dark) { .chapo a { color: var(--sky-300); } .chapo a:hover { color: var(--sky-400); } }
@media (prefers-color-scheme: dark) { .chapo strong { color: var(--sky-300); } }
@media (prefers-color-scheme: dark) { .chapo { color: var(--encre-douce); } }
.aide { color: var(--encre-douce); font-size: .875rem; margin: 0 0 1.35rem; }
/* Aveu assumé, en retrait : il informe sans sermonner. */
.avertissement {
  margin: -.9rem 0 1.35rem;
  padding-left: .8rem;
  border-left: 2px solid var(--sky-300);
  font-size: .875rem;
  line-height: 1.5;
  color: var(--encre-douce);
}
.amorce-etapes { margin: .2rem 0 .6rem; font-size: .9375rem; color: var(--ink-700); }
.amorce-etapes a { color: var(--sky-700); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) { .amorce-etapes { color: var(--encre-douce); } .amorce-etapes a { color: var(--sky-300); } }

.signature {
  margin-top: 2.5rem;
  font-family: var(--font-sans);
  font-size: .9375rem;
  color: var(--titre);
  font-weight: 700;
}
.signature span {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  color: var(--sky-600);
  font-size: .875rem;
}

/* Eyebrow : la signature HC. Sur-titre capitales navy, interlettrage large. */
.compteur, .groupe, .reglage-titre {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--titre);
}
.compteur { display: block; margin: 0 0 .35rem; }

/* ---------- Options ---------- */

.options { display: grid; gap: .5rem; margin: 0 0 1.5rem; }

.option {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--encre);
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--r-carte);
  padding: .9rem 1rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.option:hover { border-color: var(--sky-400); }
.option[aria-pressed="true"] {
  border-color: var(--choisi-trait);
  background: var(--choisi-fond);
  box-shadow: var(--ombre-sm);
}
.option[disabled] { opacity: .38; cursor: not-allowed; }

.coche {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: .15rem;
  border: 1.5px solid var(--ink-300);
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: .7rem;
  line-height: 1;
  color: transparent;
}
.option[aria-pressed="true"] .coche {
  background: var(--choisi-trait);
  border-color: var(--choisi-trait);
  color: var(--sur-navy);
}

.groupe { margin: 1.35rem 0 .5rem; }
.options .groupe:first-child { margin-top: 0; }

.lien-discret {
  background: none;
  border: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: .875rem;
  color: var(--titre);
  padding: .4rem 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.lien-discret:hover { color: var(--sky-600); }

/* ---------- Champs ---------- */

label {
  display: block;
  font-family: var(--font-sans);
  font-size: .875rem;
  color: var(--ink-700);
  margin-bottom: .4rem;
}
@media (prefers-color-scheme: dark) { label { color: var(--encre-douce); } }

input[type="text"], textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--encre);
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--r-champ);
  padding: .8rem .9rem;
  resize: vertical;
}
input[type="text"]::placeholder, textarea::placeholder { color: var(--ink-500); }
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--hc-navy);
  box-shadow: var(--focus);
}
textarea { min-height: 8.5rem; }

:focus-visible { outline: 2px solid var(--hc-navy); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { :focus-visible { outline-color: var(--sky-400); } }

/* ---------- Bloc replie ---------- */

.replie { margin: 0 0 1.6rem; max-width: 46ch; }
.replie summary {
  cursor: pointer;
  font-size: .9375rem;
  font-weight: 700;
  color: var(--sky-700);
  padding: .5rem 0;
  list-style: none;
}
.replie summary::-webkit-details-marker { display: none; }
.replie summary::before {
  content: "+";
  display: inline-block;
  width: 1.1rem;
  font-weight: 700;
}
.replie[open] summary::before { content: "\2013"; }
.replie summary:hover { color: var(--hc-navy); }
@media (prefers-color-scheme: dark) {
  .replie summary { color: var(--sky-300); }
  .replie summary:hover { color: var(--sky-400); }
}
.marche-a-suivre {
  margin: .3rem 0 0;
  padding-left: 2.4rem;
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--ink-700);
}
.marche-a-suivre li { margin-bottom: .4rem; }
@media (prefers-color-scheme: dark) { .marche-a-suivre { color: var(--encre-douce); } }

/* ---------- Anecdote, double mode ---------- */

/* Mobile : le champ d'écriture, puis les angles suggérés, l'un sous l'autre.
   Desktop : les deux côte à côte, à parts égales, sinon la colonne des angles
   se retrouve trop étroite et chaque suggestion passe sur trois lignes. */
.double { display: grid; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (min-width: 46rem) {
  /* stretch et non start : le champ d'écriture descend aussi bas que la
     colonne de questions, pour qu'on ait de la place pour répondre. */
  .double { grid-template-columns: 1fr 1fr; gap: 2rem; align-items: stretch; }
  .champ-dictee { display: flex; }
  .champ-dictee textarea { flex: 1 1 auto; height: 100%; }
}

.questions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}
.questions li {
  position: relative;
  padding-left: 1.1rem;
  font-size: .9375rem;
  line-height: 1.45;
  color: var(--ink-700);
}
.questions li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: .35rem;
  height: .35rem;
  border-radius: 50%;
  background: var(--sky-400);
}
@media (prefers-color-scheme: dark) { .questions li { color: var(--encre-douce); } }

/* Le champ et son micro : le bouton se pose dans le coin bas droit du
   champ, la ou on l attend sur un telephone. */
.champ-dictee { position: relative; }
.champ-dictee textarea {
  padding-bottom: 3.6rem;
  /* La poignee de redimensionnement tombait sous le micro : la hauteur
     est desormais donnee par la mise en page, on la retire. */
  resize: none;
}
.champ-dictee .dictee {
  position: absolute;
  right: .6rem;
  bottom: .6rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  pointer-events: none;
}
.champ-dictee .dictee > * { pointer-events: auto; }

.dictee { display: flex; align-items: center; gap: .6rem; margin-top: .65rem; flex-wrap: wrap; }
.micro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--titre);
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 50%;
  cursor: pointer;
}
.micro:hover { border-color: var(--hc-navy); }
.micro[aria-pressed="true"] { border-color: var(--pink-500); color: var(--pink-500); }
.micro[aria-pressed="true"] .micro-glyphe { animation: pulse 1.2s infinite; }
.micro-glyphe { width: 1.25rem; height: 1.25rem; fill: currentColor; display: block; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- Boutons ---------- */

.actions { display: grid; gap: .6rem; margin-top: 1.75rem; }

.bouton {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: .9375rem;
  letter-spacing: .02em;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 1rem 1.5rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: background .2s, transform .2s, border-color .2s, color .2s;
}
.bouton-primaire { background: var(--hc-navy); color: var(--paper); }
.bouton-primaire:hover { background: var(--navy-700); transform: translateY(-1px); }
.bouton-primaire[disabled] { opacity: .35; cursor: not-allowed; transform: none; background: var(--hc-navy); }
.bouton-secondaire { background: transparent; color: var(--titre); border-color: var(--hc-navy); }
.bouton-secondaire:hover { background: var(--navy-50); }
.bouton-fantome { background: none; border: 0; color: var(--encre-douce); font-weight: 400; padding: .65rem; }
.bouton-fantome:hover { color: var(--titre); }

@media (prefers-color-scheme: dark) {
  .bouton-primaire { background: var(--sky-400); color: var(--navy-900); }
  .bouton-primaire:hover { background: var(--sky-300); }
  .bouton-primaire[disabled] { background: var(--sky-400); }
  .bouton-secondaire { color: var(--sky-400); border-color: var(--sky-400); }
  .bouton-secondaire:hover { background: var(--choisi-fond); }
}

/* ---------- Attente ---------- */

.attente { text-align: center; padding: 5rem 0; }
.points { display: inline-flex; gap: .4rem; margin-bottom: 1.5rem; }
.points i { width: .5rem; height: .5rem; border-radius: var(--r-pill); background: var(--cyan-500); animation: saut 1.1s infinite; }
.points i:nth-child(2) { animation-delay: .16s; }
.points i:nth-child(3) { animation-delay: .32s; }
@keyframes saut { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-5px); } }

/* ---------- Brouillon ---------- */

.brouillon {
  width: 100%;
  min-height: 12rem;
  /* La hauteur est pilotée en JS pour coller au texte : en temps normal il
     n'y a rien à faire défiler. On garde auto plutôt que hidden pour que
     du texte ne devienne jamais inaccessible si le calcul échoue. */
  overflow-y: auto;
  overflow-x: hidden;
  resize: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--r-carte);
  padding: 1.15rem;
  box-shadow: var(--ombre-sm);
}
.brouillon[data-charge="1"] { opacity: .45; }

.reglages { display: grid; gap: .9rem; margin: 1.35rem 0 0; }
.reglage { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.reglage-titre { flex: 0 0 100%; }

.puce {
  font-family: var(--font-sans);
  font-size: .875rem;
  color: var(--encre);
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--r-pill);
  padding: .5rem 1rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.puce:hover { border-color: var(--sky-400); }
.puce[aria-pressed="true"] {
  background: var(--choisi-fond);
  border-color: var(--choisi-trait);
  color: var(--titre);
  font-weight: 700;
}
.puce[disabled] { opacity: .38; cursor: not-allowed; }

/* ---------- Fin ---------- */

.texte-final {
  white-space: pre-wrap;
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--r-carte);
  padding: 1.15rem;
  margin: 1.25rem 0 0;
  font-size: 1rem;
  line-height: 1.65;
  box-shadow: var(--ombre-sm);
  max-height: 18rem;
  overflow-y: auto;
}
.texte-final::selection, .texte-final *::selection { background: var(--sky-100); }

.mode-emploi .marche-a-suivre { margin-top: 0; padding-left: 1.4rem; }
.mode-emploi {
  background: var(--sky-50);
  border: 1px solid var(--sky-100);
  border-radius: var(--r-carte);
  padding: .95rem 1.1rem;
  font-size: .9375rem;
  color: var(--ink-700);
  margin: 1.25rem 0 0;
}
@media (prefers-color-scheme: dark) {
  .mode-emploi { background: var(--trait-doux); border-color: var(--trait); color: var(--encre-douce); }
}


.copie-ok {
  color: var(--success);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: .875rem;
  text-align: center;
  margin: .75rem 0 0;
}
/* Doit suivre .copie-ok : meme specificite, c'est l'ordre qui tranche. */
.copie-echec { color: var(--danger); }

/* ---------- Sondage ---------- */

.question { margin: 0 0 1.75rem; }
.question p { margin: 0 0 .65rem; font-size: 1rem; color: var(--encre); }
.reponses { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Divers ---------- */

.erreur {
  background: var(--carte);
  border: 1px solid var(--danger);
  border-left-width: 3px;
  color: var(--danger);
  border-radius: var(--r-champ);
  padding: .8rem 1rem;
  font-size: .9375rem;
  margin: 1rem 0 0;
}

.pied {
  max-width: var(--large);
  margin: 2rem auto 0;
  padding: 1.5rem 1.25rem calc(2rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--trait-doux);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
}
.pied .mention {
  margin: 0;
  max-width: 40ch;
  text-align: center;
  font-size: .75rem;
  line-height: 1.5;
  color: var(--encre-douce);
}

.annonce {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------------
   Doigts, pas souris.

   Sur telephone, tout ce qui se touche fait au moins 44 px de haut :
   c est la taille d une pulpe de pouce. Les petits boutons restent
   fins au-dessus de 46rem, la ou il y a un curseur pour viser.
   ------------------------------------------------------------------ */
@media (max-width: 45.99rem) {
  .langue,
  .puce,
  .micro,
  .bouton-fantome {
    min-height: 44px;
  }

  .langue,
  .puce,
  .micro {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
  }
}

/* La marque ramene a l accueil : c est un bouton, mais il garde l allure
   d une signature. Sur les ecrans ou le retour n a pas de sens, elle est
   desactivee et reprend le curseur normal. */
.marque {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: var(--r-pill);
}
.marque:disabled { cursor: default; }
.marque:not(:disabled):hover .app-nom { color: var(--sky-700); }
@media (prefers-color-scheme: dark) {
  .marque:not(:disabled):hover .app-nom { color: var(--sky-300); }
}
