:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #151515;
  --muted: #676767;
  --border: #ded8cd;
  --primary: #16342f;
  --primary-soft: #e8f0ed;
  --gold: #c69a3d;
  --gold-soft: #fff4d9;
  --success: #1f7a4d;
  --warning: #a45f00;
  --danger: #a83f3f;
  --shadow: 0 18px 48px rgba(20, 30, 27, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 5vw, 48px);
  border-bottom: 1px solid var(--border);
  background: rgba(246, 244, 239, 0.9);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.logo {
  display: grid;
  width: 50px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 900;
  letter-spacing: 0;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.hero-grid,
.result-grid,
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(330px, 0.96fr);
  gap: 32px;
  align-items: start;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

h3 {
  font-size: 17px;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.muted {
  color: var(--muted);
}

.card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow);
}

.intake {
  position: relative;
}

.card-head {
  margin: -8px -8px 18px;
  border-radius: 20px;
  background: var(--primary);
  color: white;
  padding: 22px;
}

.card-head span,
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(22, 52, 47, 0.18);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 800;
}

.card-head span {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.metric-grid,
.three-col,
.test-grid,
.score-card-grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.test-grid,
.score-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-card,
.score-card,
.test-button,
.stage,
.question {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.mini-card strong,
.test-button strong {
  display: block;
  margin-bottom: 6px;
}

.mini-card span,
.test-button span,
.stage span {
  color: var(--muted);
  font-size: 13px;
}

.big {
  display: block;
  margin: 10px 0;
  color: var(--primary);
  font-size: 38px;
}

.sample-band {
  margin-top: 28px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--primary);
  color: white;
  padding: 22px;
}

.sample-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.sample-metrics b {
  display: block;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  padding: 14px;
  text-align: center;
  font-size: 24px;
}

.sample-metrics small {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 500;
}

.segmented {
  display: flex;
  gap: 4px;
  margin: 18px 0;
  border-radius: 14px;
  background: #eee9df;
  padding: 4px;
}

.segmented button {
  flex: 1;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 11px;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  background: white;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.dropzone {
  display: grid;
  min-height: 160px;
  place-items: center;
  border: 1px dashed rgba(22, 52, 47, 0.35);
  border-radius: 20px;
  background: rgba(22, 52, 47, 0.05);
  padding: 24px;
  text-align: center;
}

.dropzone span {
  color: var(--muted);
  font-size: 13px;
}

.textarea,
input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffdf9;
  color: var(--text);
  outline: none;
  padding: 14px 16px;
}

.textarea {
  min-height: 210px;
  resize: vertical;
}

.textarea.small {
  min-height: 92px;
}

.textarea:focus,
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 52, 47, 0.1);
}

.hidden {
  display: none;
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.primary,
.gold,
.ghost,
.ghost-light {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 900;
}

.primary {
  background: var(--primary);
  color: white;
}

.gold {
  background: var(--gold);
  color: var(--primary);
}

.ghost {
  border-color: var(--border);
  background: var(--card);
  color: var(--text);
}

.ghost-light {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.full {
  width: 100%;
  margin-top: 12px;
}

.privacy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.status {
  margin-top: 12px;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.status.ok {
  border: 1px solid rgba(31, 122, 77, 0.3);
  background: rgba(31, 122, 77, 0.1);
  color: var(--success);
}

.status.warn {
  border: 1px solid rgba(164, 95, 0, 0.3);
  background: rgba(164, 95, 0, 0.1);
  color: var(--warning);
}

.status.info {
  border: 1px solid rgba(22, 52, 47, 0.25);
  background: var(--primary-soft);
  color: var(--primary);
}

.test-panel {
  margin-top: 30px;
}

.test-button {
  color: inherit;
  text-align: left;
}

.centered {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.stage-list {
  margin-top: 24px;
}

.stage {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  text-align: left;
}

.stage.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.stage.done {
  border-color: rgba(31, 122, 77, 0.3);
}

.progress {
  height: 12px;
  overflow: hidden;
  margin-top: 24px;
  border-radius: 999px;
  background: #e8e1d5;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.25s ease;
}

.notice {
  margin: 18px 0;
  border: 1px solid rgba(22, 52, 47, 0.18);
  border-radius: 16px;
  background: var(--primary-soft);
  padding: 16px;
  color: var(--primary);
  line-height: 1.55;
}

.question {
  margin-top: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips button {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  padding: 9px 12px;
  font-weight: 800;
}

.chips button.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.button-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.score-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: center;
  margin-top: 20px;
}

.gauge {
  display: grid;
  width: 220px;
  height: 220px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--gold) var(--score), #e8e1d5 0deg);
}

.gauge div {
  display: grid;
  width: 158px;
  height: 158px;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  text-align: center;
}

.gauge strong {
  display: block;
  font-size: 48px;
}

.gauge span,
.score-band {
  color: var(--primary);
  font-weight: 900;
}

.confidence {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #5c4100;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.dark-card {
  background: var(--primary);
  color: white;
}

.dark-card p {
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.6;
}

.soft {
  background: var(--primary-soft);
}

.score-card {
  line-height: 1.55;
}

.score-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.score-card-head b {
  color: var(--primary);
  font-size: 30px;
}

ul {
  margin-bottom: 0;
  padding-left: 20px;
  line-height: 1.7;
}

.json {
  max-height: 480px;
  overflow: auto;
  border-radius: 16px;
  background: #111816;
  color: #d5f6e8;
  padding: 18px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.price {
  margin: 24px auto;
  color: var(--primary);
  font-size: 62px;
  font-weight: 900;
}

.price span {
  color: var(--muted);
  font-size: 20px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.summary-line.total {
  border-bottom: 0;
  font-size: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-grid input:first-child,
.form-grid input:nth-child(4),
.form-grid input:nth-child(5) {
  grid-column: 1 / -1;
}

.donut {
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  margin: 28px auto;
  border: 12px solid #e8e1d5;
  border-top-color: var(--gold);
  border-radius: 50%;
  color: var(--primary);
  font-size: 34px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .hero-grid,
  .result-grid,
  .checkout-grid,
  .score-row {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .three-col,
  .test-grid,
  .score-card-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .button-row {
    flex-direction: column;
  }

  .gauge {
    width: 190px;
    height: 190px;
    margin: 0 auto;
  }

  .gauge div {
    width: 134px;
    height: 134px;
  }
}
