:root{
  --cream:#FBF7F0;
  --ink:#221F2E;
  --ink-soft:#6B6779;
  --coral:#FF5D6C;
  --coral-deep:#E14456;
  --mint:#2CAF83;
  --gold:#FFC94A;
  --line:#E7DFD1;
  --white:#FFFFFF;
  --radius:18px;
  /* Le logo est un tracé blanc : sa pastille doit rester sombre dans les
     deux thèmes, sinon on obtient du blanc sur crème. Ne pas lier à --ink. */
  --brand-pill:#221F2E;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --cream:#1B1826;
    --ink:#F5F1E8;
    --ink-soft:#B4AFC2;
    --coral-deep:#FF8A95;
    --line:#37324A;
    --white:#252134;
  }
}
:root[data-theme="dark"]{
  --cream:#1B1826;
  --ink:#F5F1E8;
  --ink-soft:#B4AFC2;
  --coral-deep:#FF8A95;
  --line:#37324A;
  --white:#252134;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--cream);
  color:var(--ink);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
}
[hidden]{display:none !important;}
:focus-visible{
  outline:2.5px solid var(--coral);
  outline-offset:2px;
  border-radius:4px;
}
.app{
  max-width:520px;
  margin:0 auto;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  padding:0 20px;
}

/* ---------- progress ---------- */
.progress-wrap{
  padding:16px 0 10px;
  position:sticky;
  top:0;
  background:var(--cream);
  z-index:10;
}
.progress-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}
.progress-label{
  font-size:13px;
  color:var(--ink-soft);
  font-variant-numeric:tabular-nums;
}
.brand-mark{
  display:flex; align-items:center;
  background:var(--brand-pill);
  padding:8px 14px;
  border-radius:100px;
}
.brand-mark img{height:16px; width:auto; display:block;}
.progress-track{
  height:4px;
  background:var(--line);
  border-radius:4px;
  overflow:hidden;
}
.progress-fill{
  height:100%;
  background:var(--coral);
  border-radius:4px;
  transition:width .45s cubic-bezier(.4,0,.2,1);
}

/* ---------- steps ---------- */
.steps-viewport{
  flex:1;
  position:relative;
  /* Doit dépasser la hauteur de .nav-bar, sans quoi le dernier champ d'un
     écran se retrouve sous la barre fixe une fois défilé tout en bas. */
  padding-bottom:132px;
}
.step{
  display:none;
  padding-top:22px;
  animation:stepIn .38s cubic-bezier(.16,1,.3,1);
}
.step.active{display:block;}
@keyframes stepIn{
  from{opacity:0; transform:translateY(14px);}
  to{opacity:1; transform:translateY(0);}
}
@media (prefers-reduced-motion: reduce){
  .step{animation:none;}
  *{transition-duration:.01ms !important;}
}
.step h1{
  font-family:'Fraunces',serif;
  font-weight:600;
  font-size:27px;
  line-height:1.18;
  margin:0 0 8px;
  letter-spacing:-0.2px;
}
.step .sub{
  color:var(--ink-soft);
  font-size:15px;
  line-height:1.5;
  margin:0 0 26px;
  max-width:40ch;
}
.step .sub.center{margin-left:auto; margin-right:auto;}
.hint{
  font-size:13px;
  color:var(--coral-deep);
  margin:-16px 0 22px;
  line-height:1.5;
}
label.field-label{
  display:block;
  font-size:13px;
  font-weight:600;
  color:var(--ink-soft);
  margin:20px 0 8px;
}
label.field-label:first-of-type{margin-top:0;}
input[type="text"], input[type="email"], textarea, select{
  width:100%;
  border:1.5px solid var(--line);
  background:var(--white);
  border-radius:12px;
  padding:13px 14px;
  font-family:'Inter',sans-serif;
  font-size:16px;
  color:var(--ink);
  outline:none;
  transition:border-color .2s;
}
input[type="text"]:focus, input[type="email"]:focus, textarea:focus{
  border-color:var(--coral);
}
textarea{resize:vertical; min-height:90px; line-height:1.5;}
::placeholder{color:var(--ink-soft); opacity:.65;}

/* Quand un champ reçoit le focus, le navigateur le fait défiler « au plus
   court » — et le pose alors juste au-dessus du bord bas, donc derrière la
   barre de navigation fixe. Le champ est invisible et le tap suivant tombe
   sur « Continuer ». scroll-margin-bottom réserve la hauteur de la barre. */
input, textarea, select, button, .chip, .option-card, .check-row,
.upload-zone, .style-chip, .sector-chip, .strip-swatch{
  scroll-margin-bottom:132px;
  scroll-margin-top:72px;
}

/* ---------- resume draft ---------- */
.resume-card{
  background:var(--white);
  border:1.5px solid var(--coral);
  border-radius:16px;
  padding:16px 18px;
  margin-bottom:24px;
}
.resume-text{margin:0 0 12px; font-size:14.5px; line-height:1.5;}
.resume-actions{display:flex; gap:8px;}
.btn-sm{
  border:1.5px solid var(--line);
  background:var(--white);
  color:var(--ink);
  border-radius:100px;
  padding:9px 18px;
  font-family:'Inter',sans-serif;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
}
.btn-sm-primary{background:var(--ink); border-color:var(--ink); color:var(--cream);}

/* ---------- blocs de l'accueil ---------- */
.intro-block{margin-bottom:28px;}
.intro-block:last-of-type{margin-bottom:10px;}
.block-title{
  font-family:'Fraunces',serif;
  font-size:17px;
  font-weight:600;
  margin:0 0 14px;
  padding-bottom:10px;
  border-bottom:1.5px solid var(--line);
}
.block-note{
  font-size:12.5px;
  color:var(--ink-soft);
  line-height:1.45;
  margin:10px 0 12px;
}

/* ---------- chips ---------- */
.chip-grid{display:flex; flex-wrap:wrap; gap:9px;}
.chip{
  border:1.5px solid var(--line);
  background:var(--white);
  color:var(--ink);
  padding:10px 16px;
  border-radius:100px;
  font-family:'Inter',sans-serif;
  font-size:14.5px;
  font-weight:500;
  cursor:pointer;
  user-select:none;
  transition:all .15s;
  -webkit-tap-highlight-color:transparent;
}
.chip[aria-pressed="true"], .chip.on{
  background:var(--ink);
  border-color:var(--ink);
  color:var(--cream);
}
.other-input-wrap{margin-top:12px;}
.other-input-row{display:flex; gap:8px;}
.other-input-row input{flex:1;}
.btn-add-other{
  border:none; background:var(--ink); color:var(--cream);
  border-radius:10px; padding:0 16px;
  font-family:'Inter',sans-serif;
  font-weight:600; font-size:14px; cursor:pointer;
}

/* ---------- option cards ---------- */
.option-list{display:flex; flex-direction:column; gap:10px;}
.option-card{
  display:block;
  width:100%;
  text-align:left;
  border:1.5px solid var(--line);
  background:var(--white);
  color:var(--ink);
  border-radius:14px;
  padding:14px 16px;
  font-family:'Inter',sans-serif;
  cursor:pointer;
  transition:all .15s;
  -webkit-tap-highlight-color:transparent;
}
.option-card[aria-checked="true"]{border-color:var(--ink); background:var(--ink); color:var(--cream);}
.option-card .ot-title{font-weight:600; font-size:16px; margin-bottom:4px;}
.option-card .ot-example{font-size:13px; color:var(--ink-soft); line-height:1.4;}
.option-card[aria-checked="true"] .ot-example{color:rgba(255,255,255,0.65);}

/* ---------- sector chips ---------- */
.sector-grid{display:flex; flex-wrap:wrap; gap:8px; margin-top:2px;}
.sector-chip{
  border:1.5px solid var(--line);
  background:var(--white);
  color:var(--ink);
  padding:8px 14px;
  border-radius:100px;
  font-family:'Inter',sans-serif;
  font-size:13.5px;
  font-weight:500;
  cursor:pointer;
  transition:all .15s;
}
.sector-chip[aria-pressed="true"]{background:var(--ink); border-color:var(--ink); color:var(--cream);}

/* ---------- color palettes ---------- */
.style-chip-row{display:flex; flex-wrap:wrap; gap:9px; margin-bottom:22px;}
.style-chip{
  border:1.5px solid var(--line);
  background:var(--white);
  color:var(--ink);
  padding:11px 16px;
  border-radius:14px;
  font-family:'Inter',sans-serif;
  font-size:14.5px;
  font-weight:600;
  cursor:pointer;
  transition:all .15s;
  -webkit-tap-highlight-color:transparent;
}
.style-chip .dots{display:inline-flex; gap:3px; margin-right:8px; vertical-align:middle;}
.style-chip .dots span{width:9px;height:9px;border-radius:50%;display:inline-block;}
.style-chip[aria-pressed="true"]{border-color:var(--ink); background:var(--ink); color:var(--cream);}
.style-chip.advise{border-style:dashed;}
.palette-panel{
  background:var(--white);
  border:1.5px solid var(--line);
  border-radius:16px;
  padding:18px;
  margin-bottom:18px;
}
.palette-panel-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}
.palette-panel-title{font-size:13.5px; font-weight:600; color:var(--ink-soft); margin:0;}
.palette-count{
  font-size:12.5px;
  color:var(--ink-soft);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.palette-count.full{color:var(--coral-deep); font-weight:600;}

.palette-item{margin-bottom:18px;}
.palette-item:last-child{margin-bottom:0;}
.palette-name{font-size:12.5px; font-weight:600; color:var(--ink-soft); margin:0 0 8px;}

/* Les teintes sont jointives : c'est leur rapport les unes aux autres
   qu'on juge dans une palette, pas chaque couleur isolée. */
.palette-strip{
  display:flex;
  border-radius:12px;
  overflow:hidden;
  border:1.5px solid var(--line);
}
.strip-swatch{
  flex:1 1 0;
  height:64px;
  min-width:0;
  padding:0;
  border:none;
  position:relative;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.strip-swatch + .strip-swatch{box-shadow:inset 1px 0 0 rgba(0,0,0,.07);}
.strip-swatch::after{
  content:"✓";
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  font-weight:700;
  opacity:0;
  transition:opacity .15s;
}
.strip-swatch[aria-pressed="true"]::after{opacity:1;}
/* La coche prend le contraire de la teinte : un ✓ blanc disparaîtrait
   sur du #FFFFFF, un ✓ noir sur du #0D0D0D. */
.strip-swatch[data-tone="light"]::after{color:#111; text-shadow:0 1px 2px rgba(255,255,255,.6);}
.strip-swatch[data-tone="dark"]::after{color:#fff; text-shadow:0 1px 3px rgba(0,0,0,.45);}
.strip-swatch[aria-pressed="true"]{
  outline:3px solid var(--ink);
  outline-offset:-3px;
  z-index:1;
}
.palette-picked{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid var(--line);
}
.palette-picked:empty{display:none;}
.picked-chip{
  display:inline-flex;
  align-items:center;
  gap:7px;
  background:var(--cream);
  border:1px solid var(--line);
  border-radius:100px;
  padding:5px 11px 5px 6px;
  font-size:12px;
  font-variant-numeric:tabular-nums;
  color:var(--ink);
}
.picked-chip i{
  width:16px;
  height:16px;
  border-radius:50%;
  border:1px solid rgba(0,0,0,.12);
  display:block;
}

.advise-note{
  background:var(--white);
  border:1.5px dashed var(--line);
  border-radius:16px;
  padding:16px 18px;
  font-size:14px;
  color:var(--ink-soft);
  margin:0 0 18px;
  line-height:1.5;
}

/* ---------- upload ---------- */
.upload-zone{
  display:block;
  width:100%;
  border:1.75px dashed var(--line);
  border-radius:14px;
  padding:26px 16px;
  text-align:center;
  cursor:pointer;
  color:var(--ink-soft);
  font-family:'Inter',sans-serif;
  font-size:14px;
  background:var(--white);
  transition:border-color .2s, background .2s;
}
.upload-zone:active{background:var(--cream);}
.upload-zone strong{color:var(--ink); font-weight:600; display:block; margin-bottom:3px; font-size:15px;}
.thumb-grid{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}
.thumb{
  width:76px;
  height:76px;
  border-radius:10px;
  overflow:hidden;
  position:relative;
  background:var(--line);
}
.thumb img{width:100%; height:100%; object-fit:cover; display:block;}
.thumb .rm{
  position:absolute;
  top:3px; right:3px;
  width:22px; height:22px;
  background:rgba(20,18,28,0.75);
  color:#fff;
  border:none;
  border-radius:50%;
  font-size:12px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.thumb.doc{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  padding:6px;
  text-align:center;
  background:var(--white);
  border:1.5px solid var(--line);
}
.thumb.doc .doc-icon{font-size:21px; line-height:1;}
.thumb.doc .doc-name{
  font-size:9px;
  line-height:1.15;
  color:var(--ink-soft);
  word-break:break-all;
  max-height:2.3em;
  overflow:hidden;
}
.thumb.pending{
  display:flex; align-items:center; justify-content:center;
  color:var(--ink-soft); font-size:11px;
  border:1.5px dashed var(--line);
  background:var(--white);
}

/* ---------- checkbox list ---------- */
.check-list{display:flex; flex-direction:column; gap:2px;}
.check-row{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:13px 2px;
  border:none;
  border-bottom:1px solid var(--line);
  background:none;
  color:var(--ink);
  font-family:'Inter',sans-serif;
  text-align:left;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.check-row:last-child{border-bottom:none;}
.check-box{
  width:22px; height:22px;
  border-radius:6px;
  border:1.75px solid var(--line);
  flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  transition:all .15s;
  background:var(--white);
}
.check-row[aria-pressed="true"] .check-box{
  background:var(--coral);
  border-color:var(--coral);
}
.check-row[aria-pressed="true"] .check-box::after{
  content:"✓"; color:#fff; font-size:13px; font-weight:700;
}
.check-text{font-size:15px;}

/* ---------- nav ---------- */
.nav-bar{
  position:fixed;
  bottom:0; left:0; right:0;
  background:linear-gradient(to top, var(--cream) 60%, transparent);
  padding:22px 20px calc(22px + env(safe-area-inset-bottom));
  display:flex;
  gap:10px;
  justify-content:center;
  z-index:20;
}
.nav-inner{
  max-width:520px;
  width:100%;
  display:flex;
  gap:10px;
}
.btn{
  border:none;
  border-radius:100px;
  padding:16px 20px;
  font-family:'Inter',sans-serif;
  font-size:15.5px;
  font-weight:600;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:transform .12s, opacity .15s;
}
.btn:active{transform:scale(.97);}
.btn-primary{
  background:var(--ink);
  color:var(--cream);
  flex:1;
}
.btn-primary:disabled{opacity:.35; pointer-events:none;}
.btn-ghost{
  background:transparent;
  color:var(--ink-soft);
  border:1.5px solid var(--line);
  width:52px;
  flex-shrink:0;
}

/* ---------- intro ---------- */
.intro{
  padding-top:7vh;
  text-align:left;
}
.intro .intro-logo{
  margin-bottom:24px;
  background:var(--brand-pill);
  display:inline-flex;
  padding:16px 22px;
  border-radius:20px;
}
.intro .intro-logo img{height:38px; width:auto; display:block;}
.intro .kicker{
  color:var(--coral);
  font-weight:600;
  font-size:14px;
  margin:0 0 14px;
}
.intro h1{
  font-family:'Fraunces',serif;
  font-size:34px;
  line-height:1.1;
  font-weight:600;
  margin:0 0 14px;
  letter-spacing:-0.5px;
}
.intro .lede{
  color:var(--ink-soft);
  font-size:16px;
  line-height:1.55;
  max-width:38ch;
  margin:0 0 28px;
}

/* ---------- recap ---------- */
.recap-block{
  background:var(--white);
  border:1.5px solid var(--line);
  border-radius:16px;
  padding:18px;
  margin-bottom:14px;
}
.recap-block h3{
  font-family:'Fraunces',serif;
  font-size:16px;
  font-weight:600;
  margin:0 0 10px;
}
.recap-block p{margin:0; font-size:14.5px; line-height:1.55; color:var(--ink);}
.recap-block p.muted{color:var(--ink-soft); font-style:italic;}
.recap-swatches{display:flex; gap:8px; margin-top:4px;}
.recap-dot{width:26px;height:26px;border-radius:50%; border:1.5px solid rgba(0,0,0,.08);}
.recap-thumbs{display:flex; gap:8px; flex-wrap:wrap; margin-top:4px;}
.recap-thumbs img{width:56px; height:56px; object-fit:cover; border-radius:8px;}
.tag-pill{
  display:inline-block;
  background:var(--cream);
  border:1px solid var(--line);
  padding:5px 11px;
  border-radius:100px;
  font-size:13px;
  margin:0 6px 6px 0;
}

/* ---------- send / share ---------- */
.send-card{margin-bottom:22px;}
.send-status{
  margin:10px 0 0;
  font-size:13.5px;
  line-height:1.5;
  color:var(--ink-soft);
  text-align:center;
}
.send-status.ok{color:var(--mint); font-weight:600;}
.send-status.err{color:var(--coral-deep);}
.more-actions{
  border:1.5px solid var(--line);
  background:var(--white);
  border-radius:16px;
  padding:14px 18px;
  margin-bottom:18px;
}
.more-actions summary{
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  color:var(--ink-soft);
}
.share-actions{display:flex; flex-direction:column; gap:10px; margin-top:14px;}
.btn-block{
  width:100%;
  padding:15px;
  border-radius:14px;
  font-family:'Inter',sans-serif;
  font-weight:600;
  font-size:15px;
  border:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn-block:disabled{opacity:.45; pointer-events:none;}
.btn-send{background:var(--coral); color:#fff; font-size:16px; padding:17px;}
/* Une fois parti, le bouton reste inactif mais ne doit pas avoir l'air
   éteint : le griser juste au moment où l'on félicite tombe à plat. */
.btn-send.sent{background:var(--mint); color:#fff; opacity:1;}
.btn-send.sent:disabled{opacity:1;}
.btn-copy{background:var(--cream); color:var(--ink); border:1.5px solid var(--line);}
.btn-back-recap{
  display:block;
  width:100%;
  background:none;
  border:none;
  color:var(--ink-soft);
  font-family:'Inter',sans-serif;
  font-size:14px;
  padding:8px 0 40px;
  cursor:pointer;
}
/* Les bonbons de fin : purement décoratifs, au-dessus de tout,
   et jamais cliquables pour ne pas gêner le bouton en dessous. */
.candy-burst{
  position:fixed;
  width:0;
  height:0;
  pointer-events:none;
  z-index:60;
}
.candy{
  position:absolute;
  left:0;
  top:0;
  display:block;
  opacity:0;
  will-change:transform, opacity;
  filter:drop-shadow(0 3px 5px rgba(20,18,28,.22));
}
.candy svg{display:block;}
@media (prefers-reduced-motion: reduce){
  .candy-burst{display:none;}
}

.toast{
  position:fixed;
  bottom:100px;
  left:50%;
  transform:translateX(-50%) translateY(10px);
  background:var(--ink);
  color:var(--cream);
  padding:11px 18px;
  border-radius:100px;
  font-size:13.5px;
  opacity:0;
  pointer-events:none;
  transition:all .25s;
  z-index:50;
  max-width:calc(100% - 40px);
  text-align:center;
}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0);}
.done-hero{text-align:center; padding:8px 0 22px;}
.done-hero .emoji{font-size:44px; margin-bottom:10px;}
.done-hero h1{margin-bottom:6px;}
input[type=file]{display:none;}
