/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:           #f0f4f8;
  --card:         #ffffff;
  --primary:      #1d4ed8;
  --primary-dark: #1e40af;
  --text:         #1e293b;
  --muted:        #64748b;
  --border:       #cbd5e1;
  --radius:       10px;
  --shadow:       0 2px 12px rgba(0,0,0,.08);
}

/* ── Reset / Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────── */
header {
  background: #0f172a;
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ── Nav ────────────────────────────────────────────────── */
nav {
  background: #1e293b;
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

nav a {
  color: #94a3b8;
  text-decoration: none;
  padding: .7rem 1.1rem;
  font-size: .88rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

nav a:hover,
nav a.active {
  color: #fff;
  border-bottom-color: var(--primary);
}

/* ── Main / Card ─────────────────────────────────────────── */
main {
  flex: 1;
  padding: 1.25rem 1rem 2rem;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem;
}

.card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* ── Form elements ───────────────────────────────────────── */
.field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: .3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  width: 100%;
  padding: .75rem .9rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.15);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.5rem;
}

/* ── Button ──────────────────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  padding: .9rem;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 1.25rem;
  transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover  { background: var(--primary-dark); }
.btn:active { transform: scale(.98); }

/* ── Result box ──────────────────────────────────────────── */
.result {
  margin-top: 1rem;
  padding: .85rem 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: .95rem;
  color: var(--primary-dark);
  display: none;
}

/* ── Error box ───────────────────────────────────────────── */
.error {
  margin-top: 1rem;
  padding: .85rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: .95rem;
  color: #dc2626;
  display: none;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  background: #0f172a;
  color: #475569;
  text-align: center;
  font-size: .78rem;
  padding: 1rem;
}

/* ── Secondary / outline button ─────────────────────────── */
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover  { background: var(--primary); color: #fff; }
.btn-outline:active { transform: scale(.98); }

.btn-danger { background: #dc2626; }
.btn-danger:hover  { background: #b91c1c; }
.btn-danger:active { transform: scale(.98); }

/* ── Contact card ────────────────────────────────────────── */
.contact-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .85rem 1rem;
  margin-top: .75rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.contact-card p { font-size: .95rem; margin: 0; }
.contact-card a  { color: var(--primary); word-break: break-all; }

/* ── Calc summary bar (collapsed Step 1) ────────────────── */
.calc-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem .8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .88rem;
  margin-bottom: .6rem;
}
.calc-summary-bar a {
  color: var(--primary);
  font-size: .8rem;
  text-decoration: none;
  margin-left: .75rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.calc-summary-bar a:hover { text-decoration: underline; }

/* ── Step label ──────────────────────────────────────────── */
.step-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .75rem;
}

/* ── Slot pill list ──────────────────────────────────────── */
.slot-note {
  font-size: .82rem;
  color: var(--muted);
  margin-top: .25rem;
}

/* ── Dynamic form sections ───────────────────────────────── */
.form-section { display: none; }
.form-section.visible { display: block; }

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* ── Success box ─────────────────────────────────────────── */
.success {
  padding: 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  color: #166534;
  font-size: .95rem;
  margin-bottom: 1.25rem;
}

/* ── Desktop bump-up ─────────────────────────────────────── */
@media (min-width: 600px) {
  main { padding: 2rem 1rem 3rem; }
  .card { padding: 2rem; }
  header h1 { font-size: 1.25rem; }
}
