/* Magnetic Brand — questionnaire d'onboarding */
:root {
  --charcoal: #2b2e33;
  --charcoal-2: #33373d;
  --volt: #f6ff65;
  --white: #ffffff;
  --muted: #c3c6cd;
  --faint: #8d929b;
  --rule: rgba(255, 255, 255, .16);
  --field: rgba(255, 255, 255, .06);
  --field-hover: rgba(255, 255, 255, .09);
  --signal: #ff6b5f;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --text: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 720px;
  --gutter: clamp(20px, 5vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--charcoal);
  color: var(--white);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--volt); text-underline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }

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

.app {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter) env(safe-area-inset-bottom);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.loading, .noscript { padding: 48px var(--gutter); color: var(--muted); }

.screen { flex: 1; display: flex; flex-direction: column; animation: enter .35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

/* ---------- Barre du haut ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 18px; }
.wordmark {
  font-family: var(--display); font-size: 1.375rem; letter-spacing: .02em;
  text-transform: uppercase; color: var(--white); text-decoration: none; white-space: nowrap;
}
.saved { font-size: .8125rem; color: var(--faint); text-align: right; }

/* ---------- Cadre à coins (signature Magnetic Brand) ---------- */
.frame { position: relative; padding: clamp(40px, 7vw, 64px) clamp(22px, 5vw, 48px); margin-top: clamp(12px, 4vw, 40px); }
.corner { position: absolute; width: 26px; height: 26px; border: 0 solid var(--volt); }
.corner.tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; }
.corner.tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; }
.corner.bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; }
.corner.br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; }

.kicker { font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--volt); }
.title-xl {
  margin-top: 14px; font-family: var(--display); text-transform: uppercase;
  font-size: clamp(2.75rem, 11vw, 5rem); line-height: .98; color: var(--volt);
}
.lede { margin-top: 22px; font-size: clamp(1.0625rem, 2.4vw, 1.1875rem); line-height: 1.55; color: var(--muted); max-width: 52ch; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 24px; padding: 0; list-style: none; }
.meta li {
  font-size: .875rem; font-weight: 500; padding: 6px 12px;
  border: 1.5px solid var(--rule); border-radius: 999px; color: var(--white);
}

/* ---------- Formulaires ---------- */
.fields { display: grid; gap: 18px; margin-top: 36px; }
@media (min-width: 560px) { .fields .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } }
.fields .row-2 { display: grid; gap: 18px; }
.field label, .field .label { display: block; font-size: .9375rem; font-weight: 600; margin-bottom: 8px; }
.input, .textarea {
  width: 100%;
  font: inherit; font-size: 1.0625rem; /* ≥ 16px : pas de zoom sur iPhone */
  color: var(--white);
  background: var(--field);
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .textarea:hover { background: var(--field-hover); }
.input:focus, .textarea:focus { outline: none; border-color: var(--volt); background: var(--field-hover); }
.input[aria-invalid="true"] { border-color: var(--signal); }
.textarea { min-height: 180px; resize: vertical; line-height: 1.55; }
.error { margin-top: 8px; font-size: .875rem; color: var(--signal); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 26px; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-solid { background: var(--volt); color: var(--charcoal); }
.btn-solid:hover { background: var(--white); }
.btn-line { background: transparent; color: var(--white); border-color: rgba(255,255,255,.45); }
.btn-line:hover { border-color: var(--volt); color: var(--volt); }
.btn-ghost { background: transparent; color: var(--muted); padding: 0 14px; }
.btn-ghost:hover { color: var(--white); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-block { width: 100%; }
.link-btn {
  font: inherit; font-size: .875rem; font-weight: 600; color: var(--volt);
  background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.actions-start { display: grid; gap: 12px; margin-top: 28px; }
@media (min-width: 560px) { .actions-start { display: flex; flex-wrap: wrap; } }

/* ---------- Progression ---------- */
.progress { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 5px; margin-top: 4px; }
.progress span { position: relative; height: 4px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
.progress span i { position: absolute; inset: 0; width: var(--w, 0%); background: var(--volt); border-radius: 4px; transition: width .35s ease; }
.step-head { margin-top: 28px; }
.step-label { font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--volt); }
.step-title {
  margin-top: 8px; font-family: var(--display); text-transform: uppercase;
  font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1.02;
}
.step-sub { margin-top: 10px; font-size: .9375rem; color: var(--muted); max-width: 58ch; }

/* ---------- Question ---------- */
.question { margin-top: clamp(28px, 6vw, 44px); flex: 1; }
.q-count { font-size: .8125rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.q-label { margin-top: 8px; font-size: clamp(1.25rem, 4.2vw, 1.5rem); font-weight: 600; line-height: 1.35; letter-spacing: -.005em; }
.q-hint { margin-top: 8px; font-size: .9375rem; color: var(--muted); }
.q-input { margin-top: 22px; }

.nav {
  position: sticky; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 28px; padding: 14px 0 calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(43,46,51,0), var(--charcoal) 30%);
}
.nav .btn-solid { flex: 1; max-width: 280px; margin-left: auto; }
.kbd-hint { font-size: .8125rem; color: var(--faint); margin-top: 10px; }
@media (pointer: coarse) { .kbd-hint { display: none; } }

/* ---------- Comptes (liste répétable) ---------- */
.accounts { display: grid; gap: 14px; }
.account {
  position: relative; display: grid; gap: 12px;
  padding: 18px; border: 1.5px solid var(--rule); border-radius: 18px;
}
.account-head { display: flex; justify-content: space-between; align-items: center; }
.account-num { font-family: var(--display); font-size: 1.25rem; letter-spacing: .02em; color: var(--volt); }
.account .field label { font-size: .875rem; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.account .textarea { min-height: 84px; }
.remove {
  font: inherit; font-size: .8125rem; color: var(--faint); background: none; border: 0; cursor: pointer; padding: 6px;
}
.remove:hover { color: var(--signal); }
.add {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 54px; border: 1.5px dashed rgba(255,255,255,.35); border-radius: 18px;
  background: transparent; color: var(--white); font: inherit; font-weight: 600; cursor: pointer;
}
.add:hover { border-color: var(--volt); color: var(--volt); }

/* ---------- Classement d'énergies ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,.3); background: transparent; color: var(--white);
  font: inherit; font-size: 1rem; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--volt); }
.chip[aria-pressed="true"] { background: var(--volt); border-color: var(--volt); color: var(--charcoal); font-weight: 600; }
.chip .rank {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--charcoal); color: var(--volt); font-size: .8125rem; font-weight: 600;
}
.chip[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.ranking-summary { margin-top: 18px; font-size: .9375rem; color: var(--muted); }

/* ---------- Échelle ---------- */
.scale-value {
  font-family: var(--display); font-size: clamp(4.5rem, 20vw, 7rem); line-height: 1; color: var(--volt);
  font-variant-numeric: tabular-nums;
}
.scale-value.empty { color: rgba(255,255,255,.2); }
.scale-value small { font-size: .4em; color: var(--muted); }
.range { width: 100%; margin: 20px 0 8px; height: 44px; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--volt) var(--p, 0%), rgba(255,255,255,.18) var(--p, 0%)); }
.range::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(255,255,255,.18); }
.range::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--volt); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; margin-top: -13px; border-radius: 50%; background: var(--volt); border: 4px solid var(--charcoal); box-shadow: 0 0 0 2px var(--volt); }
.range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--volt); border: 4px solid var(--charcoal); box-shadow: 0 0 0 2px var(--volt); }
.range.untouched::-webkit-slider-thumb { background: var(--muted); box-shadow: 0 0 0 2px var(--muted); }
.scale-ends { display: flex; justify-content: space-between; gap: 16px; font-size: .875rem; color: var(--muted); }

/* ---------- Récap ---------- */
.recap-head { margin-top: clamp(16px, 4vw, 32px); }
.recap-count { margin-top: 14px; font-size: .9375rem; color: var(--muted); }
.recap-section { margin-top: 40px; }
.recap-section h2 {
  font-family: var(--display); text-transform: uppercase; font-size: clamp(1.375rem, 4.6vw, 1.75rem); line-height: 1.05;
  padding-bottom: 12px; border-bottom: 3px solid var(--volt);
}
.recap-item { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.recap-item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.recap-q { font-size: .9375rem; font-weight: 600; color: var(--muted); }
.recap-a { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.recap-a.empty { color: var(--faint); font-style: italic; }
.recap-send { margin: 44px 0 24px; padding: 28px clamp(20px, 5vw, 32px); background: var(--volt); color: var(--charcoal); border-radius: 22px; }
.recap-send h2 { font-family: var(--display); text-transform: uppercase; font-size: clamp(1.75rem, 6vw, 2.25rem); line-height: 1; }
.recap-send p { margin-top: 10px; }
.recap-send .btn { margin-top: 20px; background: var(--charcoal); color: var(--volt); }
.recap-send .btn:hover { background: #000; }
.recap-send .error { color: #9b1c12; font-weight: 600; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Pied de page ---------- */
.foot { margin-top: auto; padding: 36px 0 28px; font-size: .8125rem; color: var(--faint); }
.foot a { color: var(--muted); }
