:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --border: #e2e2df;
  --text: #1f1f1d;
  --muted: #6b6b66;
  --accent: #2f6f4f;
  --accent-dark: #234f38;
  --error: #b3261e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  padding: 24px 32px 0;
  max-width: 900px;
  margin: 0 auto;
}

.topbar h1 {
  margin: 0 0 16px;
  font-size: 1.5rem;
}

.steps {
  display: flex;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--border);
}

.steps li {
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
}

.steps li.active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

#app {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}

.view { display: none; }
.view.active { display: block; }

.hint { color: var(--muted); margin-top: 0; }
.hint #portal-login-link { color: var(--accent-dark); margin-left: 8px; }

.bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.bundle-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bundle-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
}

.bundle-card h3 { margin: 0; font-size: 1.05rem; }
.bundle-card p { margin: 0; color: var(--muted); font-size: 0.9rem; flex: 1; }

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price { font-weight: 700; font-size: 1.1rem; }
.price-strike { text-decoration: line-through; color: var(--muted); font-size: 0.9rem; }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  background: var(--accent);
  color: #fff;
}

button:hover { background: var(--accent-dark); }
button:disabled { background: #b8b8b3; cursor: not-allowed; }

.link-btn {
  background: none;
  color: var(--accent-dark);
  padding: 4px 0;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.link-btn:hover { text-decoration: underline; background: none; }

.bundle-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.bundle-summary h2 { margin: 0 0 4px; font-size: 1.15rem; }

fieldset {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px 20px;
  margin-bottom: 20px;
}

legend { font-weight: 600; padding: 0 6px; }

.field-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.field-row label { flex: 1; }

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
}

input, select, textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
}

.question-block {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.question-block:last-child { border-bottom: none; }

.question-text {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}
.question-hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }

.options-list { display: flex; flex-direction: column; gap: 6px; }
.options-list label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.statement-text {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.error {
  color: var(--error);
  font-size: 0.9rem;
}

#payment-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px 20px;
}

.stripe-card-element {
  /* The Payment Element renders its own bordered fields, so this just gives it room. */
  min-height: 40px;
}

#pay-btn { margin-top: 16px; }

#confirm-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}
#confirm-content h2 { margin-top: 0; }

.portal-link {
  display: inline-block;
  margin-top: 12px;
  color: #fff;
  background: var(--accent);
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
}
.portal-link:hover { background: var(--accent-dark); }
