:root {
  --background: #f7f4e9;
  --background-deep: #eee9d9;
  --surface: #ffffff;
  --surface-soft: #fbfaf5;
  --text: #2e2526;
  --muted: #706768;
  --line: #ded8ca;
  --brand: #6c2638;
  --brand-dark: #4f1827;
  --brand-soft: #f4e8eb;
  --olive: #a9bd70;
  --olive-dark: #798c4e;
  --olive-soft: #f0f4e4;
  --danger: #a33b42;
  --danger-soft: #fff2f2;
  --shadow: 0 22px 60px rgba(65, 42, 45, .10);
  --shadow-soft: 0 12px 34px rgba(65, 42, 45, .06);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 5% 0%, rgba(169, 189, 112, .18), transparent 26rem),
    radial-gradient(circle at 100% 25%, rgba(108, 38, 56, .07), transparent 32rem),
    var(--background);
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 108px;
  padding: 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.clinic-logo {
  display: block;
  width: min(315px, 62vw);
  height: auto;
  object-fit: contain;
}

.environment-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(108, 38, 56, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--brand-dark);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 8px 24px rgba(65, 42, 45, .05);
  backdrop-filter: blur(10px);
}

.environment-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--olive-dark);
  box-shadow: 0 0 0 5px rgba(169, 189, 112, .20);
}

.hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 42px;
  align-items: center;
  min-height: 410px;
  padding: clamp(34px, 6vw, 68px);
  border: 1px solid rgba(108, 38, 56, .08);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(130deg, rgba(255,255,255,.92), rgba(247,244,233,.75)),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 9px;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark) 70%, var(--olive));
}

.hero-copy { position: relative; z-index: 2; }

.eyebrow,
.section-kicker {
  display: block;
  color: var(--olive-dark);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.hero-card h1 {
  max-width: 690px;
  margin: 12px 0 18px;
  color: var(--brand-dark);
  font-size: clamp(2.15rem, 5.4vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -.055em;
}

.hero-card p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
}

.hero-card p strong { color: var(--brand-dark); }

.hero-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 700px;
  margin-top: 25px;
  padding: 13px 15px;
  border: 1px solid rgba(169, 189, 112, .48);
  border-radius: 14px;
  background: rgba(240, 244, 228, .72);
  color: #59633e;
  font-size: .82rem;
}

.hero-notice svg {
  flex: 0 0 auto;
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-visual {
  position: relative;
  width: 270px;
  height: 270px;
  justify-self: end;
}

.organic-ring {
  position: absolute;
  inset: 50%;
  border: 3px solid rgba(108, 38, 56, .18);
  border-radius: 57% 43% 62% 38% / 48% 58% 42% 52%;
  transform: translate(-50%, -50%) rotate(-12deg);
}

.ring-one { width: 258px; height: 210px; }
.ring-two { width: 208px; height: 168px; border-color: rgba(169, 189, 112, .48); transform: translate(-50%, -50%) rotate(7deg); }
.ring-three { width: 155px; height: 124px; border-color: rgba(108, 38, 56, .35); transform: translate(-50%, -50%) rotate(-22deg); }

.hero-count {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 112px;
  height: 112px;
  display: grid;
  place-content: center;
  text-align: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--brand);
  color: white;
  box-shadow: 0 18px 38px rgba(108, 38, 56, .24);
}

.hero-count strong { font-size: 2.4rem; line-height: 1; }
.hero-count span { margin-top: 4px; color: rgba(255,255,255,.75); font-size: .72rem; }

.progress-panel {
  position: sticky;
  top: 10px;
  z-index: 20;
  margin: 20px 0;
  padding: 16px 20px;
  border: 1px solid rgba(222, 216, 202, .92);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 12px 34px rgba(65, 42, 45, .08);
  backdrop-filter: blur(14px);
}

.progress-copy {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.progress-copy > div { display: grid; gap: 1px; }
.progress-copy span { color: var(--muted); font-size: .75rem; }
.progress-copy strong { color: var(--brand-dark); font-size: .88rem; }
.progress-percent { color: var(--olive-dark) !important; font-weight: 800; }

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece8de;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #8b3c4f 62%, var(--olive));
  transition: width .28s ease;
}

.form-card {
  margin-bottom: 20px;
  padding: clamp(23px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 17px;
  margin-bottom: 28px;
}

.section-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: .76rem;
  font-weight: 800;
}

.section-heading h2 {
  margin: 3px 0 4px;
  color: var(--brand-dark);
  font-size: 1.45rem;
  letter-spacing: -.03em;
}

.section-heading p { margin: 0; color: var(--muted); font-size: .91rem; }
.section-kicker { margin-bottom: 1px; font-size: .65rem; }

.field-grid {
  display: grid;
  grid-template-columns: 1.55fr .55fr 1fr 1fr;
  gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { color: #493d3f; font-size: .82rem; font-weight: 700; }
em { color: var(--danger); font-style: normal; }

input[type="text"],
input[type="number"],
select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #d4cfc3;
  border-radius: var(--radius-sm);
  outline: 0;
  background: #fff;
  color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:hover,
select:hover { border-color: #bfb5a4; }

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(108, 38, 56, .10);
}

.field-error { display: none; color: var(--danger); font-size: .74rem; }
.field.invalid input,
.field.invalid select { border-color: var(--danger); background: #fffafa; }
.field.invalid .field-error,
.privacy-card.invalid .consent-error { display: block; }

.scale-legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
  padding: 13px;
  border: 1px solid #ebe6da;
  border-radius: 15px;
  background: var(--surface-soft);
}

.scale-legend > span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: .76rem;
}

.scale-legend b {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: white;
  color: var(--brand-dark);
  box-shadow: 0 4px 12px rgba(65, 42, 45, .07);
}

.questions-list { display: grid; gap: 13px; }

.question-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: white;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.question-card:hover {
  border-color: #c9bea9;
  box-shadow: 0 10px 26px rgba(65, 42, 45, .055);
}

.question-card.answered {
  border-color: rgba(169, 189, 112, .82);
  background: linear-gradient(90deg, rgba(240, 244, 228, .72), #fff 28%);
}

.question-card.invalid {
  border-color: #d18b90;
  box-shadow: 0 0 0 3px rgba(163, 59, 66, .08);
}

.question-title {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 0 0 15px;
  color: #423638;
  font-size: .94rem;
  font-weight: 700;
}

.question-index {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: .72rem;
  font-weight: 800;
}

.answer-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.answer-option { position: relative; cursor: pointer; }
.answer-option input { position: absolute; opacity: 0; pointer-events: none; }

.answer-option span {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid #dbd5c9;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-size: .76rem;
  font-weight: 600;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.answer-option span::before {
  content: "";
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border: 2px solid #aaa092;
  border-radius: 50%;
  background: white;
}

.answer-option:hover span { border-color: #b9ab98; transform: translateY(-1px); }
.answer-option input:focus-visible + span { outline: 3px solid rgba(108, 38, 56, .14); outline-offset: 2px; }
.answer-option input:checked + span { border-color: var(--brand); background: var(--olive-soft); color: var(--brand-dark); font-weight: 800; }
.answer-option input:checked + span::before { border-color: var(--brand); box-shadow: inset 0 0 0 3px white; background: var(--brand); }

.question-error { display: none; margin: 10px 0 0 44px; color: var(--danger); font-size: .74rem; }
.question-card.invalid .question-error { display: block; }

.privacy-card { padding-top: 25px; padding-bottom: 25px; }
.consent-line { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; color: var(--muted); font-size: .85rem; }
.consent-line input { flex: 0 0 auto; width: 19px; height: 19px; margin-top: 2px; accent-color: var(--brand); }
.consent-error { margin: 8px 0 0 31px; }

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
}

.form-alert {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #d99a9f;
  border-radius: 13px;
  background: var(--danger-soft);
  color: #873138;
  font-size: .86rem;
}

.submit-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 4px 44px;
}

.submit-note { display: grid; gap: 2px; color: var(--muted); font-size: .80rem; }
.submit-note strong { color: var(--text); }

.primary-button,
.secondary-button {
  border-radius: 13px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease, background .16s ease;
}

.primary-button {
  min-width: 218px;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  box-shadow: 0 14px 28px rgba(108, 38, 56, .23);
}

.primary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 18px 32px rgba(108, 38, 56, .28); }
.primary-button:disabled { cursor: wait; opacity: .64; transform: none; }

.secondary-button {
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(108, 38, 56, .22);
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.secondary-button:hover { background: #ead8dd; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 30px;
  color: var(--muted);
  font-size: .72rem;
}

.result-dialog {
  position: relative;
  width: min(520px, calc(100% - 28px));
  padding: 36px;
  border: 0;
  border-radius: 25px;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(52, 27, 33, .30);
  text-align: center;
}

.result-dialog::backdrop { background: rgba(43, 24, 29, .62); backdrop-filter: blur(6px); }
.result-dialog h2 { margin: 4px 0 9px; color: var(--brand-dark); letter-spacing: -.035em; }
.result-dialog > p { margin: 0 0 22px; color: var(--muted); }

.dialog-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}
.dialog-close:hover { background: var(--surface-soft); color: var(--brand-dark); }

.success-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--olive-soft);
  color: var(--olive-dark);
  font-size: 1.7rem;
  font-weight: 900;
}

.validation-score {
  margin: 22px 0;
  padding: 21px;
  border: 1px solid #ebe4d5;
  border-radius: 18px;
  background: var(--surface-soft);
}

.validation-score > span,
.validation-score > small { display: block; color: var(--muted); font-size: .73rem; }
.validation-score > strong { display: block; margin: 6px 0; color: var(--brand); font-size: 3.2rem; line-height: 1; }

.subscore-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 17px; }
.subscore-grid div { padding: 11px 6px; border-radius: 11px; background: white; box-shadow: 0 5px 14px rgba(65,42,45,.04); }
.subscore-grid span { display: block; color: var(--muted); font-size: .64rem; }
.subscore-grid b { color: var(--brand-dark); font-size: 1.12rem; }
.score-disclaimer { margin: 14px 0 0 !important; color: var(--muted); font-size: .69rem; }

@media (max-width: 900px) {
  .hero-card { grid-template-columns: minmax(0, 1fr) 210px; }
  .hero-visual { width: 205px; height: 205px; }
  .ring-one { width: 205px; height: 168px; }
  .ring-two { width: 162px; height: 132px; }
  .ring-three { width: 120px; height: 97px; }
  .hero-count { width: 94px; height: 94px; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field-wide { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .page-shell { width: min(100% - 20px, 1120px); }
  .topbar { min-height: 84px; padding: 14px 2px; }
  .clinic-logo { width: min(255px, 68vw); }
  .environment-badge { display: none; }
  .hero-card { grid-template-columns: 1fr; min-height: auto; padding: 32px 25px 39px; border-radius: 23px; }
  .hero-card h1 { font-size: clamp(2rem, 10vw, 3rem); }
  .hero-visual { display: none; }
  .progress-panel { top: 6px; margin: 12px 0; padding: 14px 16px; }
  .form-card { border-radius: 19px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .scale-legend { grid-template-columns: 1fr 1fr; }
  .answer-options { grid-template-columns: 1fr 1fr; }
  .submit-area { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  footer { flex-direction: column; }
}

@media (max-width: 430px) {
  .clinic-logo { width: 235px; }
  .hero-notice { font-size: .76rem; }
  .section-heading { gap: 11px; }
  .section-number { width: 41px; height: 41px; }
  .question-card { padding: 16px; }
  .answer-options { grid-template-columns: 1fr; }
  .answer-option span { justify-content: flex-start; padding-left: 15px; }
  .scale-legend { grid-template-columns: 1fr; }
  .subscore-grid { grid-template-columns: 1fr; }
  .result-dialog { padding: 32px 22px; }
}

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