/* Une page de livre : papier clair, encre profonde, un signet ambre. Sur ordinateur, une double page. */
:root {
  --paper: #fdfbf6;
  --sheet: #ffffff;
  --ink: #14233a;
  --ink-soft: #435068;
  --rule: #e2dccd;
  --edge: #8a8473;
  --amber: #e39b1e;
  --amber-deep: #7a4e00;
  --amber-wash: #fdf1da;
  --brick: #a12b1c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.55 var(--sans);
}
h1, h2, p, ul, figure, blockquote, fieldset { margin: 0; padding: 0; border: 0; }
ul { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--amber-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
h1:focus-visible { outline: none; }
[hidden] { display: none !important; }

.boot { padding: 48px 20px; color: var(--ink-soft); }

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

.running {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}
.author {
  font: italic 400 19px/1.2 var(--serif);
  color: var(--ink);
  text-decoration: none;
}
.folio { font-size: 17px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  margin-left: -8px;
  padding: 0 12px 0 8px;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}
.back::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: 4px;
  border-left: 2px solid;
  border-bottom: 2px solid;
  transform: rotate(45deg);
}
.back:hover { color: var(--amber-deep); }

/* Le signet : le ruban avance avec le parcours, son bout est entaillé comme un vrai marque-page. */
.ribbon { height: 10px; background: linear-gradient(var(--rule), var(--rule)) center / 100% 1px no-repeat; }
.ribbon span {
  display: block;
  height: 10px;
  background: var(--amber);
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 50%, 100% 100%, 0 100%);
  transition: width .3s ease;
}

.spread { flex: 1; padding: 36px 0 32px; }
.leaf + .leaf { margin-top: 28px; }

h1 {
  font: 500 clamp(30px, 8vw, 34px)/1.16 var(--serif);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
h2 {
  font: 500 23px/1.25 var(--serif);
  margin: 36px 0 12px;
}
.leaf > h2:first-child { margin-top: 0; }

.help { margin-top: 14px; color: var(--ink-soft); }
.sub { font-size: 20px; line-height: 1.5; }
h1 + .sub { margin-top: 14px; }
.eyebrow { font: italic 400 21px/1.3 var(--serif); color: var(--amber-deep); margin-bottom: 14px; }
.note { margin-top: 14px; font-size: 18px; color: var(--ink-soft); }
.done { margin-top: 14px; font-size: 20px; font-weight: 600; }
.answers > p + p { margin-top: 16px; }

/* Choix : de vrais boutons, assez grands pour le pouce, assez contrastés pour être vus comme tels. */
.options { display: grid; gap: 12px; }
.option {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 15px 18px;
  border: 1.5px solid var(--edge);
  border-radius: 10px;
  background: var(--sheet);
  font-size: 19px;
  line-height: 1.32;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .12s ease, border-color .12s ease;
}
.option small { display: block; margin-top: 4px; font-size: 17px; color: var(--ink-soft); }
.option:hover { border-color: var(--ink); }
.option[aria-pressed="true"] {
  border-color: var(--amber-deep);
  background: var(--amber-wash);
  box-shadow: inset 5px 0 0 var(--amber);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 56px;
  padding: 14px 0;
  cursor: pointer;
  line-height: 1.4;
}
.check input {
  flex: none;
  width: 28px;
  height: 28px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.check.boxed {
  padding: 16px 18px;
  border: 1.5px solid var(--edge);
  border-radius: 10px;
  background: var(--sheet);
}
.check.boxed + .check.boxed { margin-top: 12px; }
.check.boxed:has(input:checked) { border-color: var(--amber-deep); background: var(--amber-wash); }

.field { margin-bottom: 20px; }
/* Question du rappel, avant le numéro (quiz expatriation, 14 novembre 2026). */
fieldset.callback { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
fieldset.callback legend { margin-bottom: 10px; padding: 0; font-weight: 600; line-height: 1.4; }
.field.callback label.check { display: flex; margin-bottom: 0; font-weight: 400; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; }
.hint { margin-bottom: 8px; color: var(--ink-soft); font-size: 17px; }
.input, textarea {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 13px 15px;
  border: 1.5px solid var(--edge);
  border-radius: 10px;
  background: var(--sheet);
  font-size: 19px;
}
select.input { appearance: auto; }

/* Drapeaux : Twemoji, https://creativecommons.org/licenses/by/4.0/, police de country-flag-emoji-polyfill. */
@font-face {
  font-family: "Drapeaux";
  src: url("flags.woff2?v=1") format("woff2");
  font-display: swap;
  unicode-range: U+1F1E6-1F1FF;
}
.flag { flex: none; width: 28px; font-size: 22px; line-height: 1; text-align: center; }
.flagfont .flag { font-family: "Drapeaux", var(--sans); }
.picker { position: relative; }
.picker .flag-current { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.picker-input { padding-left: 52px; padding-right: 50px; }
.picker-input::placeholder { color: var(--ink-soft); opacity: 1; }
.picker-toggle {
  position: absolute; top: 3px; right: 3px; bottom: 3px; width: 46px;
  border: 0; border-radius: 8px; background: none; color: var(--ink-soft); font-size: 20px; cursor: pointer;
}
.picker-list {
  max-height: min(46vh, 330px); margin-top: 6px; padding: 4px; overflow-y: auto; overscroll-behavior: contain;
  border: 1.5px solid var(--edge); border-radius: 10px; background: var(--sheet);
}
.picker-list [data-code] { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.picker-list [data-code]:hover, .picker-list .is-active { background: var(--amber-wash); }
.picker-list [aria-selected="true"] .picker-name { font-weight: 600; }
.picker-name { flex: 1; min-width: 0; }
.picker-dial { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.picker-rule { height: 1px; margin: 6px 10px; background: var(--rule); }
.picker-empty { padding: 12px 10px; color: var(--ink-soft); }
.tel { display: flex; gap: 8px; }
.tel .input { flex: 1; min-width: 0; }
.dial {
  display: flex; align-items: center; padding: 0 13px; border: 1.5px solid var(--rule); border-radius: 10px;
  background: var(--amber-wash); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.dial[hidden] { display: none; }
.switch { margin-top: 20px; text-align: center; font-size: 18px; }
/* Accueil repris d'un autre outil : présentation de l'auteur et mentions sous le bouton. */
.about { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--rule, rgba(0, 0, 0, 0.12)); }
.about h2 { font-size: 20px; margin-bottom: 10px; }
.about p { font-size: 17px; line-height: 1.55; color: var(--ink-soft); }
.about p + p { margin-top: 10px; }
.legal { margin-top: 28px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
textarea { min-height: 150px; line-height: 1.45; resize: vertical; }
textarea::placeholder { color: var(--ink-soft); opacity: 1; }
[aria-invalid="true"] { border-color: var(--brick); }
.error { margin-top: 8px; color: var(--brick); font-weight: 500; }
.fix { margin: -8px 0 12px; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 62px;
  margin-top: 24px;
  padding: 14px 22px;
  border: 0;
  border-radius: 10px;
  background: var(--amber);
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.cta:hover { background: #d48f14; color: var(--ink); }
.cta:disabled { background: var(--rule); color: var(--ink-soft); cursor: default; }

.plain {
  min-height: 56px;
  padding: 12px 22px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}
/* Un lien reste en ligne par défaut : son cadre déborderait sur le bouton du dessus. */
a.plain { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 12px; color: var(--ink); text-align: center; text-decoration: none; }
.plain:hover { background: var(--ink); color: var(--paper); }
.plain.danger { border-color: var(--brick); color: var(--brick); }
.plain.danger:hover { background: var(--brick); color: #fff; }
.link {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--amber-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.more { display: inline-flex; align-items: center; min-height: 56px; font-weight: 600; }

.pair { display: flex; flex-wrap: wrap; gap: 12px; }
.pair > * { flex: 1 1 130px; }
.pair > p { flex-basis: 100%; }

.foot {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 8px 0 12px;
  font-size: 17px;
}
.foot a, .foot .link { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); }

/* Créneaux */
.days h2 { margin: 26px 0 10px; font-size: 21px; }
.days h2::first-letter { text-transform: uppercase; }
.days h2:first-child { margin-top: 0; }
.times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time {
  min-height: 56px;
  padding: 8px 4px;
  border: 1.5px solid var(--edge);
  border-radius: 10px;
  background: var(--sheet);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.time:hover { border-color: var(--ink); }
.time[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.stick { position: sticky; bottom: 0; padding-bottom: 12px; background: var(--paper); }
.stick .cta { margin-top: 12px; }

/* Page personnelle */
.when {
  margin: 12px 0 0;
  padding-left: 16px;
  border-left: 6px solid var(--amber);
  font: 500 27px/1.22 var(--serif);
}
.when span { display: block; }
.when span:first-child::first-letter { text-transform: uppercase; }
.video {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink);
}
.video iframe { display: block; width: 100%; height: 100%; border: 0; }
.case-video { margin-bottom: 10px; }
.case-play {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: var(--ink);
  cursor: pointer;
}
.case-play img { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-play::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: rgb(0 0 0 / 70%);
}
.case-play::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -12px 0 0 -7px;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
}
.case-play:hover::before, .case-play:focus-visible::before { background: rgb(0 0 0 / 88%); }
.covers li {
  position: relative;
  padding: 10px 0 10px 24px;
  border-top: 1px solid var(--rule);
}
.covers li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 21px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}
.covers li:first-child { border-top: 0; }
.proof { padding: 14px 0; border-top: 1px solid var(--rule); }
.proof:first-of-type { border-top: 0; }
.proof blockquote { font: 400 20px/1.4 var(--serif); }
.proof figcaption { margin-top: 6px; color: var(--ink-soft); font-size: 17px; }

/* Bannière cookies */
.cookies {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: var(--sheet);
  border-top: 2px solid var(--ink);
}
.cookies p { max-width: 640px; margin: 0 auto 10px; font-size: 18px; line-height: 1.4; }
.cookies .pair { max-width: 640px; margin: 0 auto; }

/* Texte long */
.prose { flex: 1; padding: 20px 0 48px; }
.prose h1 { margin-bottom: 18px; }
.prose p, .prose ul, .prose table { margin-top: 14px; }
.prose ul { list-style: disc; padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.prose th { font-weight: 600; }
.prose em { color: var(--amber-deep); font-style: italic; }
.draft { padding: 14px 16px; background: var(--amber-wash); border-left: 6px solid var(--amber); }
.updated { color: var(--ink-soft); }

@media (max-width: 480px) {
  .prose table, .prose thead, .prose tbody, .prose tr, .prose th, .prose td { display: block; }
  .prose thead { position: absolute; left: -10000px; }
  .prose tr { padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .prose td { padding: 2px 0; border: 0; }
  .prose td:first-child { font-weight: 600; }
}

/* Sur grand écran : une double page. La question à gauche, les réponses à droite, le pli entre les deux. */
@media (min-width: 900px) {
  .page { max-width: 1120px; padding: 0 40px; }
  .prose { max-width: 720px; margin: 0 auto; width: 100%; }
  .spread {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 56px 0;
  }
  .leaf { padding-right: 56px; }
  .leaf + .leaf {
    margin-top: 0;
    padding: 0 0 0 56px;
    border-left: 1px solid var(--rule);
  }
  .leaf:first-child { position: sticky; top: 40px; align-self: start; }
  /* Page de titre : le texte se tient au milieu de la page, le pli s'arrête avec lui. */
  .cover .spread { align-content: center; }
  h1 { font-size: 40px; line-height: 1.14; }
  .cover h1 { font-size: 46px; line-height: 1.1; }
  .sub { font-size: 21px; }
  .when { font-size: 30px; }
  .cookies { left: auto; right: 24px; bottom: 24px; width: 440px; border: 2px solid var(--ink); border-radius: 10px; }
  .cookies p, .cookies .pair { max-width: none; }
}

/* Intégré dans la page d'un autre site : la hauteur est celle du contenu, le bloc se détache de l'article. */
body[data-embed] { background: transparent; }
body[data-embed] .page {
  min-height: 0;
  max-width: none;
  padding: 0 20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
}
body[data-embed] .running { min-height: 52px; }
body[data-embed] .spread { flex: none; padding: 14px 0 16px; }
body[data-embed] .foot { padding: 0 0 6px; font-size: 15px; }
.embed-intro { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.embed-head { font: 600 24px/1.2 var(--serif); color: var(--ink); }
.embed-sub { margin-top: 6px; color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Vidéo de vente, puis réservation du premier échange : une seule colonne, large pour la vidéo. */
.page.vsl { max-width: 900px; }
.vsl-main { flex: 1; padding: 36px 0 32px; }
.vsl-player { position: relative; width: 100%; margin-top: 24px; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: var(--ink); }
.vsl-player > .note { position: absolute; inset: 0; margin: 0; padding: 24px; color: var(--paper); }
.vsl-action { margin-top: 24px; }
.vsl-action a.cta { display: block; text-align: center; text-decoration: none; }
.vsl-action .known { padding: 14px 16px; border-left: 6px solid var(--amber); background: var(--amber-wash); }
.vsl-pitch { margin-top: 44px; padding-top: 28px; border-top: 1.5px solid var(--edge); }
.vsl-pitch > p + p { margin-top: 14px; }
.vsl-points { margin: 20px 0; padding: 0; list-style: none; counter-reset: point; display: grid; gap: 14px; }
.vsl-points li { counter-increment: point; padding-left: 44px; position: relative; }
.vsl-points li::before { content: "0" counter(point); position: absolute; left: 0; top: 0; font: 500 21px/1.3 var(--serif); color: var(--amber-deep); }
.vsl-points strong, .vsl-points span { display: block; }
.leaf > .more { margin-top: 14px; color: var(--ink-soft); font-weight: 400; }

/* Sondages de Suivi (14 novembre 2026) : une page rendue par le serveur, `src/server/survey-page.ts`. */
.sv .prose h1 { font: 600 28px/1.25 var(--serif); }
.sv-intro { color: var(--ink-soft); }
.sv-page-head h2 { margin-top: 28px; font: 600 22px/1.3 var(--serif); }
.sv-page-head p { color: var(--ink-soft); }
.sv-question { min-width: 0; margin: 28px 0 0; padding: 0; border: 0; }
.sv-q { margin-bottom: 12px; padding: 0; font-weight: 600; line-height: 1.4; }
.sv-n { color: var(--amber-deep); }
.sv-req { color: var(--brick); }
.sv-has-error .sv-q { color: var(--brick); }
.sv-other { display: block; margin-top: 12px; color: var(--ink-soft); font-size: 17px; }
.sv-other .input, .sv-line .input { margin-top: 6px; }
.sv-line { display: block; margin-top: 12px; }
.sv-line span { display: block; font-size: 17px; }
.sv-grid { overflow-x: auto; }
.sv-grid table { width: 100%; border-collapse: collapse; font-size: 16px; }
.sv-grid th, .sv-grid td { padding: 10px 6px; border-bottom: 1px solid var(--rule); text-align: center; vertical-align: middle; }
.sv-grid thead th { font-size: 15px; font-weight: 600; }
.sv-grid tbody th { min-width: 140px; font-weight: 500; text-align: left; }
.sv-cell { display: flex; justify-content: center; padding: 6px; cursor: pointer; }
.sv-cell input { width: 24px; height: 24px; margin: 0; accent-color: var(--ink); }
.sv-cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sv-info { margin-top: 24px; color: var(--ink-soft); }
.sv-summary { margin-top: 16px; }
.sv-thanks { font-size: 20px; }
.sv-nav { display: flex; gap: 12px; align-items: flex-end; }
.sv-nav .plain { flex: none; margin-top: 24px; }
@media (max-width: 560px) {
  .sv-grid thead { display: none; }
  .sv-grid tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .sv-grid tbody th { display: block; padding: 0 0 6px; border: 0; }
  .sv-grid td { display: block; padding: 2px 0; border: 0; text-align: left; }
  .sv-cell { justify-content: flex-start; gap: 12px; }
  .sv-cell-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
}

/* Résultat d'un quiz (quiz QI) : la suite, sous les réflexes */
.quiz-suite { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule); }
.quiz-suite .plain { width: 100%; margin-top: 12px; }
.quiz-suite .later .cta { margin-top: 16px; }
