/* ============================================================================
   Inqbeo Quiz — styles
   Brand palette (from the slide decks / logo):
     Navy #333366  ·  Pink #E94C86  ·  Coral #F4996E  ·  Light #F2F2F2
   Primary accent is the Pink→Coral gradient. Text is Navy on a light ground.
   No build step, no framework — one hand-written stylesheet.
   ========================================================================== */

/* ---- Vendored font (Nunito, SIL OFL) — offline, no Google Fonts call ------ */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 800;            /* variable weight axis in one file */
  font-display: swap;
  src: url("assets/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy:   #333366;
  --pink:   #e94c86;
  --coral:  #f4996e;
  --light:  #f2f2f2;

  --ink:        #2e2e5b;
  --muted:      #7a7a96;
  --surface:    #ffffff;
  --surface-2:  #fafaff;
  --line:       #ececf4;
  --good:       #2bb673;
  --good-soft:  #e7f7ef;
  --bad:        #e8546b;
  --bad-soft:   #fdecef;

  --grad: linear-gradient(100deg, var(--pink), var(--coral));
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(51, 51, 102, .14);
  --shadow-sm: 0 6px 18px rgba(51, 51, 102, .10);
  --ring: 0 0 0 4px rgba(233, 76, 134, .20);

  --font: "Nunito", system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 560px at 88% -10%, #fde4ea 0%, transparent 58%),
    radial-gradient(1000px 520px at -10% 6%, #fdeede 0%, transparent 56%),
    var(--surface-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 30px 18px calc(30px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---- Brand bar ----------------------------------------------------------- */
.brandbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo-img { height: 34px; width: auto; display: block; }
.spacer { flex: 1; }

.langswitch { display: inline-flex; gap: 4px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-sm); }
.langswitch button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: .78rem; letter-spacing: .03em;
  text-transform: uppercase; padding: 5px 11px; border-radius: 999px; transition: .15s;
}
.langswitch button[aria-pressed="true"] { background: var(--grad); color: #fff; }

/* ---- Headline ------------------------------------------------------------ */
.headline { margin: 4px 0 20px; }
.headline h1 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.headline p { margin: 8px 0 0; font-size: 1rem; }
.muted { color: var(--muted); }

main { flex: 1; }

/* ---- Cards --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ---- Stage picker -------------------------------------------------------- */
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.stage {
  display: flex; align-items: center; gap: 16px;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 18px;
  box-shadow: var(--shadow-sm); color: inherit; font-family: inherit;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.stage:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #e3d6ec; }
.stage:active { transform: translateY(0); }
.stage:focus-visible { outline: none; box-shadow: var(--ring); }
.stage[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.stage .glyph {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
  color: #fff; background: var(--grad);
  box-shadow: 0 8px 18px rgba(233, 76, 134, .30);
}
.stage .stage-body { flex: 1; min-width: 0; }
.stage .stage-name { font-weight: 800; font-size: 1.06rem; }
.stage .stage-meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.stage .chevron { color: var(--muted); font-size: 1.3rem; transition: transform .15s, color .15s; }
.stage:hover .chevron { transform: translateX(3px); color: var(--pink); }

.hint {
  background: #fff4ef; border: 1px solid #f7ddcf; color: #b06a45;
  border-radius: 12px; padding: 10px 14px; font-size: .9rem; margin: 0 0 16px;
}

/* ---- Progress ------------------------------------------------------------ */
.progress { margin-bottom: 16px; }
.progress-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.counter { font-weight: 800; font-size: .9rem; color: var(--navy); }
.link-btn {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: .85rem; padding: 4px 6px; border-radius: 8px;
}
.link-btn:hover { color: var(--bad); }
.bar { height: 9px; background: var(--light); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--grad);
  border-radius: 999px; transition: width .35s cubic-bezier(.2,.8,.2,1); }

/* ---- Question card ------------------------------------------------------- */
.question-card { padding: 24px 22px 22px; }
.qtext { margin: 0; font-size: clamp(1.15rem, 3.4vw, 1.4rem); font-weight: 800; line-height: 1.35; }
.kind-hint { margin: 8px 0 0; font-size: .82rem; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; }

.options { display: grid; gap: 11px; margin: 20px 0 0; }
.option {
  display: flex; align-items: center; gap: 13px;
  border: 1.5px solid var(--line); border-radius: 13px; padding: 14px 16px;
  cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s;
  position: relative;
}
.option:hover { border-color: #e3d6ec; background: #fcfaff; }
.option:focus-within { box-shadow: var(--ring); border-color: var(--pink); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .mark {
  flex: 0 0 auto; width: 24px; height: 24px; border: 2px solid #cfcfe0;
  display: grid; place-items: center; color: transparent; font-size: 14px; line-height: 1;
  transition: border-color .15s, background .15s, color .15s;
}
.option[data-kind="single"] .mark { border-radius: 999px; }
.option[data-kind="multiple"] .mark { border-radius: 7px; }
.option input:checked + .mark { border-color: var(--pink); background: var(--grad); color: #fff; }
.option .otext { flex: 1; font-size: 1.02rem; line-height: 1.4; }

/* Locked + graded states (set after "Check") */
.options.locked .option { cursor: default; }
.option.correct { border-color: var(--good); background: var(--good-soft); }
.option.correct .mark { border-color: var(--good); background: var(--good); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .mark { border-color: var(--bad); background: var(--bad); color: #fff; }
.option .verdict-icon { font-weight: 800; font-size: 1.05rem; }
.option.correct .verdict-icon { color: var(--good); }
.option.wrong .verdict-icon { color: var(--bad); }

/* ---- Feedback ------------------------------------------------------------ */
.feedback { margin-top: 18px; }
.banner { border-radius: 13px; padding: 13px 16px; font-weight: 800; font-size: 1.05rem; }
.banner.ok  { background: var(--good-soft); color: #1f8f5a; }
.banner.no  { background: var(--bad-soft);  color: #c63b53; }
.explanation { margin: 12px 2px 0; color: var(--ink); font-size: .96rem; line-height: 1.5; }

/* ---- Buttons ------------------------------------------------------------- */
.actions { display: flex; gap: 12px; margin-top: 22px; }
.actions.center { justify-content: center; }
.btn {
  border: 0; border-radius: 13px; padding: 14px 24px; font-family: inherit;
  font-size: 1.02rem; font-weight: 800; cursor: pointer; transition: transform .05s, filter .15s, box-shadow .15s, opacity .15s;
}
.btn.primary { color: #fff; background: var(--grad); box-shadow: 0 10px 24px rgba(233, 76, 134, .32); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.primary:active { transform: translateY(1px); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; }
.btn.ghost { background: var(--surface); color: var(--navy); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--pink); color: var(--pink); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
#checkBtn, #nextBtn { flex: 1; }

/* ---- Result -------------------------------------------------------------- */
.result-card { padding: 40px 26px 32px; text-align: center; }
.verdict { font-size: clamp(3rem, 14vw, 4.6rem); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.verdict.yeah { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.verdict.nay  { color: var(--navy); }
.score { margin: 16px 0 4px; font-size: 1.3rem; font-weight: 800; }
.result-card .actions { margin-top: 26px; }

/* ---- Error / locked notice ----------------------------------------------- */
.error-card, .locked-card { padding: 38px 26px; text-align: center; }
.error-emoji, .locked-emoji { font-size: 2.6rem; }
.error-card h2, .locked-card h2 { margin: 12px 0 6px; font-size: 1.3rem; font-weight: 800; }
.locked-card .muted { line-height: 1.55; }
.locked-card code { background: var(--light); border-radius: 7px; padding: 2px 7px;
  font-size: .92em; color: var(--navy); }

/* ---- Footer -------------------------------------------------------------- */
.pagefoot { margin-top: 28px; padding-top: 16px; font-size: .82rem;
  display: flex; gap: 8px; align-items: center; justify-content: center; }
.pagefoot .dot { opacity: .5; }

/* ---- Screen transition --------------------------------------------------- */
.screen { animation: rise .28s cubic-bezier(.2,.8,.2,1) both; }
.question-card.swap { animation: rise .22s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.verdict.pop { animation: pop .4s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================================
   Admin report page (/report)
   Reuses the brand tokens above. Token entry + export toolbar, summary stat
   cards, per-module SVG bar charts, and a most-missed table. Prints cleanly to
   PDF via the browser's "Save as PDF" (see the print block at the very end).
   ========================================================================== */
.page.wide { max-width: 920px; }

.report-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 0 0 20px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.report-toolbar .grow { flex: 1; }
.text-input {
  width: 100%; font-family: inherit; font-size: 1.02rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 13px;
  padding: 11px 14px; transition: border-color .15s, box-shadow .15s;
}
.text-input:focus { outline: none; border-color: var(--pink); box-shadow: var(--ring); }
.token-input { max-width: 320px; }
.btn.small { padding: 9px 16px; font-size: .9rem; border-radius: 11px; }

.report-section { margin: 26px 0 12px; font-size: 1.15rem; font-weight: 800; color: var(--navy); }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat { padding: 16px 18px; text-align: center; }
.stat .num { font-size: 2rem; font-weight: 800; background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.stat .label { color: var(--muted); font-size: .85rem; margin-top: 6px; font-weight: 700; }

.qreport { padding: 20px 20px 18px; margin-bottom: 16px; }
.qreport h3 { margin: 0 0 4px; font-size: 1.12rem; font-weight: 800; }
.removed-tag { font-size: .75rem; font-weight: 800; color: var(--bad);
  background: var(--bad-soft); border-radius: 999px; padding: 2px 9px; margin-left: 8px; vertical-align: middle; }
.qreport .avgline { font-weight: 700; color: var(--muted); margin: 6px 0 14px; font-size: .92rem; }

/* SVG chart fills via a gradient on the bars */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: url(#barGrad); }
.chart .track { fill: var(--light); }
.chart .lbl { fill: var(--ink); font: 700 13px var(--font); }
.chart .cnt { fill: var(--muted); font: 700 12px var(--font); }

.empty-note { color: var(--muted); font-style: italic; margin: 8px 0 0; }

/* Most-missed table */
.missed-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.missed-table th, .missed-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.missed-table th { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; font-size: .76rem; }
.missed-table tbody tr:last-child td { border-bottom: 0; }
.missed-table .num-col { text-align: right; white-space: nowrap; }
.missed-table .wrong-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.minibar { display: inline-block; width: 90px; height: 9px; border-radius: 999px; background: var(--light); overflow: hidden; }
.minibar-fill { display: block; height: 100%; background: var(--grad); }
.minibar-label { font-weight: 800; color: var(--navy); min-width: 42px; text-align: right; }

.report-error { color: var(--bad); font-weight: 700; }

/* ---- Print: clean PDF via the browser's "Save as PDF" -------------------- */
@media print {
  body { background: #fff; }
  .page { max-width: none; box-shadow: none; }
  .report-toolbar, .langswitch, .pagefoot .noprint { display: none !important; }
  .card, .qreport, .stat { box-shadow: none; break-inside: avoid; }
  .qreport { border-color: #ddd; }
  a[href]:after { content: ""; }
}
