:root {
  --bg: #eef3f6;
  --bg-accent: #dce8ea;
  --card: #ffffff;
  --ink: #1c2a32;
  --muted: #5b6b73;
  --line: #d5e0e4;
  --teal: #1a7a6d;
  --teal-dark: #14645a;
  --teal-soft: #e6f4f1;
  --teal-mid: #b7ddd6;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --shadow: 0 16px 40px rgba(28, 42, 50, 0.08);
  --radius: 22px;
  --font: "Hind Siliguri", "Noto Sans Bengali", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 10% -10%, #e3eef2 0%, transparent 60%),
    radial-gradient(900px 400px at 110% 0%, #d9ece8 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.progress-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(238, 243, 246, 0.88);
  backdrop-filter: blur(10px);
  padding: 14px 20px 10px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 640px;
  margin: 0 auto 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.progress-bar {
  max-width: 640px;
  margin: 0 auto;
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1a7a6d, #2a9a86);
  border-radius: 99px;
  transition: width 280ms ease;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 32px;
}

.card {
  width: min(640px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px 24px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  margin-bottom: 8px;
}

h1 {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 18px;
}

.lede {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 1.02rem;
}

.screen { display: none; animation: rise 280ms ease; }
.screen.active { display: flex; flex-direction: column; flex: 1; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  padding: 13px 16px;
  font: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.option:hover, .option:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
  outline: none;
}

.option[aria-checked="true"] {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: inset 0 0 0 1px var(--teal);
  font-weight: 600;
}

.dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
  position: relative;
  background: #fff;
}

.option[aria-checked="true"] .dot {
  border-color: var(--teal);
}

.option[aria-checked="true"] .dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--teal);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 28px;
}

button, .btn {
  font: inherit;
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary, button.btn-primary {
  background: var(--teal);
  color: #fff;
  flex: 1;
}

.btn-primary:hover, .btn-primary:focus-visible { background: var(--teal-dark); outline: none; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line) !important;
}

.btn-ghost:hover { background: #f4f7f8; }

label.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  margin-top: 8px;
}

input[type="email"], input[type="tel"], input[type="password"], input[type="text"] {
  font: inherit;
  font-size: 16px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
}

input:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 122, 109, 0.15);
}

.error {
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.92rem;
  margin-top: 10px;
  display: none;
}

.error.show { display: block; }

.score-box {
  margin: 12px 0 8px;
  padding: 28px 16px;
  border-radius: 18px;
  background: var(--teal-soft);
  text-align: center;
}

.score-box .label {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.score-box .value {
  font-size: 4rem;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1;
}

.score-box .out-of {
  color: var(--muted);
  margin-top: 8px;
}

.consent {
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 8px;
  color: var(--ink);
}

.consent h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.consent ul {
  padding-left: 1.1em;
  margin-bottom: 16px;
}

.consent li { margin-bottom: 8px; }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500;
  margin: 16px 0 4px;
}

.check input { margin-top: 5px; accent-color: var(--teal); width: 18px; height: 18px; }

.thanks {
  text-align: center;
  align-items: center;
  justify-content: center;
}

.thanks .mark {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-size: 2rem;
  margin: 8px auto 16px;
}

.brand {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0 16px 20px;
}

.admin-table-wrap { overflow-x: auto; margin-top: 16px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
td.wrap { white-space: normal; max-width: 220px; word-break: break-word; }

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge.warn { background: #fff4e5; color: #8a4b08; }

@media (max-width: 520px) {
  .card { padding: 24px 18px 18px; min-height: 380px; border-radius: 18px; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.2rem; }
  .score-box .value { font-size: 3.2rem; }
}


.site-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.logo {
  font-weight: 700;
  color: var(--teal-dark);
  text-decoration: none;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--teal-soft); color: var(--teal-dark); }

.notice, .disclaimer, .privacy {
  border-radius: 16px;
  padding: 14px 16px;
  margin: 0 0 16px;
  font-size: 0.95rem;
}
.disclaimer {
  background: #fff8eb;
  border: 1px solid #f0e0b8;
  color: #5c4a1f;
}
.privacy {
  background: #f4f8fb;
  border: 1px solid var(--line);
  color: var(--muted);
}
.notice { background: var(--teal-soft); color: var(--teal-dark); }

.band {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}
.band-low { background: #e8f6ee; color: #0f6b3c; }
.band-mild { background: #eef6c9; color: #5c6b16; }
.band-moderate { background: #fff4e5; color: #8a4b08; }
.band-high { background: #fdecea; color: #8c1d18; }

.result-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
@media (min-width: 560px) {
  .result-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}
.result-tile {
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.result-tile h3 { font-size: 0.95rem; margin-bottom: 6px; }
.result-tile p { color: var(--muted); font-size: 0.92rem; }

.interp { margin: 8px 0 0; font-size: 0.98rem; }

.chart-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 8px 8px;
  margin: 12px 0 20px;
}
.chart-wrap svg { width: 100%; height: 180px; display: block; }
.muted { color: var(--muted); }

.tabs { display: flex; gap: 6px; margin: 8px 0 16px; flex-wrap: wrap; }
.tabs button {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.tabs button.active { background: var(--teal); color: #fff; border-color: var(--teal); }

.history-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fff;
}
.history-item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
details.answers { margin-top: 8px; color: var(--muted); }
details.answers summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.q-row { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.q-row:last-child { border-bottom: 0; }

.choice-row { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 520px) {
  .choice-row.inline { flex-direction: row; flex-wrap: wrap; }
  .choice-row.inline .option { flex: 1 1 140px; }
}

.footer-note { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 0 16px 24px; }
.footer-note a { color: var(--teal-dark); }

.modal {
  position: fixed; inset: 0; background: rgba(16, 24, 28, 0.45);
  display: grid; place-items: center; padding: 16px; z-index: 20;
}
.modal .sheet {
  background: #fff; border-radius: 20px; max-width: 860px; width: 100%;
  max-height: 90dvh; overflow: auto; padding: 22px;
  box-shadow: var(--shadow);
}
