/* ==========================================================================
   CATLION — Calculateur de perte de poids
   Design tokens repris de plan.catlion.com + typo de marque (Poppins).
   ========================================================================== */

:root {
  /* Marque */
  --pink:           #FF66CC;
  --pink-strong:    #E14BB0;
  --pink-soft:      rgba(255, 102, 204, .12);
  --purple:         #330033;
  --purple-soft:    rgba(51, 0, 51, .10);

  /* Surfaces & texte */
  --bg:             #FAFAFA;
  --card:           #FFFFFF;
  --ink:            #330033;
  --muted:          #717182;
  --border:         rgba(51, 0, 51, .10);
  --secondary:      #CCCCFF;
  --disabled-bg:    #ECECF0;

  /* Formes */
  --radius:         16px;
  --radius-lg:      24px;
  --radius-pill:    999px;

  /* Ombres */
  --shadow-sm:      0 2px 8px rgba(51, 0, 51, .06);
  --shadow-md:      0 6px 18px rgba(51, 0, 51, .08);
  --shadow-lg:      0 10px 28px rgba(255, 102, 204, .28);

  /* Mesures */
  --phone:          414px;
  --gutter:         24px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

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

:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Squelette ---------- */
.app {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 16px;
}

.phone {
  position: relative;
  width: 100%;
  max-width: var(--phone);
  min-height: min(100dvh - 32px, 820px);
  display: flex;
  flex-direction: column;
}

.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
  padding: 32px var(--gutter);
  animation: screen-in .35s ease both;
}
.screen[hidden] { display: none; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  * { transition-duration: .01ms !important; }
}

.screen__body { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.screen__body--center {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}
.screen__body--center-v { justify-content: center; }

.screen__footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 24px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ---------- Typo ---------- */
.title {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  font-style: italic;
  letter-spacing: .3px;
  color: var(--ink);
}
.title--xl { font-size: 34px; }
.title-accent {
  font-size: 22px;
  font-weight: 700;
  font-style: italic;
  color: var(--pink-strong);
}
.subtitle { color: var(--muted); margin-top: -12px; }
.lead { font-size: 17px; color: var(--muted); max-width: 34ch; }
.lead--strong { color: var(--ink); font-weight: 600; word-break: break-word; }
.eyebrow { font-size: 13px; color: var(--muted); }
.eyebrow--accent { color: var(--pink-strong); font-weight: 600; }

.stat {
  font-size: 30px;
  font-weight: 800;
  font-style: italic;
  line-height: 1.1;
  color: var(--ink);
  margin: 4px 0;
}
.stat--sm { font-size: 22px; }
.stat--lg { font-size: 38px; }
.stat--xl { font-size: 46px; }

.logo { width: 176px; height: auto; margin-bottom: 8px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 14px 24px;
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn--primary {
  background: var(--pink);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.btn--primary:hover:not(:disabled) { transform: scale(1.02); box-shadow: 0 14px 32px rgba(255,102,204,.36); }
.btn--primary:active:not(:disabled) { transform: scale(.98); }
.btn--primary:disabled {
  background: var(--disabled-bg);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}
.btn--ghost {
  background: transparent;
  color: var(--muted);
  min-height: 44px;
  font-weight: 600;
  box-shadow: none;
}
.btn--ghost:hover { color: var(--ink); }

.btn-back {
  align-self: flex-start;
  width: 44px; height: 44px;
  margin: -8px 0 8px -10px;
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
  color: var(--ink);
  border-radius: 50%;
  transition: background-color .2s ease;
}
.btn-back:hover { background: var(--pink-soft); }
.btn-back svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Progression ---------- */
.progress { margin-bottom: 24px; }
.progress__head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.progress__label, .progress__pct { font-size: 13px; color: var(--muted); }
.progress__track {
  width: 100%; height: 8px;
  background: rgba(204, 204, 255, .45);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress__track--lg { height: 12px; margin-top: 12px; }
.progress__bar {
  height: 100%;
  background: var(--pink);
  border-radius: var(--radius-pill);
  transition: width .5s ease;
}

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 10px; border: 0; }
.label { font-weight: 600; color: var(--ink); }
.label--sm { font-size: 14px; }

.input {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input::placeholder { color: #a9a7b4; }
.input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 4px var(--pink-soft);
}
.input--lg { font-size: 20px; font-weight: 600; background: var(--bg); padding-right: 56px; }
.input-wrap { position: relative; }
.input-unit {
  position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
/* masque les flèches natives des number inputs */
.input[type=number]::-webkit-outer-spin-button,
.input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input[type=number] { -moz-appearance: textfield; }

.hint { font-size: 13px; color: var(--pink-strong); font-weight: 600; }

/* ---------- Choix (radios stylés) ---------- */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice-list { display: flex; flex-direction: column; gap: 12px; }

.choice { display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice__inner {
  display: flex;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--muted);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.choice--tile .choice__inner {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  font-weight: 600;
}
.choice--row .choice__inner {
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  text-align: left;
}
.choice__inner:hover { border-color: rgba(255, 102, 204, .5); }
.choice input:checked + .choice__inner {
  border-color: var(--pink);
  background: var(--pink-soft);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.choice input:focus-visible + .choice__inner {
  outline: 3px solid var(--pink);
  outline-offset: 2px;
}
.choice__icon { width: 30px; height: 30px; fill: currentColor; }
.choice__emoji { font-size: 26px; line-height: 1; }
.choice__text { flex: 1; display: flex; flex-direction: column; }
.choice__title { font-weight: 600; color: var(--ink); }
.choice__desc { font-size: 13px; color: var(--muted); }
.choice__check { width: 22px; height: 22px; fill: var(--pink); opacity: 0; transition: opacity .2s ease; }
.choice input:checked + .choice__inner .choice__check { opacity: 1; }

/* ---------- Cartes ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card--field { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.card--center { text-align: center; }
.card--highlight {
  background: linear-gradient(140deg, rgba(255,102,204,.16), rgba(51,0,51,.10));
  border: 2px solid rgba(255, 102, 204, .45);
  box-shadow: var(--shadow-md);
  padding: 24px;
}
.card--bmi { display: flex; flex-direction: column; gap: 16px; }

.bmi-row { display: flex; justify-content: space-between; gap: 16px; }
.bmi-scale__track {
  position: relative;
  display: flex;
  height: 10px;
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.bmi-scale__seg { flex: 1; }
.bmi-scale__seg[data-bmi-seg="under"]  { flex: 0 0 18%; background: #CCCCFF; }
.bmi-scale__seg[data-bmi-seg="normal"] { flex: 0 0 27%; background: #7ED9C4; }
.bmi-scale__seg[data-bmi-seg="over"]   { flex: 0 0 21%; background: #FFC978; }
.bmi-scale__seg[data-bmi-seg="obese"]  { flex: 1 1 auto; background: #FF9AA8; }
.bmi-scale__cursor {
  position: absolute; top: 50%;
  width: 14px; height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: left .5s ease;
}
.bmi-scale__labels {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  font-size: 11px; color: var(--muted);
}

/* ---------- Divers ---------- */
.badge {
  width: 92px; height: 92px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
}
.badge svg { width: 44px; height: 44px; }
.badge--pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .75; } }

.spinner { animation: spin 1s linear infinite; }
.spinner__track { opacity: .25; }
.spinner__head { opacity: .75; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .badge--pulse, .spinner { animation: none; }
}

.note {
  background: rgba(204, 204, 255, .35);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 14px;
  color: var(--ink);
  text-align: center;
}

.consent { display: flex; gap: 12px; align-items: flex-start; }
.consent input {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin-top: 3px;
  accent-color: var(--pink);
  cursor: pointer;
}
.consent label { font-size: 13px; color: var(--muted); cursor: pointer; }

.alert {
  background: rgba(255, 102, 204, .12);
  border: 1px solid rgba(255, 102, 204, .5);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink);
}

.tease-head { display: flex; flex-direction: column; gap: 20px; text-align: center; }

/* ---------- Grands écrans : le funnel reste une carte ---------- */
@media (min-width: 640px) {
  body { background: radial-gradient(1200px 600px at 50% -10%, rgba(255,102,204,.12), var(--bg) 60%); }
  .phone {
    background: var(--card);
    border-radius: 32px;
    box-shadow: 0 24px 60px rgba(51, 0, 51, .12);
    overflow: hidden;
  }
}

/* ---------- Ajustements fins ---------- */
.screen__body--center .subtitle { margin-top: 0; }
.tease-head .title--xl { font-size: 30px; }
