@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@500;650;700&family=Source+Sans+3:wght@400;600&display=swap");

:root {
  --bg: #f4f1ec;
  --card: #ffffff;
  --ink: #1a1e1f;
  --muted: #5d6466;
  --accent: #0f6b5f;
  --accent-dark: #0b534a;
  --accent-soft: #e0f1ee;
  --border: #e1e1e1;
  --warning: #b1412c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at top, #ffffff 0%, #f4f1ec 45%, #e5ecea 100%);
  color: var(--ink);
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(320px, 560px);
  gap: 48px;
  padding: 48px clamp(24px, 6vw, 80px);
  align-items: start;
}

.hero {
  position: sticky;
  top: 32px;
  padding: 32px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(15, 107, 95, 0.12), rgba(15, 107, 95, 0.02));
  border: 1px solid rgba(15, 107, 95, 0.18);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--accent-dark);
  margin: 0 0 16px;
  font-weight: 600;
}

h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(2.2rem, 3vw, 3rem);
  margin: 0 0 16px;
}

.subhead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.hero-points li {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 107, 95, 0.12);
  font-weight: 600;
}

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(16, 33, 30, 0.12);
  border: 1px solid rgba(15, 107, 95, 0.1);
}

.progress {
  margin-bottom: 24px;
}

.progress-label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9eeec;
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  width: 33.33%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #49b0a3);
  transition: width 0.3s ease;
}

.step {
  display: none;
  animation: fadeIn 0.4s ease;
}

.step.active {
  display: block;
}

.step h2 {
  font-family: "Fraunces", "Times New Roman", serif;
  margin-top: 0;
  margin-bottom: 6px;
}

.step-note {
  margin-top: 0;
  margin-bottom: 24px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

label {
  font-weight: 600;
}

input,
select,
textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 107, 95, 0.15);
}

.radio-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radio-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fafafa;
  cursor: pointer;
  font-weight: 600;
}

.radio-pill input,
.chip input {
  accent-color: var(--accent);
}

.needs-grid {
  display: grid;
  gap: 16px;
}

.need-panel {
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(15, 107, 95, 0.15);
  background: #fbfdfc;
}

.need-panel h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.calc-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(15, 107, 95, 0.2);
}

.calc-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.calc-value {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 6px;
}

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

button {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: transform 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(15, 107, 95, 0.35);
}

button.ghost:hover {
  background: rgba(15, 107, 95, 0.08);
}

.consent {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f7f9f8;
  border: 1px solid var(--border);
  margin-top: 12px;
}

.success,
.error {
  margin-top: 24px;
  padding: 18px;
  border-radius: 16px;
}

.success {
  background: #e3f4f1;
  border: 1px solid #b5ded8;
}

.error {
  background: #fdecea;
  border: 1px solid #f2b8b3;
  color: var(--warning);
}

.loading {
  position: fixed;
  inset: 0;
  background: rgba(17, 21, 22, 0.45);
  display: grid;
  place-items: center;
  z-index: 100;
}

.hidden {
  display: none;
}

.loading.hidden {
  display: none;
}

.loading-card {
  background: #ffffff;
  padding: 28px 32px;
  border-radius: 20px;
  text-align: center;
  width: min(360px, 90vw);
  box-shadow: 0 20px 60px rgba(16, 33, 30, 0.25);
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid #d7e5e2;
  border-top-color: var(--accent);
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .page {
    grid-template-columns: 1fr;
  }

  .hero {
    position: static;
  }
}
