:root {
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f8fbff;
  --card: #ffffff;
  --accent: #1bc47d;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 20px 60px rgba(17, 24, 39, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 20%, #ecfdf3, #f8fbff 30%),
    radial-gradient(circle at 80% 0%, #e6f7ff, #f8fbff 30%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

main {
  width: min(1100px, 95vw);
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 48px;
}

.topbar {
  width: min(1100px, 95vw);
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
}

.logo-title {
  display: block;
  font-size: 15px;
  line-height: 1.05;
}

.logo-subtitle {
  display: block;
  color: var(--accent);
  font-size: 15px;
  line-height: 1.05;
}

.badge {
  background: #e8f9f2;
  color: var(--accent);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}

.hero {
  text-align: center;
  padding: 12px 8px 8px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 12px;
  line-height: 1.1;
}

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

.subhead {
  margin: 0 auto;
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.cta-wrapper {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 600;
}

.flow-card {
  background: var(--card);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
}

.step {
  text-align: center;
}

.flow-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.progress {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.progress-line {
  height: 2px;
  background: #e5e7eb;
}

.progress-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  position: relative;
  padding-left: 26px;
}

.progress-dot::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  position: absolute;
  left: 0;
}

.progress-dot.active {
  color: var(--accent);
}

.progress-dot.active::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 196, 125, 0.15);
}

.progress-dot.done::before {
  background: var(--accent);
  border-color: var(--accent);
}

.step h2 {
  text-align: center;
  margin: 0 0 18px;
  font-size: 24px;
}

.step.hidden {
  display: none;
}

.step {
  text-align: center;
}

.age-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  max-width: 860px;
  margin: 0 auto;
}

.age-btn {
  border: 1px solid var(--border);
  background: #fdfefe;
  border-radius: 12px;
  padding: 16px 14px;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border 0.1s ease;
}

.age-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(27, 196, 125, 0.15);
  border-color: #b9ebd4;
}

.helper {
  text-align: center;
  color: var(--muted);
  margin-top: 12px;
}

.age-status {
  margin-top: 10px;
  text-align: center;
  color: #dc2626;
  font-weight: 700;
  min-height: 18px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  justify-items: stretch;
  max-width: 860px;
  margin: 0 auto;
}

.two-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.year-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.choice-btn {
  border: 1px solid var(--border);
  background: #fdfefe;
  border-radius: 14px;
  padding: 16px 14px;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border 0.1s ease;
}

.choice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(27, 196, 125, 0.15);
  border-color: #b9ebd4;
}

.choice-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 196, 125, 0.2);
  background: #f2fbf7;
}

.logo-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  max-width: 980px;
  margin: 0 auto;
}

.logo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border 0.1s ease;
}

.logo-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(27, 196, 125, 0.12);
  border-color: #b9ebd4;
}

.logo-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 196, 125, 0.2);
  background: #f6fffb;
}

.logo-card img {
  max-width: 120px;
  max-height: 60px;
  object-fit: contain;
}

.logo-card span {
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 14px auto 8px;
  max-width: 760px;
}

.chip {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #fdfefe;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border 0.1s ease;
}

.chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(27, 196, 125, 0.12);
  border-color: #b9ebd4;
}

.chip.active {
  border-color: var(--accent);
  background: #f2fbf7;
  box-shadow: 0 0 0 3px rgba(27, 196, 125, 0.18);
}

.next-needs {
  margin-top: 8px;
  width: 100%;
}

.needs-status {
  min-height: 18px;
  color: #dc2626;
  text-align: center;
  font-weight: 700;
  margin-top: 6px;
}

.cta-next {
  margin-top: 12px;
  width: 100%;
  border: none;
  background: #16b978;
  color: #fff;
  font-weight: 800;
  padding: 16px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 10px 28px rgba(22, 185, 120, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.cta-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(22, 185, 120, 0.4);
}

.cta-next:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.loader {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.loader .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 0.8s infinite alternate;
}

.loader .dot:nth-child(2) {
  animation-delay: 0.1s;
}

.loader .dot:nth-child(3) {
  animation-delay: 0.2s;
}

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

.form-header .pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e8f9f2;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}

.form-header h3 {
  margin: 0;
  font-size: 24px;
}

.form-header p {
  margin: 8px 0 18px;
  color: #374151;
}

.senior-note {
  font-size: 17px;
  color: #1f2937;
  font-weight: 600;
}

.back-btn {
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 700;
  padding: 6px 0;
  cursor: pointer;
  margin-bottom: 6px;
  font-size: 14px;
}

#lead-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}

.field input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-size: 17px;
  transition: border 0.1s ease, box-shadow 0.1s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 196, 125, 0.2);
}

.field-readonly input {
  background: #f9fafb;
  color: var(--muted);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.notice {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.offer-btn {
  border: none;
  background: linear-gradient(90deg, #6c5ce7, #7f6bff);
  color: #fff;
  font-weight: 800;
  padding: 18px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 12px 32px rgba(108, 92, 231, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.offer-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 42px rgba(108, 92, 231, 0.45);
}

.offer-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.status {
  min-height: 18px;
  font-size: 14px;
  color: var(--muted);
}

.status.error {
  color: #dc2626;
}

.status.success {
  color: #16a34a;
  font-weight: 700;
}

.footer {
  text-align: center;
  padding: 22px 12px 32px;
  color: var(--muted);
  font-size: 14px;
  background: transparent;
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 768px) {
  main {
    margin-top: 20px;
    width: 100%;
    padding-inline: 12px;
  }

  .flow-card {
    padding: 16px;
    border-radius: 14px;
    width: 100%;
    max-width: 100%;
  }

  .topbar {
    margin-top: 12px;
    padding-inline: 12px;
    flex-wrap: wrap;
    gap: 10px;
  }

  h1 {
    font-size: clamp(24px, 6vw, 32px);
    line-height: 1.15;
  }

  .flow-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .progress {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 8px;
  }

  .progress-dot {
    font-size: 13px;
  }

  .form-header h3 {
    font-size: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }

  .form-narrow {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }

  .hero {
    padding: 8px 6px 0;
  }

  .subhead {
    font-size: 15px;
    line-height: 1.45;
    padding-inline: 4px;
  }

  .age-btn,
  .choice-btn,
  .chip {
    font-size: 16px;
  }
}

@media (max-width: 540px) {
  body {
    background: var(--bg);
  }

  .flow-top {
    width: 100%;
  }

  .progress {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .progress-line {
    flex: 1;
    height: 2px;
  }

  .progress-dot {
    padding-left: 22px;
    font-size: 13px;
  }

  .age-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }

  .age-btn {
    font-size: 17px;
    padding: 14px;
  }

  .choice-grid,
  .logo-grid,
  .chips-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .chip,
  .choice-btn,
  .logo-card {
    font-size: 17px;
    padding: 14px;
  }

  .cta-next,
  .offer-btn {
    width: 100%;
  }
}

