/* Fast Start Lab — tokens et composants partagés.
   Référence de DA : la page Fast Gains List. Outil, pas affiche :
   blanc/noir, violet pour ce qui se touche, mauve pour ce qui est choisi ou calculé.
   Une colonne, le résultat toujours au-dessus du détail. */

@font-face {
  font-family: "Figtree"; font-style: normal; font-display: swap; font-weight: 300 900;
  src: url(/lab/fonts/figtree-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-display: swap; font-weight: 300 900;
  src: url(/lab/fonts/figtree-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --bg: #FFFFFF;
  --surface: #F7F5FB;
  --line: #E6E1EF;
  --text: #15131A;
  --soft: #635C70;
  --violet: #6B3FD4;
  --violet-hover: #5A31BD;
  --on-violet: #FFFFFF;
  --mauve: #EEE7FC;
  --mauve-ink: #4A2A9A;
  --alert: #B4362B;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0D12; --surface: #17151E; --line: #2A2634; --text: #F3F1F7; --soft: #A59EB3;
    --violet: #9B7CFF; --violet-hover: #AE95FF; --on-violet: #120D22; --mauve: #251D3B; --mauve-ink: #CDBDFF; --alert: #FF8F80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0D12; --surface: #17151E; --line: #2A2634; --text: #F3F1F7; --soft: #A59EB3;
  --violet: #9B7CFF; --violet-hover: #AE95FF; --on-violet: #120D22; --mauve: #251D3B; --mauve-ink: #CDBDFF; --alert: #FF8F80;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--font); caret-color: var(--violet); }
::selection { background: var(--mauve); color: var(--mauve-ink); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
a { color: var(--violet); text-underline-offset: 3px; }
a:hover { color: var(--violet-hover); }
.wrap { max-width: 600px; margin: 0 auto; padding: 24px 18px 72px; }
.brand { font-size: 13px; font-weight: 600; color: var(--soft); margin: 0 0 20px; }
h1 { font-size: clamp(32px, 9vw, 42px); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.lead { margin: 10px 0 0; color: var(--soft); font-size: 17px; max-width: 42ch; }
section { margin-top: 40px; }
h2 { font-size: 21px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 4px; display: flex; gap: 10px; align-items: center; }
h2 .n { width: 26px; height: 26px; border-radius: 50%; background: var(--mauve); color: var(--mauve-ink); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
p { text-wrap: pretty; }
.sub { margin: 0 0 16px; color: var(--soft); font-size: 15px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Champs ---------- */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label, .lbl { font-size: 13.5px; font-weight: 600; color: var(--soft); }
input[type=number], input[type=text], input[type=email], select {
  width: 100%; min-height: 48px; padding: 10px 12px; font: 500 17px var(--font); color: var(--text);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; appearance: none; -webkit-appearance: none;
  font-variant-numeric: tabular-nums;
}
input[type=number]:hover, input[type=text]:hover, input[type=email]:hover, select:hover { border-color: var(--soft); }
input[type=number]:focus, input[type=text]:focus, input[type=email]:focus, select:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px var(--mauve); }
input[aria-invalid=true] { border-color: var(--alert); }
select { padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%); background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }

/* Segments (choix exclusif) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 8px; font-size: 15px; font-weight: 600; color: var(--soft); cursor: pointer; text-align: center; line-height: 1.2; padding: 4px 6px; }
.seg label small { font-size: 12px; font-weight: 500; }
.seg input:checked + label { background: var(--violet); color: var(--on-violet); }
.seg input:focus-visible + label { outline: 2px solid var(--violet); outline-offset: 2px; }

/* Puces (choix multiple) */
.group { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.group legend { padding: 0; margin-bottom: 8px; width: 100%; display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.group legend small { font-size: 13px; font-weight: 600; color: var(--soft); font-variant-numeric: tabular-nums; }
.group legend small.ok { color: var(--violet); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 15px; font-weight: 500; }
.chip input:hover + span { border-color: var(--soft); }
.chip input:checked + span { background: var(--mauve); border-color: var(--violet); color: var(--mauve-ink); font-weight: 600; }
.chip input:disabled { cursor: not-allowed; }
.chip input:disabled + span { opacity: .4; }
.chip input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }

/* Cases à cocher */
.check-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; min-height: 44px; padding: 10px 0; cursor: pointer; font-size: 15px; }
.check-row input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; border: 1.5px solid var(--soft); border-radius: 7px; background: var(--bg); cursor: pointer; display: grid; place-content: center; }
.check-row input::after { content: ""; width: 12px; height: 7px; border-left: 2.5px solid var(--on-violet); border-bottom: 2.5px solid var(--on-violet); transform: translateY(-1.5px) rotate(-45deg); opacity: 0; }
.check-row input:checked { background: var(--violet); border-color: var(--violet); }
.check-row input:checked::after { opacity: 1; }
.check-row input[aria-invalid=true] { border-color: var(--alert); }

/* ---------- Boutons, messages ---------- */
.act { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.btn { font: 700 16px/1 var(--font); min-height: 50px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--violet); color: var(--on-violet); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.btn:hover { background: var(--violet-hover); color: var(--on-violet); }
.btn svg { width: 18px; height: 18px; }
.btn[disabled], .btn[aria-busy=true] { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.btn.quiet { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.btn.quiet:hover { background: var(--surface); border-color: var(--soft); color: var(--text); }
.btn.danger { background: transparent; color: var(--alert); border: 1.5px solid var(--alert); }
.link { font: 600 15px var(--font); color: var(--violet); background: none; border: 0; padding: 0; min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--violet-hover); }
.link[disabled] { color: var(--soft); text-decoration: none; cursor: default; font-variant-numeric: tabular-nums; }
.status { font-size: 14px; color: var(--soft); }
.note { margin: 10px 0 0; font-size: 14.5px; color: var(--alert); }

/* Liste (en-tête + lignes) */
.list { border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.list .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 14px 16px; background: var(--surface); border-bottom: 1.5px solid var(--line); }
.list .head b { font-weight: 800; }
.list .head span { font-size: 13.5px; color: var(--soft); font-variant-numeric: tabular-nums; }
.cat { padding: 12px 16px 2px; font-size: 13px; font-weight: 700; color: var(--violet); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 16px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.cat + .row { border-top: 0; }
.row .name { font-weight: 600; }
.row .q { font-weight: 800; text-align: right; white-space: nowrap; }
.row .meta { grid-column: 1 / -1; font-size: 13px; color: var(--soft); }

.after { margin-top: 44px; padding: 20px; border-radius: 14px; background: var(--mauve); color: var(--text); }
.after h2 { color: var(--mauve-ink); }
.after p { margin: 8px 0 0; max-width: 48ch; }
.fine { margin-top: 30px; font-size: 12.5px; color: var(--soft); }
.fine p { margin: 0 0 8px; max-width: 54ch; }
.fine a { display: inline-block; padding: 13px 0; }

/* ---------- Socle : barre du haut ---------- */
.lab-bar { border-bottom: 1px solid var(--line); background: var(--bg); }
.lab-bar .in { max-width: 600px; margin: 0 auto; padding: 0 18px; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lab-bar .home { font-weight: 800; font-size: 15px; letter-spacing: -.01em; color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.lab-bar .right { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.lab-bar .right a, .lab-bar .right button { font: 600 14px var(--font); color: var(--violet); background: none; border: 0; padding: 0; min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; text-decoration: none; }
.lab-saved { color: var(--soft); font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.lab-saved svg { width: 14px; height: 14px; }
.lab-saved.off { color: var(--alert); }

/* ---------- Socle : bloc d'enregistrement ---------- */
.lab-save { margin-top: 44px; padding: 20px; border: 1.5px solid var(--violet); border-radius: 14px; background: var(--bg); }
.lab-save h2 { margin-bottom: 6px; }
.lab-save .sub { margin-bottom: 18px; max-width: 44ch; }
.lab-save .fields { margin-bottom: 6px; }
.lab-save .btn { margin-top: 12px; }
.lab-save .links { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 8px; }
.lab-save .note { margin: 12px 0 0; }
.lab-save.done { border-color: var(--line); background: var(--mauve); }
.lab-save.done h2 { color: var(--mauve-ink); }

/* Code à 6 chiffres */
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.otp input { width: 100%; min-height: 56px; padding: 0; text-align: center; font: 800 24px var(--font); color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; appearance: none; -webkit-appearance: none; font-variant-numeric: tabular-nums; }
.otp input:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px var(--mauve); }
.otp.bad input { border-color: var(--alert); }

/* Message bref en bas d'écran */
.lab-toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 36px); padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.lab-toast svg { width: 18px; height: 18px; flex: none; }

/* ---------- Espace : cartes des lead magnets ---------- */
.cards { display: grid; gap: 10px; }
.card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; width: 100%; text-align: left; padding: 16px; min-height: 72px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--text); font: inherit; text-decoration: none; cursor: pointer; }
.card:hover { border-color: var(--soft); color: var(--text); }
.card .t { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.card .l { grid-column: 1; color: var(--soft); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.card .d { grid-column: 1; color: var(--soft); font-size: 13px; }
.card .ico { grid-row: 1 / span 3; grid-column: 2; color: var(--violet); display: grid; place-content: center; }
.card .ico svg { width: 22px; height: 22px; }
.card.open .l { color: var(--mauve-ink); font-weight: 600; }
.card.locked { background: var(--surface); }
.card.locked .ico { color: var(--soft); }
.card.soon { border-style: dashed; cursor: default; }
.card.soon .t, .card.soon .ico { color: var(--soft); }

/* Feuille en bas d'écran */
.sheet-back { position: fixed; inset: 0; z-index: 40; background: rgba(21, 19, 26, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 600px; max-height: 88vh; overflow: auto; background: var(--bg); border-radius: 18px 18px 0 0; padding: 22px 18px max(22px, env(safe-area-inset-bottom)); }
.sheet h2 { margin-bottom: 8px; }
.sheet p { margin: 0 0 4px; }
.sheet .kw { display: inline-block; padding: 2px 10px; border-radius: 8px; background: var(--mauve); color: var(--mauve-ink); font-weight: 800; }
.sheet .act { margin-top: 18px; }

/* Pages de texte (légal) */
.prose h2 { margin: 32px 0 8px; }
.prose p, .prose li { max-width: 62ch; }
.prose ul { padding-left: 20px; }
.todo { margin: 12px 0; padding: 12px 14px; border: 1.5px dashed var(--alert); border-radius: 10px; color: var(--alert); font-weight: 600; font-size: 14.5px; }

@media (prefers-reduced-motion: no-preference) {
  .lab-toast { animation: lab-up .18s ease-out; }
  .sheet { animation: lab-sheet .2s ease-out; }
  @keyframes lab-up { from { opacity: 0; transform: translate(-50%, 8px); } }
  @keyframes lab-sheet { from { transform: translateY(24px); opacity: 0; } }
}
