/* =====================================================================
   ET SI ON PARLAIT DE TOI ? — Feuille de style
   ===================================================================== */

@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/cormorant-garamond-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 500; font-display: swap; src: url('/fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/lora-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/lora-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/lora-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/lora-latin-600-normal.woff2') format('woff2'); }

:root {
  --ivory: #F5EDE1;
  --ivory-light: #FBF6EE;
  --chocolate: #4A3022;
  --espresso: #22160F;
  --copper: #A87443;
  --gold-pale: #E6C79A;
  --gold-soft: #D9B47E;

  --text: #3A261A;
  --text-soft: #6E5240;
  --line: rgba(168, 116, 67, 0.32);
  --line-soft: rgba(217, 180, 126, 0.38);
  --card: rgba(255, 252, 246, 0.72);
  --selected: #F6E9D4;

  --serif: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
  --body: 'Lora', Georgia, 'Times New Roman', serif;

  --radius: 14px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--ivory);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(251, 246, 238, 0.95), rgba(251, 246, 238, 0) 70%),
    radial-gradient(ellipse 60% 40% at 85% 105%, rgba(230, 199, 154, 0.22), rgba(230, 199, 154, 0) 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Ciel étoilé discret ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sky .s { position: absolute; color: var(--gold-soft); opacity: .45; animation: twinkle 7s ease-in-out infinite; }
.sky .s svg { display: block; width: 100%; height: 100%; }
@keyframes twinkle { 0%, 100% { opacity: .18; } 50% { opacity: .55; } }

/* ---------- Le carnet ---------- */
.book {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 12px auto;
  padding: 0 10px;
}
.sheet {
  position: relative;
  background: var(--ivory-light);
  border-radius: 6px;
  padding: 34px 22px 26px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.8) inset,
    0 18px 50px -24px rgba(74, 48, 34, 0.35),
    0 2px 8px -4px rgba(74, 48, 34, 0.15);
  min-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
}
/* double filet doré */
.sheet::before, .sheet::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 3px;
}
.sheet::before { inset: 7px; border: 1px solid var(--line); }
.sheet::after { inset: 11px; border: 1px solid var(--line-soft); }

.corner { position: absolute; width: 14px; height: 14px; color: var(--gold-soft); z-index: 2; }
.corner svg { width: 100%; height: 100%; display: block; }
.corner.tl { top: 2px; left: 2px; } .corner.tr { top: 2px; right: 2px; }
.corner.bl { bottom: 2px; left: 2px; } .corner.br { bottom: 2px; right: 2px; }

@media (min-width: 700px) {
  .book { margin: 40px auto; }
  .sheet { padding: 56px 64px 40px; min-height: auto; }
  body { font-size: 18px; }
}

#app { position: relative; z-index: 3; flex: 1; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; animation: enter .55s var(--ease) both; }
#app.leaving .screen { animation: leave .18s ease-in both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes leave { to { opacity: 0; transform: translateY(-4px); } }

/* ---------- Typographie ---------- */
h1, h2, h3 { font-family: var(--serif); color: var(--espresso); font-weight: 500; margin: 0; letter-spacing: .005em; }
h1:focus, h2:focus { outline: none; }
.eyebrow {
  font-family: var(--body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--copper);
  text-align: center;
  margin: 6px 0 0;
}
.title-main { font-size: clamp(42px, 11.5vw, 62px); line-height: 1.02; text-align: center; margin-top: 14px; }
.subtitle { font-family: var(--serif); font-style: italic; font-size: clamp(21px, 5.6vw, 25px); color: var(--copper); text-align: center; line-height: 1.3; margin: 14px 0 0; }
p { margin: 0 0 1em; }
.letter { margin-top: 6px; }
.letter p { color: var(--text); }
.letter .soft { font-family: var(--serif); font-style: italic; font-size: 1.2em; color: var(--chocolate); margin: .2em 0; line-height: 1.35; }
.signature { margin-top: 1.4em; color: var(--text-soft); font-style: italic; }
.signature .name { display: block; font-family: var(--serif); font-size: 34px; font-style: italic; color: var(--copper); line-height: 1.1; margin-top: 2px; }

/* ---------- Ornements ---------- */
.divider { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--gold-soft); margin: 22px auto; width: 100%; max-width: 260px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-soft)); }
.divider::after { background: linear-gradient(90deg, var(--gold-soft), transparent); }
.divider svg { width: 13px; height: 13px; flex: none; }
.ornament { display: block; margin: 0 auto; color: var(--gold-soft); }
.ornament.moon { width: 46px; height: 30px; margin-top: 16px; }
.ornament.sprig { width: 120px; height: 34px; }

/* ---------- Boutons ---------- */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--body);
  font-size: 13.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  border: 0; cursor: pointer; text-decoration: none;
  min-height: 54px; padding: 15px 28px; border-radius: 999px;
  transition: background-color .25s var(--ease), color .25s, transform .15s, box-shadow .25s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: var(--chocolate); color: var(--ivory-light);
  box-shadow: inset 0 0 0 1px rgba(230, 199, 154, .45), 0 10px 24px -14px rgba(34, 22, 15, .7);
}
.btn-primary:hover { background: var(--espresso); }
.btn-primary:active { transform: scale(.985); }
.btn-primary[disabled] { opacity: .6; cursor: default; }
.btn-outline { background: transparent; color: var(--chocolate); box-shadow: inset 0 0 0 1px var(--copper); }
.btn-outline:hover { background: rgba(230, 199, 154, .18); }
.btn-block { width: 100%; }
.btn-link {
  background: none; border: 0; padding: 10px 6px; min-height: 44px;
  font-family: var(--body); font-size: 15px; color: var(--text-soft); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--gold-soft); text-underline-offset: 4px;
}
.btn-link:hover { color: var(--chocolate); }
.btn:focus-visible, .btn-link:focus-visible, .opt:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid var(--copper); outline-offset: 3px;
}

.cta { margin-top: 26px; text-align: center; }
.reassure { text-align: center; font-size: 13.5px; color: var(--text-soft); margin: 16px 0 0; line-height: 1.55; }
.reassure .dot { color: var(--gold-soft); padding: 0 .35em; }
.duration { text-align: center; font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--copper); margin: 10px 0 0; }
.footer-link { text-align: center; margin-top: auto; padding-top: 26px; font-size: 13px; }
.footer-link a { color: var(--text-soft); text-decoration-color: var(--gold-soft); text-underline-offset: 3px; }

.resume-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--card); text-align: center; margin-top: 24px; }
.resume-box p { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--chocolate); margin-bottom: 14px; }

/* ---------- Écran de chapitre ---------- */
.chapter-screen { justify-content: center; text-align: center; padding: 20px 0; }
.chapter-num { font-family: var(--serif); font-style: italic; color: var(--copper); font-size: 20px; margin-top: 18px; }
.chapter-title { font-size: clamp(34px, 9vw, 46px); line-height: 1.1; margin: 6px 0 0; }
.chapter-intro { margin-top: 8px; }
.chapter-intro p { font-size: 17.5px; color: var(--text); }
.chapter-intro p:first-child { font-family: var(--serif); font-style: italic; font-size: 23px; color: var(--chocolate); line-height: 1.35; }
.chapter-screen .cta { margin-top: 30px; }

/* ---------- Questions ---------- */
.q-head { margin-bottom: 22px; }
.progress { position: relative; height: 3px; background: rgba(217, 180, 126, .28); border-radius: 3px; overflow: visible; }
.progress-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, var(--gold-pale), var(--copper)); transition: width .6s var(--ease); }
.progress-star { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; color: var(--copper); transition: left .6s var(--ease); }
.progress-star svg { display: block; width: 100%; height: 100%; }
.q-meta { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; margin-top: 12px; font-size: 12.5px; letter-spacing: .04em; color: var(--text-soft); }
.q-meta .chap { font-style: italic; }
.q-meta .count { white-space: nowrap; color: var(--copper); font-weight: 600; letter-spacing: .08em; }

.q-title { font-size: clamp(29px, 7.6vw, 38px); line-height: 1.15; }
.q-lead { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--chocolate); line-height: 1.4; }
.q-lead p { margin: 0 0 .25em; }
.q-note { margin: 12px 0 0; font-style: italic; color: var(--text-soft); font-size: 15.5px; }
.q-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 18px; font-size: 14px; color: var(--text-soft); }
.counter { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 11px; font-size: 13px; color: var(--copper); font-weight: 600; background: var(--card); transition: background-color .3s; }
.counter.full { background: var(--selected); }
.gentle { min-height: 1.4em; font-size: 14px; font-style: italic; color: var(--copper); margin: -6px 0 10px; transition: opacity .3s; }

.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  -webkit-appearance: none; appearance: none;
  display: flex; align-items: flex-start; gap: 14px; width: 100%;
  text-align: left; cursor: pointer;
  font-family: var(--body); font-size: 16px; line-height: 1.45; color: var(--text);
  background: var(--card);
  border: 1px solid rgba(168, 116, 67, .22);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 54px;
  transition: border-color .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease), opacity .25s;
  -webkit-tap-highlight-color: transparent;
}
.opt:hover { border-color: rgba(168, 116, 67, .5); }
.opt-mark {
  flex: none; position: relative; width: 22px; height: 22px; margin-top: 1px;
  border: 1px solid var(--gold-soft); border-radius: 50%;
  background: var(--ivory-light);
  transition: background-color .25s, border-color .25s;
  color: var(--ivory-light);
}
.opt.multi .opt-mark { border-radius: 7px; }
.opt-mark svg { position: absolute; inset: 4px; width: 12px; height: 12px; opacity: 0; transform: scale(.4) rotate(-30deg); transition: opacity .25s, transform .35s var(--ease); }
.opt.is-on { border-color: var(--copper); background: var(--selected); box-shadow: 0 6px 18px -12px rgba(168, 116, 67, .7); }
.opt.is-on .opt-mark { background: var(--copper); border-color: var(--copper); }
.opt.is-on .opt-mark svg { opacity: 1; transform: none; }
.opt.is-muted { opacity: .5; }
.opt.exclusive { font-style: italic; color: var(--text-soft); }

.other-field { margin: -2px 0 4px 36px; display: none; }
.other-field.open { display: block; animation: enter .35s var(--ease) both; }
textarea, input[type="email"] {
  width: 100%;
  font-family: var(--body); font-size: 16px; color: var(--text); line-height: 1.55;
  background: #FFFDF9;
  border: 1px solid rgba(168, 116, 67, .35); border-radius: 12px;
  padding: 12px 14px;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 84px; }
textarea::placeholder, input::placeholder { color: #A68D78; font-style: italic; }
.field-help { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-soft); margin-top: 6px; }
.free-text textarea { min-height: 200px; }

.part { margin-top: 8px; }
.part + .part { margin-top: 26px; }
.part-title { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--chocolate); margin: 0 0 12px; line-height: 1.25; }
.part-title .letter-tag { color: var(--copper); font-style: italic; margin-right: 4px; }

/* Barre de navigation collante en bas */
.q-nav {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 18px -22px -26px; padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--ivory-light) 72%, rgba(251, 246, 238, 0));
  border-radius: 0 0 6px 6px;
}
.q-nav .btn-primary { flex: 1; max-width: 300px; margin-left: auto; }
.q-nav .back { flex: none; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.q-nav .back svg { width: 14px; height: 14px; }
@media (min-width: 700px) {
  .q-nav { margin: 26px -64px -40px; padding: 22px 64px 26px; }
}
.spacer { flex: 1; min-height: 8px; }

.alert {
  border: 1px solid var(--copper); background: #FBF1E3; color: var(--chocolate);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 18px; font-size: 15.5px;
  animation: enter .4s var(--ease) both;
}
.alert p { margin: 0; }
.alert .btn-link { padding-left: 0; }

/* ---------- Écran final ---------- */
.thanks { text-align: center; }
.thanks h1 { font-size: clamp(32px, 8.6vw, 44px); line-height: 1.12; margin-top: 10px; }
.thanks .letter { text-align: left; margin-top: 22px; }
.glow-wrap { position: relative; height: 92px; margin-top: 6px; }
.glow { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: radial-gradient(circle, rgba(230, 199, 154, .55), rgba(230, 199, 154, 0) 68%); opacity: 0; animation: glow 3.2s ease-out .3s forwards; }
@keyframes glow { to { opacity: 1; } }
.glow-wrap .st { position: absolute; color: var(--copper); opacity: 0; animation: pop 1.2s var(--ease) forwards; }
.glow-wrap .st svg { width: 100%; height: 100%; display: block; }
@keyframes pop { 0% { opacity: 0; transform: scale(.2) rotate(-40deg); } 60% { opacity: 1; } 100% { opacity: .9; transform: none; } }

.waitlist {
  margin-top: 34px; text-align: left;
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(246, 233, 212, .6), rgba(255, 252, 246, .7));
  padding: 26px 20px 22px; position: relative;
}
.waitlist h2 { font-size: 29px; text-align: center; line-height: 1.15; }
.waitlist .wl-intro { margin-top: 12px; font-size: 16px; }
.waitlist label.field-label { display: block; font-size: 14px; font-weight: 600; letter-spacing: .03em; color: var(--chocolate); margin: 16px 0 6px; }
.consent { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; font-size: 14.5px; line-height: 1.5; cursor: pointer; }
.consent input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--copper); }
.waitlist .btn { margin-top: 18px; }
.form-msg { font-size: 14.5px; color: var(--copper); font-style: italic; margin: 12px 0 0; min-height: 1.2em; }
.wl-done { text-align: center; padding: 6px 0; animation: enter .5s var(--ease) both; }
.wl-done h3 { font-size: 28px; }
.wl-done p { margin-top: 10px; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Page de confidentialité ---------- */
.legal h1 { font-size: clamp(34px, 9vw, 46px); text-align: center; line-height: 1.1; margin-top: 10px; }
.legal h2 { font-size: 25px; margin: 30px 0 8px; color: var(--chocolate); }
.legal p, .legal li { font-size: 16px; }
.legal ul { padding-left: 1.2em; margin: 0 0 1em; }
.legal .todo { background: #FBEBD3; border-bottom: 1px dashed var(--copper); padding: 0 3px; }
.legal a { color: var(--copper); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-soft); font-size: 14px; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .sky .s { opacity: .35; }
  .glow { opacity: 1; }
  .glow-wrap .st { opacity: .9; }
}
