:root {
  --ink: #172a2a;
  --muted: #60706e;
  --cream: #f4f4f0;
  --paper: #ffffff;
  --teal: #123d3a;
  --teal-soft: #dcebe7;
  --orange: #b27313;
  --orange-soft: #f6ead0;
  --yellow: #dda92f;
  --line: #d8dcd8;
  --shadow: 0 5px 18px rgba(18, 61, 58, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { background: var(--cream); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", system-ui, sans-serif;
}

button, a { font: inherit; }
button { color: inherit; }

.app-shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 24px 54px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--yellow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--teal);
  letter-spacing: 0;
}

.privacy-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.panel {
  position: relative;
  padding: clamp(28px, 5vw, 68px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.65fr);
  gap: clamp(32px, 6vw, 78px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  color: var(--teal);
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.03;
}

h2 {
  max-width: 760px;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.06;
}

.lead {
  max-width: 650px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.22rem);
  line-height: 1.7;
}

.primary-button, .secondary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  border: 1px solid var(--teal);
  color: #fff;
  background: var(--teal);
  box-shadow: 0 8px 20px rgba(18, 61, 58, 0.18);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--teal);
  background: rgba(255,255,255,0.7);
}

.primary-button:hover, .secondary-button:hover { box-shadow: 0 5px 14px rgba(18, 61, 58, 0.16); }
.primary-button:focus-visible, .secondary-button:focus-visible, .answer-button:focus-visible, .text-button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.intro-card {
  padding: 25px;
  border-radius: 10px;
  color: var(--ink);
  background: #e3b044;
}

.intro-number {
  display: block;
  margin-bottom: 5px;
  color: var(--teal);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 4.1rem;
  line-height: 1;
}

.intro-card p { margin: 0; line-height: 1.6; }

.progress-wrap { margin-bottom: 42px; }
.progress-meta { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 12px; color: var(--muted); font-size: 0.86rem; font-weight: 600; }
.progress-track { overflow: hidden; height: 8px; border-radius: 99px; background: var(--teal-soft); }
.progress-bar { height: 100%; border-radius: inherit; background: var(--orange); transition: width 280ms ease; }

.question-copy { max-width: 760px; margin-bottom: 31px; }
.question-copy p { margin: 14px 0 0; color: var(--muted); line-height: 1.6; }

.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.answer-button {
  position: relative;
  display: flex;
  min-height: 84px;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.answer-button:hover {
  border-color: var(--orange);
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 42, 42, 0.08);
}

.answer-index {
  display: grid;
  flex: 0 0 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.question-actions { display: flex; justify-content: space-between; margin-top: 28px; }
.text-button { padding: 10px 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-weight: 600; }

.results-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-bottom: 35px;
}

.results-header .lead { margin-bottom: 0; }
.results-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.summary-chip, .badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}
.summary-chip { padding: 7px 10px; border-radius: 5px; color: var(--teal); background: #edf2f0; }

.results-grid { display: grid; gap: 16px; }
.resource-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) minmax(175px, auto);
  gap: 18px;
  align-items: start;
  padding: 0 24px 24px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--yellow);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.match-header {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 135px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 16px 0 14px;
  border-bottom: 1px solid var(--line);
}

.match-label {
  color: #8a5a08;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-header p {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.5;
}

.rank {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 0;
  color: #8a5a08;
  background: transparent;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.resource-card h3 { margin: 0 0 5px; color: var(--teal); font-size: 1.27rem; }
.resource-category { margin: 0 0 14px; color: var(--orange); font-size: 0.82rem; font-weight: 700; }
.resource-description { margin: 0; color: var(--muted); line-height: 1.6; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.badge { padding: 6px 8px; border-radius: 4px; color: var(--teal); background: #edf2f0; }
.badge.warning { color: #7a3f24; background: var(--orange-soft); }

.resource-action { display: grid; gap: 11px; }
.resource-action .primary-button { min-width: 170px; }
.next-step { margin: 10px 0 0; color: var(--ink); font-size: 0.9rem; line-height: 1.5; }

.result-footer { display: flex; justify-content: center; gap: 12px; margin-top: 30px; }
.empty-state { padding: 30px; border-radius: 18px; background: var(--teal-soft); }

.urgent-note {
  margin: 0 0 20px;
  padding: 16px 18px;
  border-left: 5px solid var(--orange);
  border-radius: 10px;
  color: var(--ink);
  background: var(--orange-soft);
  line-height: 1.55;
}

@media (max-width: 760px) {
  .app-shell { padding: 18px 15px 36px; }
  .topbar { margin-bottom: 28px; }
  .privacy-note { display: none; }
  .panel { padding: 28px 20px; border-radius: 12px; }
  .intro-grid, .results-header { grid-template-columns: 1fr; }
  .intro-card { max-width: 330px; }
  .answers { grid-template-columns: 1fr; }
  .answer-button { min-height: 70px; }
  .resource-card { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 0 18px 18px; }
  .match-header { grid-template-columns: 1fr; gap: 4px; }
  .rank { width: 40px; height: 40px; }
  .resource-action { grid-column: 1 / -1; padding-left: 56px; }
  .resource-action .primary-button { width: 100%; }
  .result-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
