/* Check Before You Pay: one typeface, neutral colours, one accent, verdict colours. Borders, not shadows. */
:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --ink: #16201b;
  --muted: #5b675f;
  --line: #d9dfda;
  --accent: #0b6839;
  --accent-hover: #09572f;
  --accent-ink: #ffffff;
  --focus: #1d6fd8;

  --high: #b42318;
  --high-bg: #fdecea;
  --caution: #a64b00;
  --caution-bg: #fff3e0;
  --none: #475467;
  --none-bg: #f0f2f1;

  --radius: 12px;
  --radius-sm: 8px;
  --gap: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Tamil",
    "Noto Sans Telugu", "Noto Sans Kannada", "Noto Sans Bengali", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
}
img, svg { display: block; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- layout ---------------------------------------------------------------- */
.site-header, .page, .site-footer { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.site-header { padding-top: 16px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px; }
.page { padding-top: 8px; padding-bottom: 24px; }
.site-footer { padding-bottom: 32px; color: var(--muted); font-size: 13px; }
.tagline { margin: 4px 0 16px; font-size: 18px; font-weight: 400; line-height: 1.5; color: var(--ink); }
/* Small links get a 44 px tall tap area without changing how the text looks. */
.site-footer a, .quiz-prompt a { display: inline-flex; align-items: center; min-height: 44px; }
.muted { color: var(--muted); }
.small, .fine { font-size: 13px; }
.fine { color: var(--muted); margin: 12px 0 0; text-align: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card.empty { text-align: center; display: grid; gap: 12px; justify-items: center; }
.quiz-prompt { margin: -6px 0 16px; font-size: 14px; }
.quiz-page h1 { margin: 8px 0 4px; font-size: 24px; line-height: 1.3; }
.quiz-page > .muted { margin: 0 0 16px; }
.quiz-question blockquote { margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); white-space: pre-wrap; overflow-wrap: anywhere; }
.quiz-question progress { width: 100%; height: 8px; accent-color: var(--accent); }
.quiz-image { max-width: 100%; max-height: 320px; margin: 12px auto; border-radius: var(--radius-sm); }
.quiz-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.quiz-score { margin: 0 0 16px; font-size: 24px; font-weight: 800; }
.quiz-review { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.quiz-review li { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.quiz-review li p { margin: 6px 0 0; color: var(--muted); }
.quiz-review .correct { border-left: 4px solid var(--accent); }
.quiz-review .incorrect { border-left: 4px solid var(--caution); }
.quiz-back { margin: 16px 0 0; text-align: center; }
.quiz-page .spinner { border-color: var(--line); border-top-color: var(--accent); }
.stats-page h1 { margin: 8px 0 4px; font-size: 24px; line-height: 1.3; }
.stats-page > .muted { margin: 0 0 16px; }
.stats-page .spinner { border-color: var(--line); border-top-color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.stat-value { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.stat-langs { margin-top: 12px; }
.stat-langs h2 { margin: 0 0 12px; font-size: 16px; }
.stat-langs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stat-langs li { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.stat-bar { height: 8px; border-radius: 4px; background: var(--none-bg); overflow: hidden; }
.stat-bar span { display: block; height: 100%; background: var(--accent); }
.stat-lang-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.pricing-page h1 { margin: 8px 0 4px; font-size: 24px; line-height: 1.3; }
.pricing-page > .muted { margin: 0 0 16px; }
.pricing-page .spinner { border-color: var(--line); border-top-color: var(--accent); }
.plans { display: grid; gap: 12px; }
.plan h2 { margin: 0; font-size: 18px; }
.plan-featured { border: 2px solid var(--accent); }
.plan-price { margin: 6px 0 12px; font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 15px; font-weight: 600; color: var(--muted); }
.plan-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-points li { display: flex; gap: 8px; align-items: flex-start; }
.plan-points svg { flex: none; margin-top: 4px; color: var(--accent); }
.order-status { display: grid; gap: 12px; justify-items: start; margin-bottom: 12px; }
.order-status p { margin: 0; }
.order-ok { border-left: 4px solid var(--accent); }
.order-warn { border-left: 4px solid var(--caution); }
@media (min-width: 1024px) {
  .pricing-page .plans { grid-template-columns: repeat(3, 1fr); }
}

/* ---- form ------------------------------------------------------------------ */
.label { display: block; font-weight: 600; margin-bottom: 6px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.field-row .label { margin: 0; }
select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
select { padding: 8px 10px; min-height: 44px; }
textarea { width: 100%; padding: 12px; resize: vertical; min-height: 140px; }
textarea[aria-invalid="true"] { border-color: var(--high); }
.counter { margin: 4px 0 0; font-size: 13px; color: var(--muted); text-align: right; }
.counter.over { color: var(--high); font-weight: 600; }

.file-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.attachment {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.attachment img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.attachment-icon { width: 48px; height: 48px; display: grid; place-items: center; background: var(--none-bg); border-radius: 6px; }
.attachment-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-name small { display: block; color: var(--muted); }

.error {
  margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--high-bg); color: var(--high); border: 1px solid #f4c7c2;
}

/* ---- buttons --------------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; text-align: center;
}
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button.primary:hover { background: var(--accent-hover); }
.button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.button.secondary:hover { border-color: var(--muted); }
.button.ghost { background: transparent; color: var(--muted); border-color: transparent; }
.button.small { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.button.block { width: 100%; margin-top: 16px; font-size: 17px; min-height: 52px; }
.button:disabled, .button.disabled { opacity: 0.6; cursor: not-allowed; }
.button.primary:disabled { opacity: 1; background: #4f7d63; }
label.button { position: relative; }
label.button:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ---- verdict --------------------------------------------------------------- */
.verdict { border-width: 2px; }
.verdict.band-high_risk { border-color: var(--high); }
.verdict.band-caution { border-color: var(--caution); }
.verdict.band-no_known_signals { border-color: var(--line); }
.verdict-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.band-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 700;
}
.band-high_risk .band-pill { background: var(--high-bg); color: var(--high); }
.band-caution .band-pill { background: var(--caution-bg); color: var(--caution); }
.band-no_known_signals .band-pill { background: var(--none-bg); color: var(--none); }
.score { font-size: 32px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.score small { font-size: 15px; font-weight: 600; color: var(--muted); }
.band-high_risk .score { color: var(--high); }
.band-caution .score { color: var(--caution); }
.verdict h1, .verdict h2 { font-size: 22px; line-height: 1.3; margin: 16px 0 8px; }
.verdict h1, .explanation, .signals p, .signals blockquote, .transcript p, .ring, .note, .steps li { overflow-wrap: anywhere; }
.note { margin: 16px 0 0; padding: 10px 12px; border-left: 3px solid var(--caution); background: var(--caution-bg); font-size: 15px; }
.verdict h2:focus { outline: none; }
.verdict h3, .verdict .verdict-section { font-size: 15px; text-transform: none; margin: 20px 0 8px; color: var(--muted); }
.explanation { margin: 0; }
.listen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.listen .button { min-height: 44px; }
.spinner.dark { border-color: rgba(22, 32, 27, 0.25); border-top-color: var(--ink); }
.sample-note {
  margin: 0 0 12px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--none-bg); color: var(--none); font-size: 14px; border: 1px dashed var(--line);
}

.signals { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.signals li { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.signals strong { display: block; }
.signals p, .signals blockquote { margin: 4px 0 0; color: var(--muted); }
.signals blockquote { font-style: italic; }
.pts {
  flex: none; min-width: 44px; height: 28px; display: grid; place-items: center; border-radius: 6px;
  font-weight: 700; font-size: 14px; background: var(--none-bg); color: var(--ink); font-variant-numeric: tabular-nums;
}
.band-high_risk .pts { background: var(--high-bg); color: var(--high); }
.band-caution .pts { background: var(--caution-bg); color: var(--caution); }
.ring { margin: 16px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--bg); }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.transcript { margin-top: 16px; }
.transcript summary { cursor: pointer; font-weight: 600; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.report-open { margin-top: 8px; font-size: 15px; min-height: 44px; text-decoration: underline; }
.report-box { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.report-box .small { margin: 0 0 12px; color: var(--muted); }
.report-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.report-consent input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.report-done { margin: 16px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--bg); }

.share-page .eyebrow { margin: 16px 0 12px; font-weight: 700; color: var(--accent); }
.share-page > .button { margin-top: 16px; width: 100%; }
.share-page .listen-label { margin: 16px 0 6px; font-weight: 600; }
.share-page .listen-audio { display: block; width: 100%; height: 44px; }
.share-page .verdict { background: var(--surface); border-radius: var(--radius); padding: 20px; border-style: solid; }
.share-page h2 { font-size: 15px; margin: 20px 0 8px; color: var(--muted); }
.share-page .signals div p { margin: 4px 0 0; color: var(--muted); }

/* ---- small and large screens ---------------------------------------------- */
@media (max-width: 380px) {
  .file-buttons, .actions, .quiz-actions { grid-template-columns: 1fr; }
  .card { padding: 16px; }
}
@media (min-width: 1024px) {
  body { font-size: 17px; }
  .site-header, .page, .site-footer { max-width: 720px; }
  .tagline { font-size: 20px; }
}
