/* =====================================================================
   AgriExtPrep — Base Stylesheet
   File: /public/css/style.css
   Mobile-first. Colours are taken from the logo.
   ===================================================================== */

:root {
  --brand:        #1e3a6e;   /* navy — "AgriExt" */
  --brand-dark:   #152b52;
  --brand-light:  #e8eefa;
  --accent:       #e2571e;   /* orange — "Prep" */
  --accent-dark:  #c04513;
  --teal:         #0f8b8d;
  --green:        #16a34a;

  --bg:           #faf7f0;   /* cream */
  --card:         #ffffff;
  --text:         #1f2937;
  --muted:        #6b7280;
  --border:       #e5e7eb;

  --ok:           #16a34a;
  --ok-bg:        #ecfdf5;
  --warn:         #b45309;
  --warn-bg:      #fffbeb;
  --err:          #dc2626;
  --err-bg:       #fef2f2;

  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg:    0 8px 24px rgba(16,24,40,.10);
  --maxw:         720px;
  --header-h:     56px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto,
               "Noto Sans Devanagari", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { margin: 0 0 .5rem; line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 .75rem; }
small { font-size: .82rem; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem;
}
.page { padding-bottom: 3rem; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; }
.row-between { display: flex; gap: .75rem; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 620px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center;
  box-shadow: var(--shadow);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0 1rem;
}
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: #fff; object-fit: contain; flex: 0 0 auto;
}
.brand-name { font-size: 1.05rem; letter-spacing: .2px; }
.brand-name span { color: #ffb38a; }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.header-link {
  color: #fff; font-size: .9rem; font-weight: 600;
  padding: .4rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.35);
}
.header-link:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.header-link.solid { background: var(--accent); border-color: var(--accent); }
.header-link.solid:hover { background: var(--accent-dark); }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.card-link { transition: box-shadow .15s, transform .15s; }
.card-title { display: flex; align-items: center; gap: .6rem; margin-bottom: .35rem; }
.card-icon { font-size: 1.5rem; line-height: 1; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 1.75rem 1rem 1.25rem;
  background: linear-gradient(180deg, var(--brand-light), var(--bg));
  border-bottom: 1px solid var(--border);
}
.hero img { width: 84px; height: 84px; margin: 0 auto .6rem; border-radius: 16px; }
.hero h1 { font-size: 1.6rem; color: var(--brand); margin-bottom: .2rem; }
.hero .tagline { color: var(--accent); font-weight: 600; letter-spacing: .5px; }
.hero .sub { color: var(--muted); font-size: .9rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600;
  padding: .7rem 1.1rem;
  min-height: 44px;                 /* mobile tap target */
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--brand); color: #fff;
  cursor: pointer; text-align: center;
  transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--brand); border-color: var(--border); }
.btn-outline:hover { background: var(--brand-light); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: #f3f4f6; }
.btn-sm { padding: .4rem .7rem; min-height: 36px; font-size: .875rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: .9rem; }
.field label {
  display: block; font-size: .875rem; font-weight: 600;
  margin-bottom: .3rem; color: var(--text);
}
.field .hint { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.input {
  width: 100%; font: inherit; color: var(--text);
  padding: .7rem .8rem; min-height: 44px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.input.err { border-color: var(--err); }
select.input { appearance: none; background-image: none; }
.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: .8rem; font-weight: 600; color: var(--brand); padding: .35rem .45rem;
}

/* ---------- Alerts ---------- */
.alert {
  padding: .7rem .9rem; border-radius: var(--radius-sm);
  font-size: .9rem; border: 1px solid transparent; margin-bottom: .9rem;
}
.alert-err  { background: var(--err-bg);  color: var(--err);  border-color: #fecaca; }
.alert-ok   { background: var(--ok-bg);   color: #15803d;     border-color: #bbf7d0; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #fde68a; }
.alert-info { background: var(--brand-light); color: var(--brand); border-color: #c7d7f5; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; font-size: .74rem; font-weight: 700;
  padding: .18rem .5rem; border-radius: 999px; letter-spacing: .3px;
  text-transform: uppercase;
}
.badge-free    { background: #ecfdf5; color: #15803d; }
.badge-premium { background: #fff7ed; color: var(--accent-dark); }
.badge-active  { background: #ecfdf5; color: #15803d; }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-none    { background: #f3f4f6; color: var(--muted); }
.badge-expired,
.badge-rejected{ background: var(--err-bg); color: var(--err); }

/* ---------- Price cards ---------- */
.price-card { position: relative; }
.price-card .price {
  font-size: 1.75rem; font-weight: 800; color: var(--brand); margin: .2rem 0;
}
.price-card ul { margin: .6rem 0 1rem; padding-left: 1.1rem; font-size: .9rem; }
.price-card li { margin-bottom: .25rem; }
.price-card .yes::marker { content: "✓  "; color: var(--green); }
.price-card .no  { color: var(--muted); }
.price-card .no::marker { content: "✕  "; color: var(--muted); }
.ribbon {
  position: absolute; top: -10px; right: 12px;
  background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .4px;
  padding: .22rem .6rem; border-radius: 999px;
}

/* ---------- Toast ---------- */
#toast-host {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: .5rem;
  width: calc(100% - 2rem); max-width: 420px; pointer-events: none;
}
.toast {
  background: #111827; color: #fff;
  padding: .7rem .9rem; border-radius: var(--radius-sm);
  font-size: .9rem; box-shadow: var(--shadow-lg);
  animation: toast-in .18s ease-out;
}
.toast.ok  { background: #15803d; }
.toast.err { background: var(--err); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ---------- Loader ---------- */
.loader-wrap { display: flex; justify-content: center; padding: 2rem 0; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
#page-loader {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 2rem; padding: 1.25rem 1rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center; font-size: .85rem; color: var(--muted);
}
.site-footer a { color: var(--brand); }

/* ---------- Utility ---------- */
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; border: 0; }
.section-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted); margin: 1.5rem 0 .6rem;
}
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; font-size: .92rem; }
.kv + .kv { border-top: 1px solid var(--border); }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }

/* =====================================================================
   TEST ENGINE  (Phase 3)
   ===================================================================== */

/* ---- top bar: timer ---- */
.test-bar {
  position: sticky; top: 0; z-index: 40;
  background: var(--brand); color: #fff;
  padding: .5rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.test-bar .t-name {
  font-size: .85rem; font-weight: 600; opacity: .9;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.timer {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.05rem;
  background: rgba(255,255,255,.15); padding: .25rem .6rem; border-radius: 999px;
  flex: 0 0 auto;
}
.timer.warn   { background: #b45309; }
.timer.danger { background: var(--err); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---- question ---- */
.q-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: .6rem;
}
.q-num { font-weight: 800; color: var(--brand); font-size: 1rem; }
.q-text { font-size: 1.02rem; line-height: 1.65; margin-bottom: 1rem; white-space: pre-wrap; }

.opt {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .8rem .9rem; margin-bottom: .55rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; transition: border-color .12s, background .12s;
}
.opt:hover { border-color: #c7d7f5; }
.opt input { margin: .25rem 0 0; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--brand); }
.opt.sel { border-color: var(--brand); background: var(--brand-light); }
.opt .lbl { font-weight: 700; color: var(--brand); flex: 0 0 auto; }
.opt .txt { flex: 1; }

/* ---- bottom buttons ---- */
.q-nav { display: flex; gap: .6rem; margin-top: 1rem; }
.q-nav .btn { flex: 1; }

.test-foot {
  position: sticky; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--border);
  padding: .6rem 1rem; display: flex; gap: .6rem; align-items: center;
}
.test-foot .btn { flex: 1; }

/* ---- Question palette ---- */
.palette-wrap {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(17,24,39,.5); display: none;
}
.palette-wrap.open { display: block; }
.palette {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 16px 16px 0 0;
  max-height: 78vh; overflow: auto; padding: 1rem;
}
.palette-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: .45rem; margin-top: .75rem;
}
.pal {
  aspect-ratio: 1; border-radius: 8px; border: 1.5px solid var(--border);
  background: #fff; font: inherit; font-weight: 700; font-size: .85rem;
  cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.pal.answered  { background: var(--green); border-color: var(--green); color: #fff; }
.pal.current   { outline: 3px solid var(--accent); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .8rem; color: var(--muted); }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block;
            margin-right: .3rem; vertical-align: -1px; border: 1.5px solid var(--border); }
.legend i.a { background: var(--green); border-color: var(--green); }

/* ---- Result ---- */
.score-hero {
  text-align: center; padding: 1.5rem 1rem;
  background: linear-gradient(180deg, var(--brand-light), #fff);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.score-hero .big {
  font-size: 2.6rem; font-weight: 800; color: var(--brand);
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.score-hero .of { color: var(--muted); font-size: 1rem; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .7rem .5rem; text-align: center;
}
.stat .n { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.stat.ok .n   { color: var(--green); }
.stat.bad .n  { color: var(--err); }
.stat.skip .n { color: var(--muted); }

/* ---- Table (leaderboard / results) ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.tbl th, table.tbl td { padding: .55rem .5rem; text-align: left; white-space: nowrap; }
table.tbl th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); border-bottom: 2px solid var(--border);
}
table.tbl td { border-bottom: 1px solid var(--border); }
table.tbl tr.me td { background: var(--brand-light); font-weight: 700; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-1 { color: #b45309; font-weight: 800; }
.rank-2 { color: #6b7280; font-weight: 800; }
.rank-3 { color: #92400e; font-weight: 800; }

/* ---- empty state ---- */
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .ico { font-size: 2.2rem; margin-bottom: .4rem; }

/* ---- Modal ---- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 70; display: none;
  background: rgba(17,24,39,.55); align-items: center; justify-content: center; padding: 1rem;
}
.modal-wrap.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); padding: 1.25rem;
  max-width: 380px; width: 100%; box-shadow: var(--shadow-lg);
}

/* ---- hide the header while a test is running ---- */
body.in-test .site-header, body.in-test .site-footer { display: none; }

/* =====================================================================
   PRICING · CATEGORY TABS · SYLLABUS
   ===================================================================== */

/* struck-through original price next to the offer price */
.price .mrp {
  font-size: 1rem; font-weight: 600; color: var(--muted);
  text-decoration: line-through; margin-left: .45rem;
}
.off-badge {
  display: inline-block; background: #ecfdf5; color: #15803d;
  font-size: .74rem; font-weight: 800; letter-spacing: .3px;
  padding: .18rem .5rem; border-radius: 999px;
}

/* section tabs used on the tests and notes pages */
.cat-tabs {
  display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem;
  -webkit-overflow-scrolling: touch;
}
.cat-tab {
  font: inherit; font-size: .82rem; font-weight: 600; white-space: nowrap;
  cursor: pointer; padding: .45rem .8rem; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
}
.cat-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-head {
  background: var(--brand-light); border: 1px solid #c7d7f5;
  border-radius: var(--radius-sm); padding: .6rem .8rem; margin-bottom: .75rem;
}
.cat-head h2 { margin: 0 0 .1rem; font-size: 1rem; color: var(--brand); }
.cat-head p  { margin: 0; font-size: .82rem; color: var(--muted); }

/* syllabus reader */
.syl-body {
  white-space: pre-wrap; font-size: .93rem; line-height: 1.75;
  word-break: break-word;
}

/* ---------- brand icons ---------- */
.social-row {
  display: flex; justify-content: center; gap: .55rem; margin-top: .2rem;
}
.social-row a, .social-row button {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); color: var(--brand);
  transition: border-color .15s, transform .15s;
}
.social-row button { font: inherit; cursor: pointer; padding: 0; }
.social-row a:hover, .social-row button:hover {
  border-color: var(--brand); transform: translateY(-1px); text-decoration: none;
}
.social-row svg { display: block; }

/* icons sitting inside buttons */
.btn svg { margin-right: .1rem; }
.btn.social { gap: .4rem; }

.phone-out { margin: .55rem 0 0; min-height: 0; font-size: .9rem; }
.phone-out.show { min-height: 1.2em; }
.phone-out a { font-weight: 600; }
.btn.revealed { letter-spacing: .2px; }

/* =====================================================================
   Answer Analysis page  (/pages/analysis.html)
   ===================================================================== */

/* --- filter chips + search --- */
.an-tools { display: flex; flex-direction: column; gap: .6rem; }
.an-chips { display: flex; gap: .45rem; flex-wrap: wrap; }
.an-chip {
  font: inherit; font-size: .85rem; cursor: pointer;
  padding: .42rem .8rem; border-radius: 999px;
  border: 1.5px solid var(--border); background: #fff; color: var(--text);
}
.an-chip b { margin-left: .15rem; }
.an-chip.on            { border-color: var(--brand); background: var(--brand-light); color: var(--brand); }
.an-chip.c-bad.on      { border-color: var(--err);   background: var(--err-bg);   color: var(--err); }
.an-chip.c-skip.on     { border-color: var(--warn);  background: var(--warn-bg);  color: var(--warn); }
.an-chip.c-ok.on       { border-color: var(--ok);    background: var(--ok-bg);    color: var(--ok); }

/* --- one question card --- */
.an-q { margin-bottom: .85rem; border-left: 4px solid var(--border); }
.an-q.ok   { border-left-color: var(--ok); }
.an-q.bad  { border-left-color: var(--err); }
.an-q.skip { border-left-color: var(--warn); }
.an-q.flash { animation: an-flash 1.4s ease-out; }
@keyframes an-flash { 0% { background: #fff6e5; } 100% { background: #fff; } }

.an-tag {
  font-size: .74rem; font-weight: 700; white-space: nowrap;
  padding: .22rem .55rem; border-radius: 999px;
}
.an-tag.ok   { background: var(--ok-bg);   color: var(--ok); }
.an-tag.bad  { background: var(--err-bg);  color: var(--err); }
.an-tag.skip { background: var(--warn-bg); color: var(--warn); }

/* --- options, read only --- */
.an-opt {
  display: flex; align-items: flex-start; gap: .6rem; flex-wrap: wrap;
  padding: .65rem .8rem; margin-bottom: .45rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; font-size: .95rem;
}
.an-opt .lbl { font-weight: 700; color: var(--muted); flex: 0 0 auto; }
.an-opt .txt { flex: 1 1 60%; }
.an-opt .flag {
  flex: 0 0 auto; font-size: .72rem; font-weight: 700;
  padding: .12rem .45rem; border-radius: 999px; background: #f3f4f6; color: var(--muted);
}
.an-opt.key       { border-color: var(--ok);  background: var(--ok-bg); }
.an-opt.key .lbl  { color: var(--ok); }
.an-opt.key .flag { background: var(--ok); color: #fff; }
.an-opt.mine      { border-color: var(--err); background: var(--err-bg); }
.an-opt.mine .lbl { color: var(--err); }
.an-opt.mine .flag{ background: var(--err); color: #fff; }

.an-note {
  margin: .5rem 0 0; font-size: .86rem; color: var(--warn);
  background: var(--warn-bg); padding: .55rem .7rem; border-radius: var(--radius-sm);
}
.an-exp {
  margin-top: .6rem; font-size: .89rem; line-height: 1.6;
  background: var(--brand-light); border: 1px solid #c7d7f5;
  padding: .65rem .8rem; border-radius: var(--radius-sm);
}

/* --- "where you lost marks" bars --- */
.an-block { margin-bottom: .75rem; }
.an-bar {
  display: flex; height: 10px; border-radius: 999px;
  overflow: hidden; background: var(--border);
}
.an-bar i { display: block; height: 100%; }
.an-bar i.ok   { background: var(--ok); }
.an-bar i.bad  { background: var(--err); }
.an-bar i.skip { background: #d1d5db; }

/* --- attempt comparison --- */
.an-cmp { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .6rem; flex-wrap: wrap; }
.an-cmp .t { font-size: .84rem; font-weight: 700; flex: 0 0 100%; }
.an-cmp .t.ok   { color: var(--ok); }
.an-cmp .t.bad  { color: var(--err); }
.an-cmp .t.warn { color: var(--warn); }
.an-cmp .jumps { display: flex; gap: .3rem; flex-wrap: wrap; }
.an-jump {
  font: inherit; font-size: .8rem; cursor: pointer; min-width: 30px;
  padding: .2rem .4rem; border-radius: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--brand);
}
.an-jump:hover { border-color: var(--brand); }

.an-insight { background: var(--warn-bg); border-color: #fde68a; }

/* =====================================================================
   ASRB Mains — descriptive answer writing
   ===================================================================== */

.mains-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; border-radius: var(--radius); padding: 1.2rem 1.1rem;
}
.mains-hero .tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; background: var(--accent); color: #fff;
  padding: .2rem .6rem; border-radius: 999px; margin-bottom: .5rem;
}
.mains-hero h1 { margin: 0 0 .4rem; color: #fff; font-size: 1.45rem; }
.mains-hero p  { margin: 0; font-size: .92rem; line-height: 1.6; opacity: .93; }

.mains-grid { display: grid; gap: .8rem; }
@media (min-width: 620px) { .mains-grid { grid-template-columns: repeat(3, 1fr); } }

.mains-card { text-align: center; }
.mains-card .ico { font-size: 1.9rem; line-height: 1; margin-bottom: .45rem; }
.mains-card h3   { margin: 0 0 .3rem; font-size: 1.02rem; }
.mains-card p    { margin: 0 0 .6rem; font-size: .86rem; }
.mains-card .foot { margin-top: auto; }

/* ---- a question in the bank ---- */
.q-card { margin-bottom: .8rem; }
.q-card .qtext {
  margin: 0; font-size: .96rem; line-height: 1.6; white-space: pre-wrap; flex: 1;
}
.q-card .marks {
  flex: 0 0 auto; font-weight: 800; font-size: .82rem; color: var(--accent);
  background: #fff3ec; border: 1px solid #ffd8c4;
  padding: .2rem .55rem; border-radius: 999px;
}

/* ---- uploading the photographed pages ---- */
.page-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: .55rem; margin-top: .8rem;
}
.page-thumb {
  position: relative; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; background: #fff;
}
.page-thumb img { display: block; width: 100%; height: 118px; object-fit: cover; }
.page-thumb .n {
  position: absolute; left: 0; bottom: 0; right: 0;
  background: rgba(17,24,39,.72); color: #fff;
  font-size: .72rem; text-align: center; padding: .16rem 0;
}
.page-thumb .x {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px;
  border: none; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1;
  background: rgba(220,38,38,.92); color: #fff;
}

.tips { margin: .3rem 0 .9rem; padding-left: 1.1rem; font-size: .87rem; line-height: 1.65; }
.tips li { margin-bottom: .2rem; }

/* ---- the submitted sheet ---- */
.sheet-page { margin: 0 0 .9rem; }
.sheet-page img {
  display: block; width: 100%; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fff;
}
.sheet-page figcaption {
  font-size: .78rem; color: var(--muted); text-align: center; margin-top: .25rem;
}

/* ---- the evaluator's feedback ---- */
.fb { background: var(--brand-light); border-color: #c7d7f5; }
.fb.ok   { background: var(--ok-bg);   border-color: #bbf7d0; }
.fb.warn { background: var(--warn-bg); border-color: #fde68a; }
.fb-text { margin: 0 0 .5rem; font-size: .93rem; line-height: 1.7; white-space: pre-wrap; }
.fb-text:last-child { margin-bottom: 0; }

/* ---- the evaluator panel shown to students ---- */
.evaluator-list { display: grid; gap: .6rem; }
.evaluator { display: flex; align-items: center; gap: .7rem; }
.evaluator .av {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-weight: 800;
}
.evaluator small { display: block; font-size: .8rem; }

.badge-info    { background: #e0e7ff; color: #3730a3; }
.badge-pending { background: var(--warn-bg); color: var(--warn); }

/* ---- "Send your answer" choices ---- */
.send-grid { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) { .send-grid { grid-template-columns: 1fr; } }

.send-opt {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: .9rem .7rem; text-align: center;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.send-opt:hover { transform: translateY(-1px); text-decoration: none; }
.send-opt.tg:hover { border-color: #229ED9; }
.send-opt.em:hover { border-color: #EA4335; }
.send-opt svg { width: 26px; height: 26px; margin-bottom: .15rem; }
.send-opt strong { font-size: .95rem; }
.send-opt small { font-size: .76rem; color: var(--muted); word-break: break-all; }

/* =====================================================================
   Enrolment flash — the poster, as a panel
   ===================================================================== */

.promo-wrap {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(17,24,39,.62);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 1rem .7rem; overflow-y: auto;
  opacity: 0; transition: opacity .2s ease;
}
.promo-wrap.open { opacity: 1; }

.promo {
  position: relative; width: 100%; max-width: 560px; margin: auto;
  background: var(--card); border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(16,24,40,.35);
  transform: translateY(14px) scale(.985);
  transition: transform .25s cubic-bezier(.2,.8,.3,1);
}
.promo-wrap.open .promo { transform: none; }

.promo-x {
  position: absolute; top: .5rem; right: .55rem; z-index: 2;
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.22); color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer;
}
.promo-x:hover { background: rgba(255,255,255,.35); }

/* ---- header ---- */
.promo-top {
  position: relative; padding: 1.15rem 1rem 1rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; text-align: center;
}
.promo-top h2 {
  margin: 0; color: #fff; font-size: 1.75rem; line-height: 1.1;
  letter-spacing: .5px; font-weight: 900;
}
.promo-top h2 span { color: #ffd166; display: block; }
.promo-tag { margin: .5rem auto 0; max-width: 34ch; font-size: .88rem; opacity: .93; }

.promo-badge {
  position: absolute; top: .6rem; left: .7rem;
  background: var(--accent); color: #fff; border-radius: 10px;
  padding: .35rem .5rem; font-size: .6rem; line-height: 1.25;
  text-align: center; font-weight: 700;
}
.promo-badge b { font-size: .72rem; }
.promo-badge small { opacity: .85; font-size: .55rem; }

/* ---- countdown ---- */
.promo-timer {
  background: #111827; color: #fff; text-align: center;
  padding: .55rem .8rem; display: flex; gap: .6rem;
  align-items: center; justify-content: center; flex-wrap: wrap;
}
.promo-timer .lbl { font-size: .8rem; opacity: .85; }
.promo-timer .clock {
  font-weight: 800; font-size: 1.05rem; letter-spacing: .5px;
  color: #ffd166; font-variant-numeric: tabular-nums;
}
.promo-timer.flat { background: var(--accent); }
.promo-timer.flat .lbl { opacity: 1; font-weight: 600; }

/* ---- features ---- */
.promo-feats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .1rem; background: var(--border); padding: 1px 0;
}
@media (max-width: 460px) { .promo-feats { grid-template-columns: repeat(2, 1fr); } }
.promo-feat {
  background: #fff; padding: .7rem .45rem; text-align: center;
  display: flex; flex-direction: column; gap: .12rem;
}
.promo-feat .ic { font-size: 1.25rem; line-height: 1; }
.promo-feat strong { font-size: .78rem; line-height: 1.25; }
.promo-feat small { font-size: .68rem; color: var(--muted); line-height: 1.3; }

.promo-guarantee {
  background: #14532d; color: #fff; padding: .7rem .9rem;
  font-size: .84rem; text-align: center; line-height: 1.5;
}
.promo-guarantee strong { color: #ffd166; }

/* ---- plans ---- */
.promo-h3 {
  margin: .9rem 0 .6rem; text-align: center; font-size: 1rem;
  text-transform: uppercase; letter-spacing: .6px; color: var(--brand);
}
.promo-plans { display: grid; gap: .6rem; padding: 0 .8rem .2rem; }
@media (min-width: 640px) { .promo-plans { grid-template-columns: repeat(3, 1fr); } }

.promo-plan {
  position: relative; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: .8rem .7rem .7rem; background: #fff;
  display: flex; flex-direction: column;
}
.promo-plan.hot { border-color: var(--accent); box-shadow: 0 0 0 3px #fff3ec; }
.promo-num {
  position: absolute; top: -9px; left: .7rem;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .74rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.promo-plan.hot .promo-num { background: var(--accent); }
.promo-ribbon {
  position: absolute; top: -9px; right: .6rem;
  background: var(--accent); color: #fff; font-size: .62rem; font-weight: 800;
  padding: .12rem .45rem; border-radius: 999px; text-transform: uppercase;
}
.promo-plan h4 { margin: .35rem 0 .4rem; font-size: .92rem; line-height: 1.3; }
.promo-plan ul { margin: 0 0 .6rem; padding-left: 1rem; font-size: .77rem; line-height: 1.5; }
.promo-plan li { margin-bottom: .12rem; }
.promo-price {
  font-size: 1.32rem; font-weight: 900; color: var(--brand); margin-bottom: .1rem;
}
.promo-plan.hot .promo-price { color: var(--accent); }
.promo-price s { font-size: .8rem; font-weight: 600; color: var(--muted); margin-left: .35rem; }
.promo-off {
  display: inline-block; font-size: .66rem; font-weight: 800; color: #15803d;
  background: #ecfdf5; padding: .1rem .4rem; border-radius: 999px; margin-bottom: .5rem;
}
.promo-plan .btn { margin-top: auto; }

/* ---- contact + footer ---- */
.promo-contact { display: grid; gap: .5rem; padding: .8rem .8rem .2rem; }
@media (min-width: 460px) { .promo-contact { grid-template-columns: 1fr 1fr; } }
.promo-btn {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem .5rem; border-radius: var(--radius-sm); font-size: .84rem;
  font-weight: 600; text-decoration: none; border: 1.5px solid var(--border);
  background: #fff; color: var(--text);
}
.promo-btn:hover { text-decoration: none; }
.promo-btn.tg:hover { border-color: #229ED9; }
.promo-btn.wa:hover { border-color: #25D366; }

.promo-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; padding: .6rem .8rem .8rem; flex-wrap: wrap;
}
.promo-never { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted); }
.promo-never input { width: 15px; height: 15px; accent-color: var(--brand); }

/* a plan with no price on it */
.promo-price.free { font-size: 1.05rem; color: var(--green); }
.promo-note {
  display: inline-block; font-size: .66rem; color: var(--muted);
  margin-bottom: .5rem; line-height: 1.3;
}
.promo-btn.ph:hover { border-color: var(--brand); }

/* =====================================================================
   "Install the app" sheet
   ===================================================================== */

.ins-wrap {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(17,24,39,.55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; opacity: 0; transition: opacity .2s ease;
}
.ins-wrap.open { opacity: 1; }
@media (min-width: 560px) { .ins-wrap { align-items: center; padding: 1rem; } }

.ins {
  position: relative; width: 100%; max-width: 440px;
  background: var(--card); padding: 1.1rem 1rem 1rem;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 40px rgba(16,24,40,.28);
  transform: translateY(18px); transition: transform .25s cubic-bezier(.2,.8,.3,1);
}
.ins-wrap.open .ins { transform: none; }
@media (min-width: 560px) { .ins { border-radius: 16px; } }

.ins-x {
  position: absolute; top: .5rem; right: .6rem;
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: #f3f4f6; color: var(--muted);
  font-size: 19px; line-height: 1; cursor: pointer;
}
.ins-x:hover { background: var(--border); }

.ins-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; }
.ins-icon {
  width: 46px; height: 46px; border-radius: 11px; flex: 0 0 auto;
  border: 1px solid var(--border);
}
.ins-head h3 { margin: 0; font-size: 1.02rem; }
.ins-head small { color: var(--muted); font-size: .78rem; }

.ins-points, .ins-steps {
  margin: 0; padding-left: 1.15rem; font-size: .87rem; line-height: 1.6;
  color: var(--text);
}
.ins-points li, .ins-steps li { margin-bottom: .2rem; }

.ins-never-link {
  display: block; width: 100%; margin-top: .55rem;
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: .78rem; color: var(--muted); text-decoration: underline;
}

/* =====================================================================
   Notices
   ===================================================================== */

.notice-list { display: grid; gap: .55rem; }

.notice {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .75rem .85rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff;
  border-left: 4px solid var(--brand);
}
.notice .ico { font-size: 1.05rem; line-height: 1.3; flex: 0 0 auto; }
.notice .body { flex: 1; min-width: 0; }
.notice strong { display: block; font-size: .94rem; line-height: 1.4; }
.notice p { margin: .25rem 0 0; font-size: .87rem; line-height: 1.6; white-space: pre-wrap; }
.notice .meta {
  display: flex; gap: .8rem; flex-wrap: wrap;
  margin-top: .4rem; font-size: .78rem; color: var(--muted);
}
.notice .meta a { font-weight: 600; }

.notice.nt-info   { border-left-color: var(--brand);  background: var(--brand-light); }
.notice.nt-exam   { border-left-color: var(--teal);   background: #e6f6f4; }
.notice.nt-test   { border-left-color: var(--green);  background: var(--ok-bg); }
.notice.nt-urgent { border-left-color: var(--err);    background: var(--err-bg); }

.notice-more {
  display: block; text-align: center; font-size: .84rem;
  font-weight: 600; padding: .35rem;
}

/* ---- the pop-up ---- */
.nf-wrap {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17,24,39,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; transition: opacity .18s ease;
}
.nf-wrap.open { opacity: 1; }

.nf {
  position: relative; width: 100%; max-width: 420px;
  background: var(--card); border-radius: 16px; padding: 1.1rem 1rem 1rem;
  border-top: 5px solid var(--brand);
  box-shadow: 0 18px 50px rgba(16,24,40,.3);
  transform: translateY(12px); transition: transform .22s cubic-bezier(.2,.8,.3,1);
}
.nf-wrap.open .nf { transform: none; }
.nf.nt-exam   { border-top-color: var(--teal); }
.nf.nt-test   { border-top-color: var(--green); }
.nf.nt-urgent { border-top-color: var(--err); }

.nf-x {
  position: absolute; top: .5rem; right: .6rem;
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: #f3f4f6; color: var(--muted); font-size: 19px; cursor: pointer;
}
.nf-top { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .6rem; }
.nf-top .ico { font-size: 1.5rem; line-height: 1.1; }
.nf-top small {
  display: block; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); font-weight: 700;
}
.nf-top h3 { margin: .1rem 0 0; font-size: 1.05rem; line-height: 1.35; }
.nf-body {
  margin: 0 0 .9rem; font-size: .9rem; line-height: 1.65; white-space: pre-wrap;
}
.nf-foot { display: flex; gap: .5rem; }
.nf-foot .btn { flex: 1; }
.nf-more {
  display: block; text-align: center; margin-top: .6rem;
  font-size: .78rem; color: var(--muted);
}

/* a premium note opened up as a free sample */
.badge-demo {
  background: var(--ok-bg); color: #15803d;
  display: inline-block; margin-top: .3rem;
}
.demo-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: .7rem; flex-wrap: wrap;
  background: var(--ok-bg); border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm); padding: .6rem .8rem; margin-bottom: .8rem;
  font-size: .87rem;
}

/* ---- picking several notes at once ---- */
.pick { flex: 0 0 auto; padding-top: .1rem; }
.pick input { width: 17px; height: 17px; accent-color: var(--brand); }
.card.picked { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light); }

.bulk-all { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.bulk-all input { width: 16px; height: 16px; accent-color: var(--brand); }

.bulk-bar {
  position: sticky; top: calc(var(--header-h) + .3rem); z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; flex-wrap: wrap;
  background: var(--brand); color: #fff;
  border-radius: var(--radius-sm); padding: .55rem .7rem;
  box-shadow: var(--shadow);
}
.bulk-bar > span { font-weight: 700; font-size: .87rem; }
.bulk-bar .btn { background: #fff; color: var(--brand); border-color: #fff; }
.bulk-bar .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.bulk-bar .btn-ghost { background: transparent; color: #fff; border-color: transparent; }
