:root {
  --indigo: #4f46e5;
  --indigo-d: #4338ca;
  --indigo-l: #eef2ff;
  --ink: #1e1b2e;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7fb;
  --card: #ffffff;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(79, 70, 229, .10);
}

* { box-sizing: border-box; }

/* L'attribut hidden doit toujours primer (sinon écrasé par display:grid/flex). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: calc(14px + env(safe-area-inset-top)) 4px 14px;
  background: var(--bg);
}
.brand { font-weight: 800; font-size: 1.15rem; }
.brand-sub {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--indigo);
  background: var(--indigo-l);
  padding: 4px 8px;
  border-radius: 999px;
}

/* Screens */
.screen { display: none; animation: fade .25s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.title { font-size: 1.5rem; margin: 8px 0 4px; line-height: 1.2; }
.lead { color: var(--muted); margin: 0 0 20px; }
.step-h { font-size: .95rem; color: var(--indigo-d); margin: 18px 0 10px; }

/* Bandeau logos partenaires */
.logos {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 10px; margin: 6px 0 18px;
}
.logos .logo {
  height: 46px; width: auto; max-width: 46%;
  border-radius: 10px; background: #fff;
}

/* Pitch */
.pitch {
  background: linear-gradient(135deg, var(--indigo) 0%, #7c3aed 100%);
  color: #fff; border-radius: var(--radius); padding: 22px 20px;
  box-shadow: var(--shadow); margin-bottom: 8px;
}
.pitch-kicker {
  display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; background: rgba(255,255,255,.18); color: #fff;
  padding: 5px 10px; border-radius: 999px; margin-bottom: 12px;
}
.pitch-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 8px; line-height: 1.2; }
.pitch-lead { margin: 0 0 14px; line-height: 1.45; opacity: .96; }
.pitch-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pitch-points li {
  background: rgba(255,255,255,.14); border-radius: 10px; padding: 9px 12px;
  font-weight: 600; font-size: .92rem;
}

/* Group list */
.group-list { display: grid; gap: 12px; }
.group-card {
  text-align: left;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .15s, transform .1s;
  width: 100%;
  font: inherit;
  color: inherit;
}
.group-card:active { transform: scale(.99); }
.group-card .g-label { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.group-card .g-members { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.group-card .g-arrow { float: right; color: var(--indigo); font-weight: 800; }

/* Quiz head */
.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.link-btn { background: none; border: none; color: var(--indigo); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 0; }
.badge {
  background: var(--indigo); color: #fff; font-weight: 700; font-size: .8rem;
  padding: 6px 12px; border-radius: 999px;
}

/* Progress */
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--indigo), #8b5cf6); transition: width .3s ease; }

/* Questions */
.quiz-form { display: grid; gap: 16px; }
.q-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.q-text { font-weight: 700; margin: 0 0 12px; line-height: 1.35; }
.q-text .req { color: var(--err); margin-left: 4px; }
.q-num { color: var(--indigo); font-weight: 800; margin-right: 6px; }

.opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--line); border-radius: 12px;
  padding: 12px 14px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.opt:active { background: var(--indigo-l); }
.opt.checked { border-color: var(--indigo); background: var(--indigo-l); }
.opt input { width: 20px; height: 20px; accent-color: var(--indigo); margin: 0; flex: 0 0 auto; }
.opt span { line-height: 1.3; }

.q-card textarea, .q-card input[type="text"] {
  width: 100%; border: 2px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font: inherit; resize: vertical; min-height: 90px;
}
.q-card input[type="text"] { min-height: 0; }
.q-card textarea:focus, .q-card input:focus { outline: none; border-color: var(--indigo); }

.scale { display: flex; gap: 8px; flex-wrap: wrap; }
.scale .opt { flex: 1 1 56px; justify-content: center; flex-direction: column; gap: 6px; min-width: 56px; text-align: center; }
.scale .opt input { width: 18px; height: 18px; }

/* Actions */
.actions { margin: 22px 0 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: none; border-radius: 14px; padding: 16px;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.99); }
.btn.primary { background: var(--indigo); color: #fff; box-shadow: var(--shadow); }
.btn.primary:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--card); color: var(--indigo); border: 2px solid var(--indigo); }

.err { color: var(--err); font-weight: 600; text-align: center; margin-top: 12px; }

/* Done */
.done { text-align: center; padding: 48px 16px; }
.done-emoji { font-size: 4rem; line-height: 1; }
.done h2 { font-size: 1.6rem; margin: 16px 0 8px; }
.done p { color: var(--muted); margin: 0 0 28px; }

/* Footer */
.footer { margin-top: auto; text-align: center; color: var(--muted); font-size: .78rem; padding: 24px 0 8px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14131c; --card: #1e1c2a; --ink: #f3f2f8; --muted: #9b97ad;
    --line: #2e2b3d; --indigo-l: #262248; --shadow: 0 8px 30px rgba(0,0,0,.35);
  }
}
