/* ============================================================
   Bonjour Bootcamp — styles
   Palette nods to the school's site: coral red, chunky black type,
   warm paper background.
   ============================================================ */

:root {
  --rouge: #e24a5b;
  --rouge-dark: #c2374a;
  --rouge-soft: #fdecee;
  --bleu: #2f5ee0;
  --bleu-soft: #ecf1ff;
  --vert: #14a06f;
  --vert-soft: #e7f7f0;
  --or: #f2b441;
  --or-soft: #fff6e2;
  --ink: #17161c;
  --ink-2: #4a4855;
  --muted: #86838f;
  --paper: #fffaf5;
  --card: #ffffff;
  --line: #e9e3dc;
  --shadow: 0 2px 0 rgba(23, 22, 28, .06), 0 12px 28px -18px rgba(23, 22, 28, .45);
  --radius: 18px;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 110% -10%, var(--rouge-soft), transparent 60%),
    radial-gradient(900px 460px at -10% 0%, var(--bleu-soft), transparent 55%),
    var(--paper);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; z-index: 99; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(14px, 4vw, 40px);
  background: rgba(255, 250, 245, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-flag {
  width: 26px; height: 18px; border-radius: 3px; display: inline-block;
  background: linear-gradient(90deg, #2f5ee0 0 33.33%, #fff 33.33% 66.66%, #e24a5b 66.66% 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.brand-text { font-weight: 800; letter-spacing: -.02em; font-size: 1.05rem; text-transform: uppercase; }
.brand-text em { font-style: normal; color: var(--rouge); }
.topnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topnav a {
  text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: .86rem;
  padding: 8px 12px; border-radius: 999px;
}
.topnav a:hover { background: #fff; color: var(--ink); }
.topnav a.active { background: var(--ink); color: #fff; }

.ghost-btn {
  font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
  padding: 8px 12px; border-radius: 999px; border: 1.5px dashed var(--line);
  background: transparent; color: var(--muted);
}
.ghost-btn:hover { border-color: var(--rouge); color: var(--rouge); }
.ghost-btn.on { background: var(--or-soft); border: 1.5px solid var(--or); color: #8a5c00; }

/* ---------- layout ---------- */
main { max-width: 980px; margin: 0 auto; padding: clamp(20px, 4vw, 44px) clamp(14px, 4vw, 24px) 80px; outline: none; }
.foot { text-align: center; padding: 0 20px 40px; color: var(--muted); font-size: .85rem; }
.muted { color: var(--muted); }

h1 { font-size: clamp(1.9rem, 6vw, 2.9rem); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 10px; text-transform: uppercase; font-weight: 900; }
h2 { font-size: clamp(1.25rem, 3.6vw, 1.6rem); letter-spacing: -.02em; margin: 34px 0 12px; font-weight: 900; }
h3 { font-size: 1.02rem; margin: 22px 0 8px; font-weight: 800; }
p { line-height: 1.65; margin: 0 0 12px; }
.accent { color: var(--rouge); }

/* ---------- home ---------- */
.hero {
  background: var(--card); border: 1px solid var(--line); border-radius: 26px;
  padding: clamp(20px, 4vw, 34px); box-shadow: var(--shadow); margin-bottom: 26px;
}
.hero .kicker { font-weight: 800; color: var(--rouge); letter-spacing: .1em; font-size: .74rem; text-transform: uppercase; margin-bottom: 10px; }
.hero p { color: var(--ink-2); max-width: 62ch; }

.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.stat {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; min-width: 104px;
}
.stat b { display: block; font-size: 1.5rem; line-height: 1.1; letter-spacing: -.02em; }
.stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }

.bar { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 16px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--rouge), var(--or)); border-radius: 999px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }

.lcard {
  position: relative; display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s, border-color .18s;
}
.lcard:hover { transform: translateY(-3px); border-color: var(--rouge); box-shadow: 0 18px 34px -20px rgba(226, 74, 91, .7); }
.lcard .num { font-size: .7rem; font-weight: 800; letter-spacing: .12em; color: var(--rouge); text-transform: uppercase; }
.lcard .emoji { position: absolute; top: 14px; right: 16px; font-size: 1.5rem; }
.lcard h3 { margin: 6px 0 4px; font-size: 1.08rem; letter-spacing: -.01em; }
.lcard .fr-sub { color: var(--muted); font-size: .84rem; font-style: italic; }
.lcard .mini { margin-top: 14px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.lcard .mini > i { display: block; height: 100%; background: var(--vert); }
.lcard .score { font-size: .74rem; font-weight: 800; color: var(--muted); margin-top: 7px; display: flex; justify-content: space-between; }
.lcard.done { border-color: var(--vert); }
.lcard.done .num { color: var(--vert); }

.examcard {
  margin-top: 22px; background: linear-gradient(120deg, var(--ink), #35313f); color: #fff;
  border-radius: 24px; padding: clamp(20px, 4vw, 30px); display: flex; gap: 20px;
  align-items: center; justify-content: space-between; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.examcard h2 { margin: 0 0 6px; color: #fff; }
.examcard p { margin: 0; color: #d8d5e0; max-width: 46ch; font-size: .93rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font: inherit; font-weight: 800; font-size: .95rem; cursor: pointer;
  padding: 13px 22px; border-radius: 999px; border: none;
  background: var(--rouge); color: #fff; text-decoration: none;
  box-shadow: 0 3px 0 var(--rouge-dark); transition: transform .1s, box-shadow .1s, background .15s;
}
.btn:hover { background: var(--rouge-dark); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--rouge-dark); }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.dark { background: var(--ink); box-shadow: 0 3px 0 #000; }
.btn.green { background: var(--vert); box-shadow: 0 3px 0 #0d7d55; }
.btn.light { background: #fff; color: var(--ink); border: 1.5px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.btn.light:hover { border-color: var(--ink); }
.btn.sm { padding: 9px 16px; font-size: .84rem; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 20px; }

/* ---------- lesson content ---------- */
.crumbs { font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--rouge); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.sheet {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(18px, 4vw, 34px); box-shadow: var(--shadow);
}
.sheet > :first-child { margin-top: 0; }

.lead { font-size: 1.05rem; color: var(--ink-2); }

.fr {
  color: var(--bleu); font-weight: 700; cursor: pointer; border-bottom: 1.5px dotted rgba(47, 94, 224, .45);
}
.fr:hover { background: var(--bleu-soft); }
.fr.speaking { background: var(--or-soft); }
.en { color: var(--muted); }
.en::before { content: " — "; }

ul.list, ol.list { padding-left: 22px; line-height: 1.75; }
ul.list li, ol.list li { margin-bottom: 7px; }

.tbl { width: 100%; border-collapse: collapse; margin: 14px 0 18px; font-size: .95rem; overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--paper); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.tbl tr:last-child td { border-bottom: none; }
.tbl td:first-child { font-weight: 700; white-space: nowrap; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.box { border-radius: 16px; padding: 14px 16px; margin: 16px 0; border: 1px solid; font-size: .95rem; line-height: 1.6; }
.box b.tag { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.box p:last-child { margin-bottom: 0; }
.rule { background: var(--bleu-soft); border-color: #cfdcff; }
.rule b.tag { color: var(--bleu); }
.tip { background: var(--vert-soft); border-color: #c6ecdc; }
.tip b.tag { color: var(--vert); }
.trap { background: var(--rouge-soft); border-color: #f8ccd2; }
.trap b.tag { color: var(--rouge); }
.gold { background: var(--or-soft); border-color: #f6e0b1; }
.gold b.tag { color: #a97406; }

.say {
  border: none; background: var(--bleu-soft); color: var(--bleu); cursor: pointer;
  border-radius: 8px; padding: 2px 7px; font-size: .85rem; line-height: 1.4; margin-left: 4px;
}
.say:hover { background: var(--bleu); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.chip {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 7px 12px; font-size: .9rem;
}

/* ---------- quiz ---------- */
.quizhead { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.qcount { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.streak { font-size: .82rem; font-weight: 800; color: var(--or); }

.qcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(18px, 4vw, 30px); box-shadow: var(--shadow);
}
.qtype { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--rouge); margin-bottom: 10px; }
.qtext { font-size: clamp(1.1rem, 3vw, 1.35rem); font-weight: 700; line-height: 1.5; margin-bottom: 6px; }
.qhint { color: var(--muted); font-size: .88rem; margin-bottom: 16px; }

.opts { display: grid; gap: 10px; margin: 16px 0 4px; }
.opt {
  text-align: left; font: inherit; font-size: 1rem; cursor: pointer;
  background: var(--paper); border: 2px solid var(--line); border-radius: 14px;
  padding: 13px 16px; transition: border-color .12s, background .12s, transform .1s;
  display: flex; align-items: center; gap: 10px;
}
.opt:hover { border-color: var(--bleu); }
.opt .key { font-size: .7rem; font-weight: 800; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: #fff; }
.opt.sel { border-color: var(--bleu); background: var(--bleu-soft); }
.opt.good { border-color: var(--vert); background: var(--vert-soft); }
.opt.bad { border-color: var(--rouge); background: var(--rouge-soft); }
.opt[disabled] { cursor: default; }

.inp {
  font: inherit; font-size: 1rem; padding: 10px 13px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--paper); color: var(--ink); min-width: 90px;
}
.inp:focus { outline: none; border-color: var(--bleu); background: #fff; }
.inp.good { border-color: var(--vert); background: var(--vert-soft); }
.inp.bad { border-color: var(--rouge); background: var(--rouge-soft); }
.inp.wide { width: 100%; max-width: 460px; }

.fillline { font-size: 1.12rem; line-height: 2.4; }
.fillline .inp { width: 9.5em; }

.conj { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 14px; }
.conjrow { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.conjrow span { font-weight: 800; min-width: 74px; color: var(--ink-2); font-size: .95rem; }
.conjrow .inp { flex: 1; min-width: 0; }

.matchwrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.matchcol { display: grid; gap: 8px; align-content: start; }
.mitem {
  font: inherit; text-align: left; cursor: pointer; background: var(--paper);
  border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .95rem;
  display: flex; align-items: center; gap: 8px;
}
.mitem:hover { border-color: var(--bleu); }
.mitem.sel { border-color: var(--bleu); background: var(--bleu-soft); }
.mitem.paired { opacity: .95; }
.mitem.good { border-color: var(--vert); background: var(--vert-soft); }
.mitem.bad { border-color: var(--rouge); background: var(--rouge-soft); }
.mitem .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: transparent; }

.tray { min-height: 58px; border: 2px dashed var(--line); border-radius: 14px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; background: var(--paper); }
.tray:empty::before { content: "Tap the words below in the right order…"; color: var(--muted); font-size: .9rem; }
.word {
  font: inherit; font-weight: 700; cursor: pointer; background: #fff;
  border: 2px solid var(--line); border-radius: 10px; padding: 8px 13px; font-size: .95rem;
}
.word:hover { border-color: var(--bleu); }
.word.used { opacity: .28; pointer-events: none; }

.accents { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.accents button {
  font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer; width: 38px; height: 34px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
}
.accents button:hover { border-color: var(--rouge); color: var(--rouge); }
.accents .lbl { font-size: .72rem; color: var(--muted); align-self: center; margin-right: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.feedback { border-radius: 16px; padding: 14px 16px; margin-top: 18px; font-size: .96rem; line-height: 1.6; border: 1px solid; }
.feedback.ok { background: var(--vert-soft); border-color: #c6ecdc; }
.feedback.near { background: var(--or-soft); border-color: #f6e0b1; }
.feedback.no { background: var(--rouge-soft); border-color: #f8ccd2; }
.feedback .verdict { font-weight: 900; font-size: 1.05rem; display: block; margin-bottom: 4px; }
.feedback .sol { font-weight: 800; }

.bigplay {
  font: inherit; font-size: 1.05rem; font-weight: 800; cursor: pointer; color: #fff;
  background: var(--bleu); border: none; border-radius: 999px; padding: 14px 26px;
  box-shadow: 0 3px 0 #2249b4; margin: 6px 0 16px;
}
.bigplay:active { transform: translateY(3px); box-shadow: none; }

.teacher-peek { margin-top: 14px; font-size: .86rem; color: #8a5c00; background: var(--or-soft); border: 1px dashed var(--or); border-radius: 12px; padding: 9px 12px; }

/* ---------- results ---------- */
.result { text-align: center; padding: clamp(22px, 5vw, 44px) 20px; }
.result .score-ring { font-size: clamp(3rem, 12vw, 5rem); font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.result .verdict-big { font-size: 1.35rem; font-weight: 900; margin: 10px 0 6px; }
.result p { color: var(--ink-2); }

.review { text-align: left; margin-top: 26px; display: grid; gap: 10px; }
.rev {
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--rouge);
  border-radius: 12px; padding: 12px 14px; font-size: .92rem; line-height: 1.55;
}
.rev.ok { border-left-color: var(--vert); }
.rev .q { font-weight: 800; margin-bottom: 4px; }
.rev .yours { color: var(--rouge); }
.rev .right { color: var(--vert); font-weight: 700; }

.diploma {
  background: var(--card); border: 3px double var(--or); border-radius: 20px;
  padding: clamp(22px, 5vw, 40px); text-align: center; margin-top: 24px;
}
.diploma .seal { font-size: 3rem; }
.diploma h2 { margin: 6px 0; }
.diploma .name { font-size: 1.6rem; font-weight: 900; color: var(--rouge); letter-spacing: -.02em; }

.breakdown { display: grid; gap: 8px; text-align: left; margin-top: 22px; }
.bd { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.bd b { font-weight: 800; }
.bd .pill { font-size: .76rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--vert-soft); color: var(--vert); }
.bd .pill.low { background: var(--rouge-soft); color: var(--rouge); }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

@media (max-width: 620px) {
  .matchwrap { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 14px; }
  .topnav { justify-content: center; gap: 4px; }
  .topnav a { padding: 7px 10px; font-size: .8rem; }
  .brand { justify-content: center; }
  .brand-text { font-size: .92rem; }
  .ghost-btn { font-size: .78rem; padding: 7px 10px; }
  .fillline { line-height: 2.6; }
  .btn { width: 100%; }
  .btn.sm, .btnrow .ghost-btn { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
