/* ==========================================================================
   INTAKE WIZARD — styles for intake.html only
   Loaded after styles.css, so all brand variables (--navy, --accent, …)
   from that file's :root are available here.

   This is the pre-sale "build my plan" intake: a dynamic, branching
   questionnaire that ends by showing the visitor a tailored recommendation.
   The question flow itself lives in /js/intake.js.
   ========================================================================== */

/* The card that holds the whole wizard */
.wizard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 34px 36px 30px;
  box-shadow: 0 8px 28px rgba(11, 37, 69, 0.08);
  max-width: 760px;
  margin: 0 auto;
}

/* --- Progress bar -------------------------------------------------------- */
.wiz-progress { margin-bottom: 28px; }
.wiz-progress-track {
  height: 8px;
  background: var(--mist);
  border-radius: 999px;
  overflow: hidden;
}
.wiz-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--wave), var(--accent));
  border-radius: 999px;
  transition: width 0.35s ease;
}
.wiz-progress-label {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-soft);
}

/* --- A single step ------------------------------------------------------- */
.wiz-step { display: none; animation: wiz-fade 0.3s ease; }
.wiz-step.active { display: block; }
@keyframes wiz-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .wiz-step { animation: none; }
  .wiz-progress-fill { transition: none; }
}

.wiz-step h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.wiz-step .wiz-help {
  color: var(--text-soft);
  font-size: 1rem;
  margin-bottom: 22px;
  max-width: 560px;
}
.wiz-step .wiz-optional {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* --- Question blocks inside a step --------------------------------------
   The engine wraps every question in .wiz-q, and labels radio/checkbox
   groups with .wiz-q-label. Text and select questions get their label
   styling from .form-field in styles.css instead — without the rules
   below, the two kinds of label look different (bold navy vs. plain body
   text) and questions run together with no gap. Keep them in sync with
   .form-field label in css/styles.css. */
.wiz-q { margin-bottom: 22px; }
.wiz-q:last-child { margin-bottom: 0; }
.wiz-q .form-field { margin-bottom: 0; }   /* .wiz-q owns the spacing */

.wiz-q-label {
  display: block;
  font-weight: 600;
  color: var(--navy);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

/* --- Selectable option cards (radio + checkbox) -------------------------- */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.option-grid.single { grid-template-columns: 1fr; }

.option-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.option-card:hover { border-color: var(--foam); background: #fbfdff; }
.option-card:focus-within {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.18);
}
.option-card.selected {
  border-color: var(--accent);
  background: rgba(0, 180, 216, 0.07);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
/* The real input is visually hidden but still focusable/accessible */
.option-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.option-card .opt-icon { font-size: 1.4rem; line-height: 1.3; flex-shrink: 0; }
.option-card .opt-body { flex: 1; }
/* Both are spans, so they need display:block or the description runs on
   directly after the bold title instead of starting its own line. */
.option-card .opt-title { display: block; font-weight: 600; color: var(--navy); font-size: 1rem; }
.option-card .opt-desc { display: block; font-size: 0.88rem; color: var(--text-soft); margin-top: 3px; }

/* The select indicator. It renders FIRST in the card (see js/intake.js) so it
   sits beside the label text rather than stranded at the card's far edge. */
.option-card .opt-tick {
  width: 22px; height: 22px; flex-shrink: 0;
  margin-top: 1px;            /* optical align with the first line of text */
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800; color: transparent;
  transition: all 0.15s;
}
.option-card.selected .opt-tick {
  background: var(--accent); border-color: var(--accent); color: var(--navy);
}

/* --- Plain fields inside the wizard reuse .form-field from styles.css ---- */
.wiz-step select,
.wiz-step .form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  color: var(--text);
  background: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%234a5a6a' stroke-width='1.5'><path d='M1 1.5L6 6.5L11 1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 38px;
}
.wiz-step select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.18);
}
/* Two-up row for short paired fields (e.g. name + phone) */
.wiz-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Live "we read your business type as…" chip under the free-text category box */
.cat-chip {
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.92rem;
  line-height: 1.4;
  padding: 10px 14px;
  border-radius: 10px;
  animation: wiz-fade 0.25s ease;
}
.cat-chip.match {
  background: rgba(0, 180, 216, 0.08);
  border: 1px solid rgba(0, 180, 216, 0.30);
  color: var(--navy);
}
.cat-chip .cat-tick {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.cat-chip strong { color: var(--wave); font-weight: 600; }
.cat-chip .cat-edit { color: var(--text-soft); }

/* Pending state while the AI classifier is thinking */
.cat-chip.pending {
  background: var(--mist);
  border: 1px solid var(--border);
  color: var(--text-soft);
  align-items: center;
}
.cat-chip .cat-spin {
  flex-shrink: 0;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid var(--foam);
  border-top-color: var(--wave);
  animation: cat-spin 0.7s linear infinite;
}
@keyframes cat-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .cat-chip { animation: none; }
  .cat-chip .cat-spin { animation: none; }
}

/* Inline "or" divider (e.g. website field vs. "I don't have one") */
.wiz-inline-check {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; font-size: 0.92rem; color: var(--text-soft);
}
.wiz-inline-check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* --- Validation hint ----------------------------------------------------- */
.wiz-hint {
  display: none;
  margin-top: 10px;
  color: #8a2a20;
  font-size: 0.9rem;
  font-weight: 600;
}
.wiz-hint.show { display: block; }

/* --- Step navigation buttons -------------------------------------------- */
.wiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.wiz-back {
  background: none;
  border: none;
  color: var(--text-soft);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 6px;
}
.wiz-back:hover { color: var(--navy); }
.wiz-back[hidden] { visibility: hidden; }
.wiz-nav .btn { border: none; cursor: pointer; font-family: inherit; }

/* --- The final recommendation ("your plan") ----------------------------- */
.wiz-plan { display: none; }
.wiz-plan.active { display: block; animation: wiz-fade 0.4s ease; }
.wiz-plan .plan-head { text-align: center; margin-bottom: 28px; }
.wiz-plan .plan-head .check-big {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border-radius: 50%; background: var(--accent); color: var(--navy);
  font-size: 1.8rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.wiz-plan .plan-head h2 { margin-bottom: 8px; }
.wiz-plan .plan-head p { color: var(--text-soft); max-width: 500px; margin: 0 auto; }

/* "What happens next" list on the confirmation screen. The recommended
   solutions and pricing are intentionally absent — see intake.html. */
.plan-next {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfdff;
  padding: 22px 26px;
  margin: 26px 0;
}
.plan-next h3 { color: var(--navy); font-size: 1.08rem; margin-bottom: 10px; }
.plan-next ul.plain { max-width: none; margin: 0; }
.plan-next ul.plain li { font-size: 0.98rem; padding: 7px 0 7px 30px; }

.wiz-plan .plan-cta { text-align: center; margin-top: 26px; }
.wiz-plan .plan-cta .form-note { margin-top: 14px; font-size: 0.9rem; color: var(--text-soft); }
.wiz-plan .plan-cta .form-note a { color: var(--wave); }

/* Error box reuses .form-error from styles.css */
#wiz-error { margin-top: 18px; }

/* --- Mobile -------------------------------------------------------------- */
@media (max-width: 640px) {
  .wizard { padding: 24px 20px 22px; border-radius: 14px; }
  .wiz-step h2 { font-size: 1.3rem; }
  .option-grid { grid-template-columns: 1fr; }
  .wiz-row { grid-template-columns: 1fr; gap: 0; }
  .wiz-nav { margin-top: 22px; }
}
