/* ================================================================
   QUOTE WIZARD — the 3-step "Get a Quote" flow. The Step 1
   suggestion cards are rendered by quote-wizard.js from its
   TIER_SIGNALS data — see that file to change the tier-suggestion
   keywords. Step 2's own tier/price picker now lives in the chat
   panel (features/chatbot/chatbot.js and chatbot.css) — this file
   only styles the CTA that hands off to it.
   ================================================================ */

/* ---------- Overlay dialog ----------
   Opens on top of the home page (nav.js toggles [hidden]) instead
   of navigating to a separate page. inset-block-start starts it
   right at the bottom edge of the top bar, and its z-index sits
   below the bar's (100, see nav.css) — so the bar stays visible and
   clickable the whole time the overlay is open, rather than being
   covered by it. */
.quote-overlay {
  position: fixed;
  inset-inline: 0;
  inset-block-start: var(--topbar-height);
  inset-block-end: 0;
  z-index: 90;
  display: flex;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.quote-overlay[hidden] { display: none; }

.quote-overlay-backdrop {
  position: fixed;
  inset-block-start: var(--topbar-height);
  inset-block-end: 0;
  inset-inline: 0;
  background: rgba(15, 23, 32, 0.5);
}

.quote-overlay-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  height: fit-content;
  margin-block-start: 24px;
  background: var(--bg-page);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-elevated);
  animation: quoteOverlaySlideIn 0.22s ease;
}
.quote-overlay-panel:focus { outline: none; }

@keyframes quoteOverlaySlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .quote-overlay-panel { animation: none; }
}

.quote-overlay-close {
  position: absolute;
  inset-block-start: 16px;
  inset-inline-end: 16px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quote-overlay-close svg { width: 14px; height: 14px; }
.quote-overlay-close:hover { background: var(--border); color: var(--text-primary); }

.quote-overlay #wizard { padding-inline-end: 56px; }

/* Prevents the home page behind the overlay from scrolling while
   it's open. */
body.quote-overlay-open { overflow: hidden; }

/* ---------- Step indicator ---------- */
.wizard-steps {
  list-style: none;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-block-end: 22px;
}
.wizard-step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: var(--weight-label);
}
.wizard-step-indicator:not(:last-child)::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--border);
  margin-inline-start: 8px;
}
.wizard-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.wizard-step-indicator.is-active { color: var(--text-primary); }
.wizard-step-indicator.is-active .wizard-step-num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.wizard-step-indicator.is-done .wizard-step-num {
  background: var(--color-seafoam);
  border-color: var(--color-seafoam);
  color: #fff;
}
.wizard-step-num svg { width: 13px; height: 13px; }
@media (max-width: 480px) {
  .wizard-step-indicator span:last-child { display: none; }
}

/* ---------- Step panel (shared card look for all 3 steps) ---------- */
.wizard-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-block-end: 22px;
  /* Breaks from the site's usual flat-card rule on purpose — this
     panel is a tool the visitor actively operates, not static
     content, so it earns a shadow. Uses the "control" elevation tier
     (shared/base.css) rather than a one-off value — it's a surface
     you actively interact with, not a floating overlay like the chat
     panel, so the lightest of the three named tiers fits best. */
  box-shadow: var(--shadow-control);
}
.wizard-panel[hidden] { display: none; }
.wizard-panel h2 { margin-block: 0 8px; }
.estimator-intro { color: var(--text-muted); font-size: 0.95rem; margin-block-end: 20px; }

/* Step change — a quick fade/slide instead of the hard cut a bare
   [hidden] toggle gives you, echoing (at a faster, more "operating a
   tool" pace) the .reveal transition language used elsewhere on the
   site. quote-wizard.js adds/removes these classes around the hidden
   toggle; see goToStep(). */
.wizard-panel {
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.wizard-panel.wizard-panel-exit { opacity: 0; transform: translateY(-8px); }
.wizard-panel.wizard-panel-enter { opacity: 0; transform: translateY(8px); }
.wizard-panel h2:focus-visible { outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  .wizard-panel { transition: none; }
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-block-start: 20px;
}
.wizard-actions .field-error { margin-inline-end: auto; }

/* Narrow phones: let Back/Continue wrap onto their own row instead of
   squeezing two pill buttons (one with fairly long label text) into a
   single thumb-width line. */
@media (max-width: 400px) {
  .wizard-actions { flex-wrap: wrap; row-gap: 14px; }
  .wizard-actions .field-error { flex-basis: 100%; order: 1; margin-inline-end: 0; }
}

/* ---------- Step 1: idea + AI suggestion ----------
   The suggestion trigger and Continue now share one row (see
   .wizard-actions in index.html) instead of stacking on separate
   lines, so it reads as "here are your two options" rather than a
   detour before the real action. The divider that used to sit above
   the button now sits above the result once there's something to
   show. */
.wizard-suggest-btn { display: inline-flex; align-items: center; gap: 8px; }
.wizard-suggest-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.wizard-suggest-btn svg.is-spinning { animation: wizardSpin 0.9s linear infinite; }
@keyframes wizardSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .wizard-suggest-btn svg.is-spinning { animation: none; }
}

.wizard-suggest-result:not([hidden]) {
  margin-block-start: 22px;
  padding-block-start: 20px;
  border-block-start: 1px solid var(--border);
}
.wizard-suggest-prompt { font-size: 0.9rem; color: var(--text-muted); font-style: italic; }

.wizard-suggest-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--tier-color);
  border-radius: var(--radius-sm);
  padding-block: 14px;
  padding-inline: 18px;
  margin-block-end: 10px;
}
.wizard-suggest-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-block-end: 4px;
  font-weight: var(--weight-label);
}
.wizard-suggest-card-head svg { width: 14px; height: 14px; color: var(--tier-color); flex-shrink: 0; }
.wizard-suggest-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Step 2: hand off to the chat panel's estimate flow ---------- */
.wizard-estimate-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-block: 8px 4px;
}
.wizard-estimate-cta .btn svg { width: 16px; height: 16px; }

.wizard-skip-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wizard-skip-link:hover { color: var(--text-primary); }

/* ---------- Step 3: review & send ---------- */
/* Lives inside the same .form-row as the textarea it describes (see
   index.html) so it reads as attached to that field, not a separate
   floating caption below it. */
.wizard-review-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}
.wizard-review-note svg { width: 13px; height: 13px; flex-shrink: 0; }
