/* ═══════════════════════════════════════════════════
   Approach 1 — Text-Based Step-by-Step Wizard
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
}

body {
  font-family: var(--font-ui);
  background: #F9F8F5;
}

/* ─── WIZARD WRAPPER ─── */
.wizard {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.wizard__header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.wizard__title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-primary-dark);
}

/* ─── PROGRESS BAR ─── */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 1.5rem 0 2rem;
  position: relative;
}

.wizard-progress__step {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.wizard-progress__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #E8E6E0;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.wizard-progress__line {
  width: 32px;
  height: 2px;
  background: #E8E6E0;
  transition: background 0.3s ease;
}

.wizard-progress__step.completed .wizard-progress__dot {
  background: var(--color-primary);
  color: #fff;
}

.wizard-progress__step.completed + .wizard-progress__step .wizard-progress__line,
.wizard-progress__step.completed .wizard-progress__line {
  /* Lines between completed steps are handled via JS class on the line */
}

.wizard-progress__line.filled {
  background: var(--color-primary);
}

.wizard-progress__step.active .wizard-progress__dot {
  background: var(--color-secondary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(197, 153, 58, 0.2);
}

.wizard-progress__label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  font-size: 0.65rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  letter-spacing: 0.03em;
  font-weight: 500;
  pointer-events: none;
}

.wizard-progress__step.active .wizard-progress__label {
  color: var(--color-secondary-dark);
  font-weight: 600;
}

.wizard-progress__step.completed .wizard-progress__label {
  color: var(--color-primary);
}

/* ─── STEP CONTAINER ─── */
.wizard-step {
  display: none;
  animation: stepFadeIn 0.35s ease;
}

.wizard-step.active {
  display: block;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.wizard-step__heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.35rem;
}

.wizard-step__subheading {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

/* ─── OPTION CARDS (radio-style) ─── */
.wizard-options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.wizard-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 2px solid #ECEAE4;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wizard-option:hover {
  border-color: var(--color-secondary-light);
  background: #FDFCFA;
}

.wizard-option.selected {
  border-color: var(--color-secondary);
  background: rgba(197, 153, 58, 0.04);
  box-shadow: 0 0 0 3px rgba(197, 153, 58, 0.1);
}

.wizard-option__radio {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #D0CDC5;
  border-radius: 50%;
  margin-top: 2px;
  position: relative;
  transition: all 0.2s ease;
}

.wizard-option.selected .wizard-option__radio {
  border-color: var(--color-secondary);
}

.wizard-option.selected .wizard-option__radio::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  background: var(--color-secondary);
  border-radius: 50%;
}

.wizard-option__text {
  flex: 1;
  min-width: 0;
}

.wizard-option__label {
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 0.95rem;
  line-height: 1.3;
}

.wizard-option__desc {
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-top: 2px;
  line-height: 1.4;
}

.wizard-option__tier {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-secondary-dark);
  padding: 0.2rem 0.5rem;
  background: rgba(197, 153, 58, 0.08);
  border-radius: 4px;
  margin-top: 2px;
}

/* ─── NUMBER INPUT (square footage) ─── */
.wizard-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.wizard-number__input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wizard-number__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ECEAE4;
  color: var(--color-primary-dark);
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
}

.wizard-number__btn:hover {
  background: var(--color-secondary);
  color: #fff;
}

.wizard-number__field {
  width: 160px;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  padding: 0.5rem 1rem;
  border: 2px solid #E8E6E0;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.2s ease;
}

.wizard-number__field:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(197, 153, 58, 0.15);
}

.wizard-number__unit {
  font-size: 0.9rem;
  color: var(--color-text-light);
  font-weight: 500;
}

.wizard-number__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.wizard-number__preset {
  padding: 0.5rem 1rem;
  border: 1px solid #E0DDD5;
  border-radius: 8px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.wizard-number__preset:hover {
  border-color: var(--color-secondary);
  background: rgba(197, 153, 58, 0.04);
  color: var(--color-secondary-dark);
}

.wizard-number__preset.active {
  border-color: var(--color-secondary);
  background: var(--color-secondary);
  color: #fff;
}

/* ─── ADD-ON CHECKBOXES (Step 5) ─── */
.wizard-addons {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.wizard-addon {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 2px solid #ECEAE4;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wizard-addon:hover {
  border-color: var(--color-secondary-light);
  background: #FDFCFA;
}

.wizard-addon.checked {
  border-color: var(--color-secondary);
  background: rgba(197, 153, 58, 0.04);
  box-shadow: 0 0 0 3px rgba(197, 153, 58, 0.1);
}

.wizard-addon input[type="checkbox"] {
  display: none;
}

.wizard-addon__check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #D0CDC5;
  border-radius: 4px;
  margin-top: 2px;
  position: relative;
  transition: all 0.2s ease;
}

.wizard-addon.checked .wizard-addon__check {
  border-color: var(--color-secondary);
  background: var(--color-secondary);
}

.wizard-addon.checked .wizard-addon__check::after {
  content: '\2713';
  position: absolute;
  top: -1px;
  left: 2px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.wizard-addon__text {
  flex: 1;
  min-width: 0;
}

.wizard-addon__title {
  display: block;
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 0.95rem;
  line-height: 1.3;
}

.wizard-addon__desc {
  display: block;
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-top: 2px;
  line-height: 1.4;
}

.wizard-addon__cost {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-secondary-dark);
  padding: 0.2rem 0.5rem;
  background: rgba(197, 153, 58, 0.08);
  border-radius: 4px;
  margin-top: 2px;
}

/* ─── PERIMETER INPUT (optional) ─── */
.wizard-perimeter {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ECEAE4;
}

.wizard-perimeter__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.wizard-perimeter__toggle input[type="checkbox"] {
  accent-color: var(--color-secondary);
  width: 16px;
  height: 16px;
}

.wizard-perimeter__field-wrap {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.wizard-perimeter__field-wrap.visible {
  display: flex;
}

.wizard-perimeter__field {
  width: 120px;
  padding: 0.6rem 0.75rem;
  border: 2px solid #E8E6E0;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  background: #fff;
}

.wizard-perimeter__field:focus {
  outline: none;
  border-color: var(--color-secondary);
}

/* ─── SPLIT SECTION (surface + edge in one step) ─── */
.wizard-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.wizard-split__section h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-primary-dark);
  margin-bottom: 0.35rem;
}

.wizard-split__section > p {
  color: var(--color-text-light);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ─── NAVIGATION ─── */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ECEAE4;
}

.wizard-nav__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-light);
  border: 1px solid #E0DDD5;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wizard-nav__back:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.wizard-nav__back.hidden {
  visibility: hidden;
}

.wizard-nav__next {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--color-secondary);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(197, 153, 58, 0.25);
}

.wizard-nav__next:hover {
  background: var(--color-secondary-dark);
  box-shadow: 0 4px 16px rgba(197, 153, 58, 0.3);
  transform: translateY(-1px);
}

.wizard-nav__next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── RESULTS (Step 7) ─── */
.wizard-result {
  text-align: center;
  padding: 1rem 0 2rem;
}

.wizard-result__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-secondary-dark);
  background: rgba(197, 153, 58, 0.1);
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.wizard-result__range {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: priceReveal 0.6s 0.2s ease forwards;
}

@keyframes priceReveal {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.wizard-result__range .sep {
  color: var(--color-text-muted);
  font-size: 0.6em;
  margin: 0 0.3em;
}

.wizard-result__summary-label {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* Breakdown toggle */
.wizard-result__breakdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 1rem;
}

.wizard-result__breakdown-toggle:hover {
  border-color: var(--color-primary);
}

.wizard-result__breakdown-toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.wizard-result__breakdown-toggle.open svg {
  transform: rotate(180deg);
}

.wizard-result__breakdown {
  max-width: 480px;
  margin: 0 auto 2rem;
  text-align: left;
  display: none;
}

.wizard-result__breakdown.visible {
  display: block;
  animation: stepFadeIn 0.25s ease;
}

.wizard-result__breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #F0EEE9;
  font-size: 0.88rem;
}

.wizard-result__breakdown-row:last-child {
  border-bottom: none;
}

.wizard-result__breakdown-label {
  color: var(--color-text-light);
}

.wizard-result__breakdown-amount {
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* Selections summary */
.wizard-result__selections {
  max-width: 480px;
  margin: 0 auto 2rem;
  background: var(--color-bg-alt);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-align: left;
}

.wizard-result__selections h4 {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.wizard-result__sel-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.85rem;
}

.wizard-result__sel-key {
  color: var(--color-text-light);
}

.wizard-result__sel-val {
  font-weight: 600;
  color: var(--color-primary-dark);
}

/* Disclaimer */
.wizard-result__disclaimer {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-style: italic;
  max-width: 520px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

/* Actions */
.wizard-result__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.wizard-result__actions .btn {
  font-family: var(--font-ui);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  .wizard {
    padding: 1.5rem 1rem 3rem;
  }

  .wizard-progress__label {
    display: none;
  }

  .wizard-progress__line {
    width: 20px;
  }

  .wizard-number__field {
    width: 120px;
    font-size: 1.6rem;
  }

  .wizard-result__range {
    font-size: 1.75rem;
  }

  .wizard-result__actions {
    flex-direction: column;
  }

  .wizard-result__actions .btn {
    width: 100%;
  }
}
