/* Shared quiz-app styles. Brand colours come from theme.css (loaded after this file). */
:root {
  --bg: #f5f6f8; --card: #ffffff; --ink: #172026; --muted: #5b6770; --line: #e2e7ea;
  --brand: #0f766e; --brand-2: #064e47; --brand-soft: #e0f2ef; --accent: #f59e0b; --on-brand: #ffffff;
  --hero: linear-gradient(135deg, var(--brand), var(--brand-2));
  --ok: #157a3c; --ok-soft: #e3f4e9; --bad: #b42318; --bad-soft: #fdecea;
  --radius: 16px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 6px 20px rgba(16,24,40,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1418; --card: #182027; --ink: #e9eef1; --muted: #9aa8b1; --line: #26313a;
    --ok: #6fd38a; --ok-soft: #15301f; --bad: #ff8a80; --bad-soft: #3a1c1a; --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Noto Sans Bengali", "Hind Siliguri", "Kohinoor Bangla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
a { color: var(--brand); }
img { max-width: 100%; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 0; text-align: left; max-width: 720px; margin: 0 auto; width: 100%; }
.brand img, .logo { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.logo { background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.brand strong { display: block; font-size: 17px; line-height: 1.2; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; }

main { max-width: 720px; margin: 0 auto; padding: 16px; min-height: 70vh; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
h1 { font-size: 25px; margin: 4px 0 8px; line-height: 1.3; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 14px; }

/* Hero */
.hero { background: var(--hero); color: #fff; border-radius: 22px; padding: 22px 20px 20px; margin-bottom: 16px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero h1 { color: #fff; font-size: 26px; margin: 0 0 6px; position: relative; }
.hero p { margin: 0 0 14px; opacity: .92; position: relative; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.chip { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); color: #fff; padding: 5px 11px; border-radius: 99px; font-size: 13px; white-space: nowrap; }
.hero .progress { background: rgba(255,255,255,.22); margin-top: 16px; }
.hero .progress > span { background: var(--accent); }
.hero .ptext { font-size: 13px; opacity: .9; margin-top: 6px; position: relative; }

/* Action tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-height: 112px; transition: transform .12s, border-color .12s; }
.tile:hover { border-color: var(--brand); transform: translateY(-1px); }
.tile:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.tile .ti { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); font-size: 20px; }
.tile b { font-size: 16px; } .tile span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; }
@media (max-width: 360px) { .tiles { grid-template-columns: 1fr; } }

/* Buttons */
.btn { display: block; width: 100%; text-align: left; cursor: pointer; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 8px 0; min-height: 52px; transition: border-color .12s, background .12s; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); text-align: center; font-weight: 700; }
.btn.ghost { text-align: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.row { display: flex; gap: 10px; } .row .btn { flex: 1; }

.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

.section-btn { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section-btn .en { display: block; color: var(--muted); font-size: 13px; }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.badge.lock { background: var(--line); color: var(--muted); }

/* Quiz */
.qhead { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.qtext { font-size: 19px; font-weight: 650; margin: 6px 0 12px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45; }
.opt { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.chosen { border-color: var(--brand); background: var(--brand-soft); }
.explain { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: 12px 14px; border-radius: 0 12px 12px 0; margin-top: 12px; }
.explain .verdict { font-weight: 700; margin-bottom: 4px; }
.explain .verdict.ok { color: var(--ok); } .explain .verdict.bad { color: var(--bad); }
.audio { margin-top: 10px; font-size: 14px; }
.audio .placeholder { display: inline-block; padding: 6px 10px; border: 1px dashed var(--muted); border-radius: 10px; color: var(--muted); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }
.result-score { font-size: 46px; font-weight: 800; margin: 4px 0; }
.pass { color: var(--ok); } .fail { color: var(--bad); }

/* Forms */
.unlock input, .field { width: 100%; padding: 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); margin: 8px 0; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.consent input { margin-top: 4px; }
.msg { font-size: 14px; margin-top: 6px; } .msg.ok { color: var(--ok); } .msg.bad { color: var(--bad); }

/* Coming soon */
.soon { border: 1.5px dashed var(--accent); }
.soon .tag { display: inline-block; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; margin-bottom: 6px; }

/* Footer */
.foot { max-width: 720px; margin: 8px auto 30px; padding: 0 16px; font-size: 13px; color: var(--muted); text-align: center; }
.foot a { color: var(--muted); }
.legal h2 { margin-top: 18px; } .legal li { margin-bottom: 6px; }
