:root {
  --ink: #20342e;
  --muted: #66756f;
  --paper: #fbfaf6;
  --cream: #f1eee5;
  --sage: #dce6dc;
  --forest: #315b4d;
  --forest-dark: #24463b;
  --line: #dcded7;
  --error: #9c4b40;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}
button,
input {
  font: inherit;
}
button,
label {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #b07a28;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
h1 {
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  margin-bottom: 1.5rem;
}
h2 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  margin-bottom: 1rem;
}

.landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 3rem 1.2rem;
  background:
    radial-gradient(circle at 8% 5%, #e7ecdf 0, transparent 33%),
    radial-gradient(circle at 96% 92%, #eadfcf 0, transparent 30%), var(--paper);
}
.intro-card {
  width: min(850px, 100%);
  padding: clamp(2rem, 6vw, 5rem);
  border: 1px solid rgba(49, 91, 77, 0.18);
  border-radius: 2rem;
  background: rgba(255, 255, 252, 0.84);
  box-shadow: 0 24px 70px rgba(35, 55, 47, 0.09);
  position: relative;
  overflow: hidden;
}
.intro-card::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border: 1px solid #cbd8cc;
  border-radius: 50%;
  right: -100px;
  top: -90px;
  box-shadow:
    0 0 0 30px rgba(220, 230, 220, 0.35),
    0 0 0 60px rgba(220, 230, 220, 0.18);
  pointer-events: none;
}
.brand-mark {
  width: 3.3rem;
  height: 3.3rem;
  display: grid;
  place-items: center;
  margin-bottom: 3.2rem;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
}
.eyebrow {
  display: block;
  color: var(--forest);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.lead {
  color: #52615b;
  font-size: clamp(1.05rem, 2vw, 1.24rem);
  max-width: 65ch;
}
.intro-meta {
  display: flex;
  gap: clamp(1rem, 4vw, 3rem);
  padding: 1.7rem 0;
  margin: 2.2rem 0;
  border-block: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}
.intro-meta span {
  display: grid;
}
.intro-meta strong {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-weight: 500;
}
.notice {
  padding: 1.2rem 1.35rem;
  margin: 1.5rem 0;
  border-left: 3px solid #b38945;
  border-radius: 0 0.8rem 0.8rem 0;
  background: #f7f1e6;
  color: #5a554b;
}
.notice p:last-child {
  margin-bottom: 0;
}
.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: #40534b;
  cursor: pointer;
}
.consent input {
  appearance: none;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
  border: 1.5px solid #82918a;
  border-radius: 0.3rem;
  background: white;
  margin-top: 0.15rem;
  display: grid;
  place-items: center;
}
.consent input:checked {
  background: var(--forest);
  border-color: var(--forest);
}
.consent input:checked::after {
  content: "✓";
  color: white;
  line-height: 1;
  font-weight: bold;
}
.start-consent {
  margin: 2rem 0;
}
.button {
  min-height: 3rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.35rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    opacity 0.15s ease;
}
.button:hover:not(:disabled) {
  transform: translateY(-1px);
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.button.primary {
  color: white;
  background: var(--forest);
}
.button.primary:hover:not(:disabled) {
  background: var(--forest-dark);
}
.button.secondary {
  background: #e9eee9;
  color: var(--forest-dark);
}
.button.text-button {
  min-height: auto;
  padding: 0.5rem;
  border-radius: 0.35rem;
  color: #77584e;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.button.large {
  padding: 1rem 1.65rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.privacy-note {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.privacy-note span {
  color: #66846f;
  font-size: 0.6rem;
}

.questionnaire-page {
  min-height: 100vh;
}
.progress-shell {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1.2rem max(1.2rem, calc((100vw - 980px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(12px);
}
.progress-copy {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}
.progress-copy h1 {
  font-size: clamp(1.55rem, 4vw, 2.5rem);
  margin: 0;
}
.progress-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.progress-track {
  height: 5px;
  margin-top: 1.1rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e5df;
}
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #76917a, var(--forest));
  transition: width 0.3s ease;
}
.questionnaire-content {
  width: min(980px, calc(100% - 2.4rem));
  margin: 0 auto;
  padding: 3rem 0 6rem;
}
.category-intro {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  align-items: center;
  margin-bottom: 2rem;
}
.category-intro > span {
  width: 3.1rem;
  height: 3.1rem;
  display: grid;
  place-items: center;
  border: 1px solid #b9c8ba;
  border-radius: 50%;
  color: var(--forest);
  font-family: Georgia, serif;
}
.category-intro p {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.03rem;
}
.questions {
  display: grid;
  gap: 1rem;
}
.question-card {
  min-width: 0;
  margin: 0;
  padding: 1.45rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.72);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.question-card:focus-within {
  border-color: #91a493;
  box-shadow: 0 8px 28px rgba(49, 91, 77, 0.06);
}
.question-card.invalid {
  border-color: #bb7469;
}
.question-card legend {
  float: left;
  width: 100%;
  margin-bottom: 1.1rem;
  font-family: Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.45;
}
.question-card legend + * {
  clear: both;
}
.question-card legend > span {
  color: #8b9993;
  font-family: Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-right: 0.65rem;
}
.answer-scale {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.45rem;
}
.answer-option {
  min-width: 0;
  min-height: 5.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.55rem 0.25rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #f9f9f6;
  color: var(--muted);
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.25;
  cursor: pointer;
}
.answer-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.answer-number {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 1.2rem;
}
.answer-option:hover {
  border-color: #96a99b;
  background: #f0f4ef;
}
.answer-option.selected {
  border-color: var(--forest);
  background: var(--forest);
  color: #e8f0ea;
  box-shadow: 0 5px 13px rgba(49, 91, 77, 0.16);
}
.answer-option.selected .answer-number {
  color: white;
}
.answer-option:has(input:focus-visible) {
  outline: 3px solid #b07a28;
  outline-offset: 2px;
}
.field-error {
  color: var(--error);
  font-size: 0.86rem;
  font-weight: 700;
}
.validation-summary {
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  border-radius: 0.7rem;
  background: #f6e6e2;
  color: #783c33;
}
.form-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0;
}
.local-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--line);
}

.result-page {
  width: min(1080px, calc(100% - 2.4rem));
  margin: 0 auto;
  padding: 5rem 0;
}
.result-hero {
  display: grid;
  grid-template-columns: 210px 1fr;
  align-items: center;
  column-gap: clamp(2rem, 6vw, 6rem);
  padding-bottom: 4rem;
}
.result-hero > .eyebrow,
.result-hero > .notice {
  grid-column: 1 / -1;
}
.result-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  margin-bottom: 1.2rem;
}
.score-orb {
  width: 200px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  border-radius: 50%;
  color: #26372f;
  background: #dbe6db;
  text-align: center;
  box-shadow: inset 0 0 0 12px rgba(255, 255, 255, 0.4);
}
.score-orb strong {
  font-family: Georgia, serif;
  font-size: 3.4rem;
  line-height: 1;
}
.score-orb small {
  font-size: 1.3rem;
}
.score-orb span {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.level-low {
  background-color: #7ea889 !important;
}
.level-mild {
  background-color: #b6c979 !important;
}
.level-moderate {
  background-color: #d7b85e !important;
}
.level-high {
  background-color: #d89159 !important;
}
.level-very-high {
  background-color: #b96f63 !important;
}
.chart-panel,
.details-panel,
.email-panel,
.result-panel,
.safety-note {
  padding: clamp(1.4rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: #fff;
}
.chart-panel,
.details-panel,
.email-panel,
.safety-note {
  margin-bottom: 1.5rem;
}
.chart-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 2rem;
}
.chart-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) minmax(180px, 3fr) 3rem;
  gap: 1rem;
  align-items: center;
  font-size: 0.88rem;
}
.chart-row strong {
  text-align: right;
}
.bar {
  height: 0.7rem;
  border-radius: 999px;
  background: #e9e9e3;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.resource-panel {
  background: #f2f6ef;
}
.area-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.area-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
.small-copy {
  color: var(--muted);
  font-size: 0.82rem;
}
.category-result {
  border-top: 1px solid var(--line);
}
.category-result:last-child {
  border-bottom: 1px solid var(--line);
}
.category-result summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0.2rem;
  cursor: pointer;
  list-style: none;
}
.category-result summary::-webkit-details-marker {
  display: none;
}
.category-result summary span:first-child {
  display: grid;
}
.category-result summary small {
  color: var(--muted);
  font-weight: 400;
}
.category-result summary > span:last-child {
  font-family: Georgia, serif;
  font-size: 1.25rem;
}
.category-result-body {
  padding: 0 0.2rem 1.2rem;
}
.category-result-body p {
  margin: 1rem 0 0;
  color: var(--muted);
}
.safety-note {
  border-color: #d7b7a3;
  background: #f7ede7;
}
.safety-note h2 {
  font-size: 1.7rem;
}
.email-panel {
  background: #edf2ed;
}
.email-panel form {
  margin-top: 1.5rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1rem;
}
.form-row label {
  font-size: 0.86rem;
  font-weight: 700;
}
.form-row label span {
  color: var(--muted);
  font-weight: 400;
}
.form-row input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  margin: 0.35rem 0 1rem;
  border: 1px solid #bdc7bf;
  border-radius: 0.65rem;
  background: white;
}
.email-panel .consent {
  margin: 1rem 0 1.3rem;
}
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.83rem;
}
.result-footer div {
  display: flex;
  gap: 0.7rem;
}

@media (max-width: 720px) {
  .intro-card {
    border-radius: 1.2rem;
  }
  .intro-meta {
    justify-content: space-between;
  }
  .progress-copy {
    align-items: start;
    flex-direction: column;
    gap: 0.6rem;
  }
  .answer-scale {
    grid-template-columns: 1fr;
  }
  .answer-option {
    min-height: 3rem;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    text-align: left;
    font-size: 0.8rem;
  }
  .answer-number {
    width: 1.4rem;
    text-align: center;
  }
  .local-actions,
  .result-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .result-hero {
    grid-template-columns: 1fr;
  }
  .score-orb {
    width: 160px;
    margin-bottom: 2rem;
  }
  .result-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
  .email-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .email-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .chart-row {
    grid-template-columns: 1fr auto;
    gap: 0.35rem 1rem;
  }
  .chart-row .bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .result-footer div {
    flex-direction: column;
    width: 100%;
  }
}

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

@media print {
  body {
    background: white;
  }
  .result-page {
    width: 100%;
    padding: 0;
  }
  .email-panel,
  .result-footer .button,
  .details-panel .eyebrow {
    display: none !important;
  }
  .result-hero,
  .result-grid {
    break-inside: avoid;
  }
  .category-result {
    break-inside: avoid;
  }
  .category-result > div {
    display: block !important;
  }
  .chart-panel,
  .details-panel,
  .result-panel {
    box-shadow: none;
  }
}

[hidden] { display: none !important; }
.flash-message { width: min(980px, calc(100% - 2.4rem)); margin: 1.5rem auto -1.5rem; padding: 1rem 1.2rem; border-radius: .7rem; background: #f6e6e2; color: #783c33; }
@media print { .result-footer, .button, .privacy-note { display: none !important; } .result-page { width: 100%; padding: 1rem 0; } }

