:root {
  --bg: #fbf8f3;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #6d6a64;
  --line: #e4ded3;
  --green: #009246;
  --green-dark: #00763a;
  --red: #ce2b37;
  --good-bg: #e3f4e9;
  --bad-bg: #fbe5e7;
  font-family: Optima, Candara, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-size: 22px; }
#app { min-height: 100%; display: flex; flex-direction: column; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 36px; border-bottom: 1px solid var(--line); }
.topbar .brand { font-size: 28px; font-weight: bold; }
.topbar .brand span:nth-child(1) { color: var(--green); }
.topbar .brand span:nth-child(3) { color: var(--red); }
.topbar .right { color: var(--muted); font-size: 20px; display: flex; gap: 24px; align-items: center; }
.link { background: none; border: none; color: var(--muted); font: inherit; font-size: 18px; text-decoration: underline; cursor: pointer; padding: 4px; }

main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 24px 28px 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
h1 { font-size: 40px; margin: 0; text-align: center; }
h2 { font-size: 30px; margin: 0; text-align: center; }
.muted { color: var(--muted); }
.center { text-align: center; }

button { font: inherit; cursor: pointer; }
.btn { border: 2px solid var(--line); background: var(--card); color: var(--text); border-radius: 16px; padding: 16px 28px; font-size: 22px; }
.btn:hover { border-color: var(--green); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: bold; }
.btn.primary:hover { background: var(--green-dark); }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, .link:focus-visible { outline: 4px solid #f2b84b; outline-offset: 2px; }

.big-go { width: 100%; max-width: 640px; padding: 34px 28px; border-radius: 24px; font-size: 38px; line-height: 1.25; }
.big-go small { display: block; font-size: 22px; font-weight: normal; margin-top: 8px; opacity: .92; }

.progress { width: 100%; max-width: 520px; height: 16px; background: var(--line); border-radius: 8px; overflow: hidden; }
.progress > div { height: 100%; background: var(--green); transition: width .3s; }

.nav { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; width: 100%; }
.nav .btn { flex: 1 1 180px; max-width: 210px; }

.cards { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; width: 100%; }
.cards .btn { min-width: 220px; font-size: 30px; padding: 22px 32px; }

.word { font-size: 60px; line-height: 1.1; font-weight: bold; text-align: center; }
.trans { font-size: 36px; color: var(--green-dark); text-align: center; }
.example { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 24px; text-align: center; width: 100%; max-width: 640px; }
.example .it { font-size: 28px; }
.example .fr { color: var(--muted); font-size: 22px; margin-top: 6px; }
.speak { border: 2px solid var(--green); background: #fff; color: var(--green); border-radius: 50%; width: 56px; height: 56px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.speak svg { width: 28px; height: 28px; fill: currentColor; }
.speak:hover { background: var(--good-bg); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; max-width: 760px; }
.choices .btn { font-size: 28px; padding: 18px 16px; }
.choices .btn:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; min-width: 50%; }
.row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.choices .btn.good { background: var(--good-bg); border-color: var(--green); }
.choices .btn.bad { background: var(--bad-bg); border-color: var(--red); }
.feedback { font-size: 28px; min-height: 36px; text-align: center; }
.feedback.good { color: var(--green-dark); }
.feedback.bad { color: var(--red); }

.stat-grid { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 32px; text-align: center; min-width: 200px; }
.stat b { display: block; font-size: 48px; color: var(--green-dark); }

.steps { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 12px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 22px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.step.current { border: 2px solid var(--green); }
.step .name { font-weight: bold; }
.step .goal { color: var(--muted); font-size: 19px; }
.badge { white-space: nowrap; font-size: 19px; color: var(--muted); }
.badge.done { color: var(--green-dark); font-weight: bold; }

input[type=text], input[type=password] { font: inherit; font-size: 32px; padding: 14px 18px; border-radius: 14px; border: 2px solid var(--line); width: 100%; max-width: 420px; text-align: center; }
input[type=text]:focus, input[type=password]:focus { outline: none; border-color: var(--green); }

.form { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 20px; color: var(--muted); }
.field input { max-width: none; font-size: 28px; padding: 12px 16px; text-align: left; }

/* Téléphone et petites fenêtres */
@media (max-width: 640px) {
  body { font-size: 19px; }
  .topbar { padding: 12px 16px; }
  .topbar .brand { font-size: 24px; }
  .topbar .right { gap: 12px; font-size: 16px; flex-wrap: wrap; justify-content: flex-end; }
  .link { font-size: 16px; }
  main { padding: 16px 16px 28px; gap: 14px; }
  h1 { font-size: 30px; }
  h2 { font-size: 23px; }
  .big-go { font-size: 30px; padding: 26px 16px; }
  .big-go small { font-size: 18px; }
  .nav .btn { flex: 1 1 42%; max-width: none; padding: 14px 10px; font-size: 20px; }
  .cards .btn { min-width: 100%; font-size: 26px; padding: 18px; }
  .word { font-size: 46px; }
  .trans { font-size: 30px; }
  .example .it { font-size: 23px; }
  .choices { grid-template-columns: 1fr; gap: 12px; }
  .choices .btn { font-size: 24px; padding: 16px 12px; }
  .choices .btn:last-child:nth-child(odd) { min-width: 0; }
  .stat { min-width: 140px; padding: 14px 18px; }
  .stat b { font-size: 38px; }
  .step { flex-direction: column; align-items: flex-start; }
  .field input { font-size: 24px; }
}
