:root {
  --orange: #FF5A1F;
  --orange-hover: #E64A0F;
  --blue: #1E88E5;
  --blue-dark: #1976D2;
  --blue-bg: #E3F2FD;
  --blue-pale: #EFF6FF;
  --teal: #14B8A6;
  --green: #16A34A;
  --green-bg: #ECFDF5;
  --green-border: #A7F3D0;
  --red: #DC2626;
  --red-bg: #FEF2F2;
  --red-border: #FECACA;
  --amber: #B45309;
  --amber-bg: #FFFBEB;
  --amber-border: #FDE68A;
  --ink: #0F172A;
  --ink-soft: #334155;
  --muted: #64748B;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;
  --bg: #F8FAFC;
  --card: #FFFFFF;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Georgia", "Cambria", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* --------- Progress header --------- */

.progress {
  padding: 4px 0 24px;
}

.progress__bar {
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: var(--orange);
  border-radius: 999px;
  transition: width 250ms ease;
}

.progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

/* --------- Question card --------- */

.card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: 36px 32px;
}

.pill {
  display: inline-block;
  background: var(--blue-bg);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
}

.question {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin: 16px 0 24px;
  line-height: 1.25;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.option:hover {
  border-color: var(--line-strong);
  background: #F9FBFF;
}

.option.is-selected {
  border-color: var(--blue);
  background: var(--blue-pale);
  color: var(--ink);
}

.option__check {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 150ms ease;
}

.option.is-selected .option__check {
  background: var(--blue);
  opacity: 1;
}

.option__check svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
}

/* --------- Controls --------- */

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

.btn--back {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.btn--back:hover { border-color: var(--line-strong); color: var(--ink-soft); }

.btn--next {
  background: var(--orange);
  color: #fff;
}

.btn--next:hover { background: var(--orange-hover); }

.btn--next:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--hidden { visibility: hidden; }

/* --------- Results --------- */

.results__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.results__title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px;
}

.results__subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.results__actions {
  display: flex;
  gap: 10px;
}

.btn--ghost {
  background: var(--card);
  color: var(--ink-soft);
  border-color: var(--line);
  padding: 10px 18px;
  font-size: 12px;
}

.btn--ghost:hover { border-color: var(--line-strong); color: var(--ink); }

.risk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.risk-card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 24px;
}

.risk-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}

.risk-card__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.risk-card__score {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}

.risk-card__score--t1d { color: var(--blue); }
.risk-card__score--t2d { color: var(--teal); }
.risk-card__score--symptoms { color: var(--ink); }

.risk-card__max {
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  margin-left: 4px;
}

.risk-card__body {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 14px;
}

.risk-card__body-title {
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}

.risk-card__body-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge--low { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.badge--high { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.badge--present { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }

.symptoms-card,
.next-steps-card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 24px;
  margin-bottom: 16px;
}

.symptoms-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.symptoms-card__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 2px;
}

.symptoms-card__subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.banner {
  border-radius: 10px;
  border: 1px solid;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.banner__icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.banner__icon svg { width: 14px; height: 14px; stroke-width: 3; fill: none; }

.banner__title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
}

.banner__text {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.banner--ok { background: var(--green-bg); border-color: var(--green-border); }
.banner--ok .banner__icon { background: var(--green); color: #fff; }
.banner--ok .banner__title { color: var(--green); }

.banner--alert { background: var(--amber-bg); border-color: var(--amber-border); }
.banner--alert .banner__icon { background: var(--amber); color: #fff; }
.banner--alert .banner__title { color: var(--amber); }

.next-steps-card {
  background: #F8FAFF;
  border-color: #DBEAFE;
}

.next-steps-card__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
}

.next-steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.next-steps-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.next-steps-list li::before {
  content: "";
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--blue) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / 12px no-repeat;
}

/* --------- Responsive --------- */

@media (max-width: 720px) {
  .app { padding: 20px 14px 40px; }
  .card { padding: 24px 18px; }
  .question { font-size: 22px; }
  .risk-grid { grid-template-columns: 1fr; }
  .results__header { flex-direction: column; align-items: stretch; }
  .results__actions { justify-content: flex-end; }
  .btn { padding: 12px 20px; font-size: 13px; }
  .option { padding: 14px 16px; font-size: 15px; }
}

/* --------- Print --------- */

@media print {
  body { background: #fff; }
  .results__actions { display: none; }
  .app { padding: 0; max-width: none; }
  .risk-card, .symptoms-card, .next-steps-card { break-inside: avoid; box-shadow: none; }
}
