* { box-sizing: border-box; }

body {
  background: var(--mtw-paper);
  margin: 0;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--mtw-navy);
  padding: 20px 0;
  margin-bottom: 4px;
}
.site-header .wrap {
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header img {
  height: 40px;
  width: auto;
  object-fit: contain;
}
.site-header .header-meta {
  text-align: right;
  color: var(--mtw-sky);
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.intro {
  border-bottom: 3px solid var(--mtw-lime);
  padding: 28px 0 22px;
  margin-bottom: 28px;
}
.intro h1 { margin: 6px 0 10px; font-size: clamp(30px, 4vw, 44px); }
.intro p { margin: 0; color: var(--fg-2); }

/* ---------- Layout ---------- */
/* Grid areas (not `order`) so the summary total can sit between the two
   halves of the left column on mobile/tablet — after children's selections,
   before parent info — while still spanning both as a sticky sidebar on
   desktop. `order` can't do this: it only reorders whole grid items, and
   there'd be nothing to stop a later same-specificity rule from re-winning
   the cascade (see the sticky/position bug this replaced). */
.builder-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-areas:
    "top    summary"
    "bottom summary";
  gap: 28px;
  align-items: start;
}
.steps-col--top { grid-area: top; }
.summary-col { grid-area: summary; }
.steps-col--bottom { grid-area: bottom; }

@media (max-width: 860px) {
  .builder-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "top" "summary" "bottom";
  }
}

/* ---------- Step cards ---------- */
.step-card {
  background: var(--bg-1);
  border: 2px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.step-card.is-disabled { opacity: 0.55; }

.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.step-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--mtw-lime); color: var(--mtw-navy);
  font-family: var(--font-display); font-weight: 900; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-head h3 { margin: 0; font-size: 18px; }
.step-eyebrow {
  font-family: var(--font-display); font-weight: 800; font-size: 11px;
  letter-spacing: 0.1em; color: var(--mtw-stone-400); text-transform: uppercase;
}
.step-badge {
  margin-left: auto;
  font-family: var(--font-display); font-weight: 800; font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase; color: white;
  background: var(--mtw-navy); padding: 4px 10px; border-radius: var(--radius-pill);
}
.step-badge--optional { color: var(--mtw-navy); background: var(--mtw-sky); }
.step-desc { color: var(--fg-2); font-size: 13.5px; margin: 6px 0 16px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.switch {
  position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--mtw-stone-200); border-radius: var(--radius-pill);
  transition: background var(--dur-med) var(--ease-out);
}
.switch .track::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: white; border-radius: 50%; transition: transform var(--dur-med) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .track { background: var(--mtw-blue); }
.switch input:checked + .track::before { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: var(--shadow-focus); }

/* ---------- Option tiles (age group / frequency / days) ---------- */
.tile-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 6px;
}
.tile-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) {
  .tile-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
.tile {
  position: relative;
  border: 2px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  background: var(--bg-1);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tile .tile-label {
  font-family: var(--font-display); font-weight: 800; font-size: 12.5px;
  color: var(--mtw-navy); text-transform: uppercase; display: block;
}
.tile .tile-price {
  font-size: 14px; font-weight: 700; color: var(--fg-2); margin-top: 2px; display: block;
}
.tile .tile-time {
  font-size: 11px; font-weight: 600; color: var(--fg-3); margin-top: 3px; display: block;
}
.tile:hover { border-color: var(--mtw-blue-80); }
.tile.is-selected {
  border-color: var(--mtw-blue);
  background: var(--mtw-blue-10);
}
.tile.is-selected .tile-price { color: var(--mtw-blue); }
.tile.is-locked { cursor: not-allowed; opacity: 0.5; }
.tile.is-locked input { cursor: not-allowed; }

.addon-note {
  font-size: 12px; color: var(--fg-3); margin: 10px 0 0; line-height: 1.4;
}
.addon-note strong { color: var(--fg-2); }

.days-cap-note {
  font-size: 12px; color: var(--mtw-blue); margin: 8px 0 0; font-weight: 600;
}

/* ---------- Form fields ---------- */
.field-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}
.field-grid--1 { grid-template-columns: 1fr; }
@media (max-width: 560px) {
  .field-grid { grid-template-columns: 1fr; }
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 12.5px; font-weight: 700; color: var(--fg-2);
  letter-spacing: 0.02em;
}
.field label .req { color: var(--danger); }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"],
.field textarea {
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 10px 12px;
  border: 2px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  color: var(--fg-1);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.field input:focus, .field textarea:focus {
  border-color: var(--mtw-blue);
  box-shadow: var(--shadow-focus);
}
.field input.is-invalid, .field textarea.is-invalid {
  border-color: var(--danger);
}
.field .hint { font-size: 11.5px; color: var(--fg-3); }
.field textarea { resize: vertical; min-height: 64px; }

.checkline {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--fg-2); line-height: 1.45;
  margin-top: 4px;
}
.checkline input { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--mtw-blue); }
.checkline.is-invalid { color: var(--danger); }

/* ---------- Summary panel ---------- */
/* Sticky sidebar only makes sense in the desktop two-column layout. This
   override must stay BELOW this rule in source order (equal specificity —
   the later declaration wins once the media query matches), or the sticky
   rule above wins and the total floats over the form fields on mobile. */
.summary-col { position: sticky; top: 20px; }
@media (max-width: 860px) {
  .summary-col { position: static; }
}
.summary-card {
  background: var(--mtw-navy);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: white;
  box-shadow: var(--shadow-lg);
}
.summary-card h3 { color: white; margin: 0 0 4px; font-size: 16px; }
.summary-card .summary-sub { color: var(--mtw-sky); font-size: 12px; margin-bottom: 16px; }
.summary-line {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 13.5px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.12);
}
.summary-line:first-of-type { border-top: none; }
.summary-line .lbl { color: rgba(255,255,255,0.75); }
.summary-line .amt { font-weight: 700; white-space: nowrap; }
.summary-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 12px; padding-top: 14px; border-top: 2px solid var(--mtw-lime);
}
.summary-total .lbl { font-family: var(--font-display); font-weight: 800; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.summary-total .amt { font-family: var(--font-display); font-weight: 900; font-size: 28px; color: var(--mtw-lime); }
.summary-empty { color: rgba(255,255,255,0.6); font-size: 13px; padding: 10px 0; }
.summary-cadence { font-size: 11.5px; color: rgba(255,255,255,0.55); margin-top: 6px; }

.submit-card {
  background: var(--bg-1);
  border: 2px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
}
.submit-card .mtw-btn { width: 100%; text-align: center; margin-bottom: 8px; }
.submit-card .mtw-btn--outline { margin-top: 4px; }
.submit-note { font-size: 11.5px; color: var(--fg-3); margin-top: 10px; line-height: 1.4; }
.form-errors {
  background: #fdeceb; border: 1px solid var(--danger); color: #8a2c24;
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px;
  margin-bottom: 12px; display: none;
}
.form-errors.is-visible { display: block; }
.submit-success {
  background: var(--mtw-lime-20); border: 1px solid var(--mtw-lime-90); color: var(--mtw-navy);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px;
  margin-top: 10px; display: none;
}
.submit-success.is-visible { display: block; }

footer.site-footer {
  text-align: center; color: var(--fg-3); font-size: 12px; padding: 24px 0 40px;
}

/* ---------- Multi-child cards ---------- */
.child-card {
  border-color: var(--mtw-blue-20);
}
.child-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.child-card-head h3 { margin: 0; }
.remove-child-btn {
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--danger);
  background: none; border: 1.5px solid var(--danger); border-radius: var(--radius-pill);
  padding: 5px 12px; cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.remove-child-btn:hover { background: var(--danger); color: white; }
.remove-child-btn[hidden] { display: none; }

.sub-section {
  border-top: 2px solid var(--border-1);
  padding-top: 16px;
  margin-top: 16px;
}
.field-label { font-weight: 700; display: block; margin-bottom: 6px; }

.ever-driven-link {
  font-weight: 700; white-space: nowrap;
}
.ever-driven-link.is-disabled-link {
  color: var(--fg-3); text-decoration: none; cursor: default; pointer-events: none;
}

.mtw-btn--sm { padding: 8px 16px; font-size: 12px; }

/* ---------- Restore banner ---------- */
.restore-banner {
  display: none;
  align-items: center; justify-content: space-between; gap: 16px;
  background: var(--mtw-sky-20); border: 2px solid var(--mtw-blue-80);
  border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 20px;
  font-size: 13.5px; color: var(--mtw-navy); flex-wrap: wrap;
}
.restore-banner.is-visible { display: flex; }
.restore-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Summary per-child breakdown ---------- */
.summary-child-block { margin-bottom: 4px; }
.summary-child-title {
  font-family: var(--font-display); font-weight: 800; font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--mtw-sky);
  margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.12);
}
.summary-child-block:first-child .summary-child-title { border-top: none; margin-top: 0; padding-top: 0; }
.summary-empty-hint { color: rgba(255,255,255,0.6); font-size: 12.5px; padding: 6px 0; }
