/* FinPariksha: warm, Indian, confident. One font (Mukta: Latin + Devanagari), no frameworks. */
:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --text: #1c1b2e;
  --muted: #5f5b73;
  --line: #ece5d9;
  --accent: #4338ca;          /* indigo */
  --accent-soft: #eef0ff;
  --marigold: #f59e0b;
  --marigold-2: #f97316;
  --magenta: #be185d;
  --good: #15803d;
  --good-soft: #e9f8ee;
  --bad: #c0262d;
  --bad-soft: #fdeeee;
  --mod-a: #0f766e;
  --mod-b: #4338ca;
  --mod-c: #c2410c;
  --mod-d: #be185d;
  --hero: linear-gradient(135deg, #1e1b4b 0%, #4338ca 48%, #9d174d 100%);
  --radius: 18px;
  --shadow: 0 1px 2px rgba(28, 27, 46, .06), 0 6px 20px rgba(28, 27, 46, .07);
  --shadow-lift: 0 2px 4px rgba(28, 27, 46, .08), 0 14px 32px rgba(67, 56, 202, .16);
  --wrap: 820px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e17;
    --surface: #18172a;
    --text: #ecebf5;
    --muted: #a9a6bf;
    --line: #2a2840;
    --accent: #a5b4fc;
    --accent-soft: #23224a;
    --good: #4ade80;
    --good-soft: #13281c;
    --bad: #f87171;
    --bad-soft: #2d1719;
    --mod-a: #2dd4bf;
    --mod-b: #a5b4fc;
    --mod-c: #fb923c;
    --mod-d: #f472b6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 14px 32px rgba(0, 0, 0, .45);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 "Mukta", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Devanagari", "Nirmala UI", sans-serif;
}
html[lang="hi"] body { line-height: 1.75; }
a { color: var(--accent); text-underline-offset: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* header */
header.site { background: var(--surface); position: relative; box-shadow: 0 1px 0 var(--line); }
header.site::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: linear-gradient(90deg, #4338ca, #be185d 55%, #f59e0b); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: -0.01em; text-decoration: none; color: var(--text); }
.brand .mark { flex: none; }
.brand .wordmark span { background: linear-gradient(90deg, #be185d, #f97316); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav.top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
nav.top a { text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
nav.top a:hover { color: var(--text); background: var(--accent-soft); }
nav.top a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.lang { border: 1.5px solid var(--line); color: var(--text) !important; }

main { padding: 22px 0 56px; }
h1 { font-size: 34px; line-height: 1.2; margin: 6px 0 12px; letter-spacing: -0.02em; font-weight: 800; }
h2 { font-size: 24px; line-height: 1.3; margin: 36px 0 12px; font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 19px; margin: 22px 0 10px; font-weight: 700; }
.lead { font-size: 19px; color: var(--muted); }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.meta { font-size: 14px; color: var(--muted); }
.note { background: var(--accent-soft); border-radius: 14px; padding: 12px 16px; font-size: 15px; border-left: 4px solid var(--accent); }

/* hero (home) and page heads */
.hero { background: var(--hero); color: #fff; border-radius: 26px; padding: 30px 24px 26px; margin: 4px 0 26px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 340px; height: 340px; right: -110px; top: -140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, .55), rgba(245, 158, 11, 0) 70%); }
.hero::after { content: ""; position: absolute; width: 220px; height: 220px; left: -80px; bottom: -120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, .45), rgba(236, 72, 153, 0) 70%); }
.hero > * { position: relative; }
.hero h1 { color: #fff; font-size: 38px; margin-top: 0; }
.hero .lead { color: rgba(255, 255, 255, .86); margin-bottom: 14px; }
.chips { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: #fff; font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.exam-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.exam-card { background: rgba(255, 255, 255, .97); color: #1c1b2e; border-radius: 18px; padding: 16px 16px 14px; box-shadow: 0 10px 30px rgba(15, 12, 50, .25); display: flex; flex-direction: column; gap: 6px; }
.exam-card .ex-icon { font-size: 26px; line-height: 1; }
.exam-card h2 { font-size: 20px; margin: 2px 0 0; color: #1c1b2e; }
.exam-card p { margin: 0; font-size: 15px; color: #5f5b73; }
.exam-card .count { font-weight: 800; color: #4338ca; font-size: 15px; }
.exam-card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.page-head { background: linear-gradient(135deg, var(--accent-soft), transparent 70%); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px 6px; margin: 4px 0 18px; }
.page-head h1 { margin-top: 0; }

/* buttons and links styled as buttons */
a.cta, button { font: inherit; font-weight: 700; display: inline-block; padding: 9px 18px; border-radius: 999px; text-decoration: none; cursor: pointer; border: 0; }
a.cta, button:not(.secondary) { background: linear-gradient(135deg, var(--marigold), var(--marigold-2)); color: #1c1b2e; box-shadow: 0 4px 14px rgba(249, 115, 22, .3); }
a.cta:hover, button:not(.secondary):hover { filter: brightness(1.05); transform: translateY(-1px); }
a.cta.ghost, button.secondary { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.exam-card a.cta.ghost { color: #4338ca; box-shadow: inset 0 0 0 1.5px #4338ca; }
a.cta.share { background: #25d366; color: #0b3d1f; box-shadow: 0 4px 14px rgba(37, 211, 102, .3); }
a.cta.share::before { content: "💬 "; }

/* module headings and topic cards */
.exam-block { margin-top: 30px; }
h3.mod { display: flex; align-items: center; gap: 10px; }
.badge { flex: none; width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }
.badge.mA { background: var(--mod-a); } .badge.mB { background: var(--mod-b); } .badge.mC { background: var(--mod-c); } .badge.mD { background: var(--mod-d); }
.card-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; position: relative; overflow: hidden; padding-top: 18px; }
.card-list li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--mc, var(--accent)); }
.card-list li:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.card-list li a { font-weight: 700; text-decoration: none; color: var(--text); }
.card-list li a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-list li a:hover { color: var(--accent); }
.card-list .tag { font-size: 13.5px; color: var(--muted); display: block; margin-top: 4px; }
.card-list.mA li { --mc: var(--mod-a); } .card-list.mB li { --mc: var(--mod-b); } .card-list.mC li { --mc: var(--mod-c); } .card-list.mD li { --mc: var(--mod-d); }
.card-list.guides li { --mc: var(--marigold); }
.soon { color: var(--muted); font-weight: 700; }

table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 15px; margin: 12px 0; display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
tr:last-child td, tr:last-child th { border-bottom: 0; }
th { background: var(--accent-soft); font-weight: 700; }

/* quiz */
ol.quiz { padding-left: 0; list-style: none; counter-reset: q; }
ol.quiz > li.q { counter-increment: q; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; box-shadow: var(--shadow); }
li.q .stem { margin: 0 0 12px; font-weight: 700; display: flex; gap: 10px; }
li.q .stem::before { content: counter(q); flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 800; margin-top: 1px; }
ol.opts { list-style: none; padding: 0; margin: 0 0 8px; }
ol.opts li { margin: 8px 0; }
ol.opts label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .12s, background .12s; position: relative; }
ol.opts label:hover { border-color: var(--accent); }
ol.opts input { position: absolute; opacity: 0; pointer-events: none; }
ol.opts .letter { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--muted); border: 1.5px solid var(--line); }
ol.opts label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
ol.opts label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
ol.opts label:has(input:checked) .letter { background: var(--accent); border-color: var(--accent); color: #fff; }
li.q.correct { border-color: var(--good); }
li.q.wrong { border-color: var(--bad); }
ol.opts label.is-answer { background: var(--good-soft); border-color: var(--good); }
ol.opts label.is-answer .letter { background: var(--good); border-color: var(--good); color: #fff; }
ol.opts label.is-answer::after { content: "✓"; margin-left: auto; color: var(--good); font-weight: 800; }
ol.opts label.is-picked-wrong { background: var(--bad-soft); border-color: var(--bad); }
ol.opts label.is-picked-wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }
ol.opts label.is-picked-wrong::after { content: "✗"; margin-left: auto; color: var(--bad); font-weight: 800; }
details.exp { margin-top: 8px; font-size: 15.5px; background: var(--bg); border-radius: 12px; padding: 8px 12px; }
details.exp summary { cursor: pointer; color: var(--accent); font-weight: 700; }
details.exp p { margin: 8px 0; }
.src { color: var(--muted); font-size: 14px; }
.quiz-bar { position: sticky; bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 10px 8px 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow-lift); }
.score { font-weight: 800; color: var(--accent); }

/* footer */
footer.site { background: #1e1b4b; color: #c9c7e6; padding: 26px 0 36px; font-size: 14px; margin-top: 10px; }
footer.site a { color: #fff; margin-right: 16px; text-decoration: none; opacity: .9; }
footer.site a:hover { opacity: 1; text-decoration: underline; }
@media (prefers-color-scheme: dark) { footer.site { background: #0a0914; border-top: 1px solid var(--line); } }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  h1 { font-size: 27px; }
  .hero { padding: 22px 16px 18px; border-radius: 20px; }
  .hero h1 { font-size: 29px; }
  .brand { font-size: 19px; }
  header.site .wrap { padding-top: 8px; padding-bottom: 8px; }
  .quiz-bar { border-radius: 18px; }
}

/* timed practice exam (class names used by exam.js) */
.exam-app { margin: 18px 0 8px; }
.exam-app button { margin: 4px 8px 4px 0; }
.exam-start { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.exam-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--hero); color: #fff; border-radius: 14px; padding: 10px 16px; font-weight: 800; box-shadow: var(--shadow-lift); }
.exam-timer.low { color: #fde68a; }
.exam-q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 12px 0; box-shadow: var(--shadow); }
.exam-q .stem { font-weight: 700; margin: 0 0 12px; }
.exam-nav { display: flex; flex-wrap: wrap; gap: 0; }
.exam-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.exam-palette button { margin: 0; padding: 6px 0; background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; font-size: 14px; font-weight: 700; }
.exam-palette button.answered { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.exam-palette button.flagged::after { content: " ⚑"; color: var(--bad); }
.exam-palette button.current { outline: 2px solid var(--marigold); outline-offset: 1px; }
.exam-submit { margin-top: 16px; }
.exam-confirm { margin-top: 10px; }
.exam-result { border-radius: var(--radius); padding: 16px 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.exam-result.pass { border-color: var(--good); background: var(--good-soft); }
.exam-result.fail { border-color: var(--bad); background: var(--bad-soft); }
.exam-score { font-size: 28px; font-weight: 800; margin: 0 0 6px; }
.exam-topics tr.weak td { color: var(--bad); }
.exam-review { padding-left: 20px; }
.exam-review li { margin-bottom: 18px; }
.exam-review .stem { font-weight: 700; margin-bottom: 4px; }
.exam-review .yours { color: var(--bad); margin: 2px 0; }
.exam-review .right { color: var(--good); margin: 2px 0; }
.exam-again { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }

/* after "Check my answers": result colours win over the "selected" style */
li.q ol.opts label.is-answer { background: var(--good-soft); border-color: var(--good); }
li.q ol.opts label.is-answer .letter { background: var(--good); border-color: var(--good); color: #fff; }
li.q ol.opts label.is-picked-wrong { background: var(--bad-soft); border-color: var(--bad); }
li.q ol.opts label.is-picked-wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }

/* review list (review.js), "Your best" badges (progress.js) */
.mybest { display: inline-block; margin-left: 8px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; line-height: 1.7; background: var(--good-soft); color: var(--good); vertical-align: middle; white-space: nowrap; }
.exam-card .mybest { background: #e9f8ee; color: #15803d; align-self: center; }
p > a.cta + .mybest { margin-left: 4px; }
.quiz-best { margin: 0 0 8px; }
.review-note a { font-weight: 700; }
.review-count { font-weight: 800; font-size: 18px; color: var(--accent); }
.review-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 8px 0 16px; }
.review-filter { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.review-tools select { font: inherit; font-size: 15px; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; max-width: 100%; min-width: 0; }
.review-exp { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--bg); font-size: 15.5px; }
.review-exp p { margin: 6px 0; }
.review-exp .yours { color: var(--bad); font-weight: 700; }
.review-exp .right { color: var(--good); font-weight: 700; }
.review-list label:has(input:disabled) { cursor: default; }
.review-start { padding-left: 20px; }
.review-clear { margin-top: 22px; }

/* quick practice (quick.js) */
.quick-q .quick-topic { margin: 0 0 6px; }
.quick-q ol.opts label.is-answer { background: var(--good-soft); border-color: var(--good); }
.quick-q ol.opts label.is-answer .letter { background: var(--good); border-color: var(--good); color: #fff; }
.quick-q ol.opts label.is-picked-wrong { background: var(--bad-soft); border-color: var(--bad); }
.quick-q ol.opts label.is-picked-wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.quick-q ol.opts label:has(input:disabled) { cursor: default; }
.quick-fb button { margin-top: 6px; }
.quick-revisit { margin: 10px 0; }
.quick-note { margin-top: -4px; }

/* print: topic page as a class handout. Questions with lettered options and no answers, then the answer key
   (build.py writes it after the quiz, hidden on screen) on its own page, then the disclaimer and page URL. */
.print-only { display: none; }
.print-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: -2px 0 14px; }
.print-row button { padding: 7px 16px; font-size: 15px; }
.print-row .meta { margin: 0; }
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #333; --line: #bbb; --accent: #000; --accent-soft: #fff;
    --good: #000; --good-soft: #fff; --bad: #000; --bad-soft: #fff; }
  @page { margin: 14mm 13mm; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.4; }
  html[lang="hi"] body { line-height: 1.5; }
  header.site { box-shadow: none; border-bottom: 1px solid #999; }
  header.site::after, nav.top, .crumbs, .print-row, .quiz-bar, .quiz-best, .mybest, button, a.cta, .review-note,
  details.exp, .study-guide, .page-head .lead, footer.site .foot-links { display: none !important; }
  main { padding: 10pt 0 0; }
  .wrap { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  h1 { font-size: 17pt; margin: 0 0 4pt; }
  h2 { font-size: 13pt; margin: 10pt 0 6pt; }
  .page-head { background: none; border: 0; padding: 0; margin: 0 0 6pt; }
  .badge { color: #000; border: 1px solid #000; width: auto; height: auto; padding: 0 4px; border-radius: 4px; }
  ol.quiz > li.q { background: none; box-shadow: none; border: 0; border-bottom: 1px solid #ccc; border-radius: 0; padding: 6pt 0; margin: 0; break-inside: avoid; }
  li.q .stem { margin: 0 0 3pt; gap: 6pt; }
  li.q .stem::before { background: none; color: #000; width: auto; height: auto; display: inline; font-size: inherit; content: counter(q) "."; margin: 0; }
  ol.opts { margin: 0 0 0 16pt; }
  ol.opts li { margin: 1pt 0; }
  ol.opts label, li.q ol.opts label.is-answer, li.q ol.opts label.is-picked-wrong, ol.opts label:has(input:checked) {
    border: 0; background: none !important; padding: 0; border-radius: 0; gap: 6pt; align-items: baseline; }
  ol.opts .letter, li.q ol.opts label .letter, ol.opts label:has(input:checked) .letter {
    background: none !important; border: 0 !important; color: #000 !important; width: auto; height: auto; display: inline; font-size: inherit; }
  ol.opts label::after { content: none !important; }
  .print-only { display: block; }
  .answer-key { break-before: page; }
  .answer-key h2 { margin-top: 0; }
  .key-list { list-style: none; padding: 0; margin: 6pt 0 0; font-size: 10pt; line-height: 1.35; }
  .key-list li { break-inside: avoid; padding: 1.5pt 0; border-bottom: 1px dotted #ccc; }
  .key-list .k-n { display: inline-block; min-width: 2.2em; }
  .key-list b { display: inline-block; min-width: 1.4em; }
  footer.site { background: #fff !important; color: #000; border-top: 1px solid #999; padding: 8pt 0 0; margin: 12pt 0 0; font-size: 9pt; }
  footer.site p { margin: 0 0 4pt; }
}
