/* DA « fait main » : papier kraft, encre, tampons rouges, ruban adhésif. Mobile d'abord. */
@font-face { font-family: "Fraunces"; font-weight: 600; font-display: swap; src: url(/fonts/fraunces-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 700; font-display: swap; src: url(/fonts/fraunces-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/fraunces-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Kalam"; font-weight: 400; font-display: swap; src: url(/fonts/kalam-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Kalam"; font-weight: 700; font-display: swap; src: url(/fonts/kalam-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url(/fonts/figtree-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url(/fonts/figtree-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url(/fonts/figtree-latin-700-normal.woff2) format("woff2"); }

:root {
  --kraft: #efe2cd;
  --kraft-deep: #e3d1b4;
  --paper: #fffaf1;
  --ink: #2a1e17;
  --ink-soft: #6b5646;
  --red: #b3302a;
  --red-deep: #8e2420;
  --pine: #2d5540;
  --gold: #c39433;
  --line: #d8c5a6;
  --tape: rgba(230, 205, 150, 0.75);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --hand: "Kalam", "Comic Sans MS", cursive;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(42, 30, 23, 0.06), 0 6px 18px -8px rgba(42, 30, 23, 0.35);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
  background-color: var(--kraft);
  /* grain de papier */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  min-height: 100vh;
  min-height: 100dvh;
}
img, svg { max-width: 100%; }
a { color: var(--red); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}
.hand { font-family: var(--hand); }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }

/* ---------- En-tête ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; }
.brand { font: 700 19px/1 var(--hand); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 26px; height: 26px; border-radius: 6px; background: var(--red); color: #fff; display: grid; place-items: center; font: 700 15px/1 var(--hand); transform: rotate(-6deg); }
.lang-switch { font: 600 13px var(--body); color: var(--ink-soft); text-decoration: none; border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 24px; border: 0; border-radius: 99px;
  background: var(--red); color: #fff; font: 700 17px var(--body); text-decoration: none;
  box-shadow: 0 3px 0 var(--red-deep); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-deep); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.ghost:active { box-shadow: inset 0 0 0 2px var(--ink); }
.btn.pine { background: var(--pine); box-shadow: 0 3px 0 #1d3a2b; }
.link-btn { background: none; border: 0; padding: 8px 4px; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: 15px; }

/* ---------- Landing ---------- */
.hero { padding-block: 10px 26px; }
.countdown { display: inline-block; font: 700 14px var(--body); letter-spacing: .01em; color: var(--red); border: 2px dashed var(--red); border-radius: 8px; padding: 2px 10px; transform: rotate(-2deg); margin-bottom: 14px; }
h1 { font: 700 clamp(32px, 9vw, 46px)/1.05 var(--display); letter-spacing: -0.02em; margin: 0 0 14px; text-wrap: balance; }
h1 em { font-style: italic; font-weight: 400; color: var(--red); }
h2 { font: 700 clamp(25px, 6.5vw, 32px)/1.1 var(--display); margin: 0 0 10px; text-wrap: balance; }
h3 { font: 700 19px/1.25 var(--display); margin: 0 0 6px; }
.lede { font-size: 18px; margin: 0 0 22px; color: var(--ink-soft); max-width: 34em; }
.price-note { margin: 10px 0 0; font-size: 14px; color: var(--ink-soft); text-align: center; }
.section { padding-block: 34px; border-top: 2px dashed var(--line); }
.steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.steps .n { width: 40px; height: 40px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); display: grid; place-items: center; font: 700 20px var(--hand); transform: rotate(-4deg); }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag { font: 600 14px var(--body); padding: 6px 12px; border-radius: 99px; background: var(--paper); border: 1.5px solid var(--line); }
.faq details { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; margin-top: 10px; box-shadow: var(--shadow); }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font: 700 20px/1 var(--hand); color: var(--red); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 10px 0 0; color: var(--ink-soft); }
footer.foot { padding-block: 30px calc(30px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 8px 16px; }
footer.foot a { color: var(--ink-soft); }

/* ---------- Calendrier (grille de cases) ---------- */
.cal-head { text-align: center; margin: 6px 0 16px; }
.cal-head .for { font: 700 26px/1.1 var(--hand); }
.cal-head .from { font: 400 16px var(--hand); color: var(--ink-soft); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid.twelve { grid-template-columns: repeat(3, 1fr); }
.door {
  position: relative; aspect-ratio: 3 / 4; border: 0; border-radius: 10px; padding: 8px 6px;
  background: var(--paper); box-shadow: var(--shadow); cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left;
  -webkit-tap-highlight-color: transparent; transition: transform .15s ease;
}
.door:nth-child(4n+1) { transform: rotate(-1.5deg); }
.door:nth-child(4n+2) { transform: rotate(1deg); }
.door:nth-child(4n+3) { transform: rotate(-0.5deg); }
.door:nth-child(4n) { transform: rotate(1.8deg); }
.door:active { transform: scale(.96); }
.door::before { /* ruban adhésif */
  content: ""; position: absolute; top: -6px; left: 50%; width: 44%; height: 14px; transform: translateX(-50%) rotate(-3deg);
  background: var(--tape); box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
.door .num { font: 700 30px/1 var(--hand); color: var(--ink); margin-top: 8px; }
.door .kind { font: 600 11px/1.2 var(--body); color: var(--ink-soft); letter-spacing: .02em; text-transform: uppercase; }
.door.red { background: #f6dcd6; } .door.green { background: #dbe7dc; } .door.gold { background: #f3e3bf; }
.door.mine { background: var(--paper); box-shadow: var(--shadow), inset 0 0 0 2px var(--red); }
.door.mine .kind { color: var(--red); filter: none !important; }
.door.todo::after { content: "✎"; position: absolute; right: 8px; top: 8px; font: 700 15px/1 var(--body); color: var(--red); }
.door.locked .num { opacity: .9; }
.door.locked .kind { filter: blur(3.5px); user-select: none; }
.door .lock { position: absolute; right: 7px; bottom: 7px; width: 18px; height: 18px; opacity: .55; }
.door.opened::after { /* tampon « ouverte » */
  content: ""; position: absolute; right: 6px; top: 8px; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--red); opacity: .7;
}
.door.today { outline: 3px solid var(--red); outline-offset: 2px; animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 88%, 100% { rotate: 0deg; } 92% { rotate: -3deg; } 96% { rotate: 3deg; } }
.door .when { font: 400 12px/1.2 var(--hand); color: var(--ink-soft); }

/* ---------- Carte d'une case (feuille) ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(42, 30, 23, .55); display: grid; align-items: end; z-index: 50; animation: fade .2s ease; }
@media (min-width: 640px) { .sheet-back { align-items: center; justify-items: center; } }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  background: var(--paper); border-radius: 22px 22px 0 0; padding: 26px 22px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,.25); animation: rise .28s cubic-bezier(.2,.8,.3,1);
}
@media (min-width: 640px) { .sheet { border-radius: 22px; } }
.sheet .close { position: absolute; right: 12px; top: 10px; width: 44px; height: 44px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--ink-soft); }
.stamp { display: inline-block; font: 700 13px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--red); border: 2px solid var(--red); border-radius: 6px; padding: 5px 8px; transform: rotate(-3deg); }
.case-day { font: 700 18px var(--hand); color: var(--ink-soft); margin-left: 8px; }
.case-title { font: 700 26px/1.15 var(--display); margin: 14px 0 10px; }
.case-text { font-size: 19px; line-height: 1.55; white-space: pre-wrap; margin: 0; }
.case-sign { font: 400 22px var(--hand); color: var(--ink-soft); text-align: right; margin-top: 14px; }
.reveal { margin-top: 14px; }
.answer { font: 700 22px var(--hand); color: var(--pine); margin-top: 8px; }
.case-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.case-edit textarea, .field textarea, .field input, .field select {
  width: 100%; border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 12px 14px; font-size: 17px;
}
.case-edit textarea { min-height: 150px; resize: vertical; }
.field textarea { min-height: 110px; resize: vertical; }
.field textarea:focus, .field input:focus, .case-edit textarea:focus, .field select:focus { border-color: var(--ink); outline: none; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Questionnaire ---------- */
.quiz { padding-block: 8px 120px; }
.progress { height: 6px; background: var(--kraft-deep); border-radius: 99px; overflow: hidden; margin: 6px 0 22px; }
.progress span { display: block; height: 100%; background: var(--red); border-radius: 99px; transition: width .3s ease; }
.q-num { font: 700 16px var(--hand); color: var(--red); }
.q-title { font: 700 clamp(26px, 7.5vw, 34px)/1.12 var(--display); margin: 4px 0 8px; text-wrap: balance; }
.q-help { color: var(--ink-soft); margin: 0 0 18px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  min-height: 46px; padding: 0 16px; border-radius: 99px; border: 2px solid var(--ink); background: var(--paper);
  font: 600 16px var(--body); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pill.add { border-style: dashed; color: var(--ink-soft); border-color: var(--ink-soft); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; }
.examples { font-size: 14px; color: var(--ink-soft); margin-top: 6px; }
.examples button { font: inherit; color: var(--pine); background: none; border: 0; padding: 4px 0; text-decoration: underline; cursor: pointer; text-align: left; }
.quiz-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: linear-gradient(to top, var(--kraft) 70%, rgba(239, 226, 205, 0));
  padding: 22px max(18px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
.quiz-nav .in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.back { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); font-size: 22px; cursor: pointer; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--paper); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; cursor: pointer; }
.switch input { width: 24px; height: 24px; accent-color: var(--red); }
.daypick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.daypick button { aspect-ratio: 1; border-radius: 10px; border: 2px solid var(--line); background: var(--paper); font: 700 18px var(--hand); cursor: pointer; }
.daypick button[aria-pressed="true"] { border-color: var(--red); background: var(--red); color: #fff; }

/* ---------- Écriture en cours ---------- */
.writing { min-height: 70dvh; display: grid; align-content: center; text-align: center; gap: 18px; padding-block: 30px; }
.writing .grid .door { animation: pop .4s ease both; }
.writing .grid .door.empty { opacity: .25; animation: none; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { opacity: 1; } }
.writing-msg { font: 400 22px/1.3 var(--hand); min-height: 2.6em; }

/* ---------- Résultat et envoi ---------- */
.result { padding-block: 8px 130px; }
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: linear-gradient(to top, var(--kraft) 72%, rgba(239, 226, 205, 0));
  padding: 24px max(18px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
.sticky-cta .in { max-width: 560px; margin: 0 auto; }
.note-card { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin: 16px 0; }
.checklist { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.checklist li::before { content: "✓"; color: var(--pine); font-weight: 700; margin-right: 8px; }
.consent { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--ink-soft); margin: 14px 0; }
.consent input { width: 22px; height: 22px; accent-color: var(--red); margin-top: 2px; }
.share-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 12px 0; }
.share-box input { border: 2px dashed var(--ink); border-radius: 12px; padding: 12px; background: #fff; font: 600 15px var(--body); min-width: 0; }
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 99px; z-index: 80; font-weight: 600; animation: fade .2s ease; }
.error { color: var(--red-deep); font-weight: 600; }

/* ---------- Médias d'une case ---------- */
.case-photo { display: block; width: 100%; max-height: 52dvh; object-fit: cover; border-radius: 6px; margin: 4px 0 14px;
  border: 8px solid #fff; border-bottom-width: 26px; box-shadow: var(--shadow); transform: rotate(-1deg); }
.case-voice { width: 100%; margin-top: 14px; }
.case-music { width: 100%; border: 0; border-radius: 12px; margin-top: 14px; height: 152px; }
.case-music.youtube { height: auto; aspect-ratio: 16 / 9; }
.case-music.apple { height: 175px; }
.media-box { background: var(--kraft); border-radius: 12px; padding: 12px; margin-top: 12px; display: grid; gap: 10px; }
.media-box .rec { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.media-box .timer { font: 700 18px var(--hand); color: var(--red); min-width: 56px; }
.media-thumb { max-height: 160px; width: auto; border-radius: 8px; }

/* ---------- Réactions ---------- */
.react { margin-top: 18px; padding-top: 14px; border-top: 2px dashed var(--line); }
.emojis { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.emojis button { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 24px; cursor: pointer; }
.emojis button[aria-pressed="true"] { border-color: var(--red); background: #fbe9e6; transform: scale(1.08); }
.door .badge-r { position: absolute; left: 6px; bottom: 6px; font-size: 16px; line-height: 1; }
.reaction-box { background: #fbe9e6; border-radius: 12px; padding: 10px 12px; margin: 10px 0; }

/* ---------- Offres ---------- */
.plans { display: grid; gap: 12px; margin: 14px 0; }
.plan { position: relative; display: grid; grid-template-columns: 26px 1fr auto; gap: 4px 12px; align-items: start; text-align: left; width: 100%;
  background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 14px; cursor: pointer; }
.plan[aria-checked="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(179, 48, 42, .15); }
.plan .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink-soft); margin-top: 2px; }
.plan[aria-checked="true"] .dot { border: 7px solid var(--red); }
.plan .pname { font: 700 18px var(--display); }
.plan .pprice { font: 700 20px var(--display); white-space: nowrap; }
.plan ul { grid-column: 2 / 4; margin: 4px 0 0; padding-left: 18px; font-size: 15px; color: var(--ink-soft); }
.plan .badge { position: absolute; top: -10px; right: 14px; background: var(--red); color: #fff; font: 700 12px var(--body); padding: 3px 9px; border-radius: 99px; }

/* ---------- Après paiement ---------- */
.tasks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.tasks li { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.tasks li::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink-soft); }
.tasks li.done { color: var(--ink-soft); text-decoration: line-through; }
.tasks li.done::before { background: var(--pine); border-color: var(--pine); }
.meter { height: 8px; background: var(--kraft-deep); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; background: var(--pine); border-radius: 99px; transition: width .3s ease; }
.guide { background: #fff3c4; border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 15px; }
.guide b { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--warn, #8a5a00); margin-bottom: 2px; }
.row { display: grid; grid-template-columns: 1fr 86px auto; gap: 8px; align-items: end; margin-bottom: 10px; }
.row .field { margin: 0; }
.row .x { height: 48px; border: 0; background: none; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tool-row .btn { min-height: 44px; padding: 0 16px; font-size: 15px; }
.bon-list { display: grid; gap: 8px; max-height: 50dvh; overflow: auto; margin-top: 10px; }
.bon-list button { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 15px; cursor: pointer; }
.code-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.code-box input { border: 2px solid var(--ink); border-radius: 12px; padding: 12px; font-size: 18px; min-width: 0; }

/* ---------- Vue destinataire ---------- */
.envelope-intro { min-height: 86dvh; display: grid; align-content: center; justify-items: center; gap: 22px; text-align: center; }
.envelope {
  position: relative; width: min(300px, 80vw); aspect-ratio: 1.45; background: var(--paper); border-radius: 10px; box-shadow: var(--shadow);
  display: grid; place-items: center; border: 0; cursor: pointer;
}
.envelope::before { content: ""; position: absolute; inset: 0 0 40% 0; background: var(--kraft-deep); clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 10px 10px 0 0; }
.seal { position: relative; width: 66px; height: 66px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font: 700 26px var(--hand); box-shadow: inset 0 0 0 4px rgba(255,255,255,.15); margin-top: 10px; }
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Pages légales ---------- */
.legal { padding-block: 10px 50px; }
.legal h1 { font-size: 32px; }
.legal h2 { font-size: 22px; margin-top: 26px; }
.legal p, .legal li { color: var(--ink); }
.todo { background: #fff3c4; padding: 0 4px; border-radius: 4px; }
