/* wizard-demo.css
   Lifted from portfolio/abbott-roofing-oxford/css/components/wizard.css.
   Renders the auto-playing quote wizard inside the H&P homepage hero.
   Tokens (--color-primary, --space-N, --fs-N, etc.) are bridged to H&P's Royal
   Warrant palette by the .hero-demo { ... } block in index.html. */

.wizard {
  max-width: 600px;
  margin-inline: auto;
}

.wizard-progress-sticky {
  margin-block-end: var(--space-4);
}
@media (max-width: 640px) {
  .wizard-progress-sticky {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--color-bg);
    padding-block: var(--space-2);
    margin-inline: calc(var(--space-6) * -1);
    padding-inline: var(--space-6);
  }
}

.wizard-progress {
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-block-end: var(--space-2);
}
@media (min-width: 640px) {
  .wizard-progress { height: 10px; }
}
.wizard-progress-bar {
  height: 100%;
  width: 20%;
  background: var(--color-primary);
  transition: width 300ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .wizard-progress-bar { transition: none; }
}

.wizard-step-counter {
  font-size: var(--fs-sm);
  color: var(--color-fg-muted);
  margin-block-end: 0;
}

.wizard-time-estimate {
  font-size: var(--fs-sm);
  color: var(--color-fg-muted);
  text-align: center;
  margin-block-end: var(--space-2);
}

.wizard-testimonial {
  margin-block-end: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-secondary);
}
.wizard-testimonial-body {
  font-size: var(--fs-sm);
  font-style: italic;
  color: var(--color-fg);
  margin-block-end: var(--space-1);
}
.wizard-testimonial-author {
  display: block;
  font-size: var(--fs-xs);
  color: var(--color-fg-muted);
}

@keyframes wizard-step-in-forward {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wizard-step-in-back {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.wizard-step[data-anim="forward"] { animation: wizard-step-in-forward 200ms ease both; }
.wizard-step[data-anim="back"]    { animation: wizard-step-in-back 200ms ease both; }
@media (prefers-reduced-motion: reduce) {
  .wizard-step[data-anim] { animation: none; }
}

.wizard-step h2 { margin-block-end: var(--space-2); font-size: var(--fs-xl); }
.wizard-step > p { color: var(--color-fg-muted); margin-block-end: var(--space-6); }

.wizard-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.wizard-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: var(--space-2);
  min-height: 116px;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-3);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: inherit;
  width: 100%;
  color: var(--color-fg);
}
.wizard-option:hover,
.wizard-option.demo-hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.wizard-option[data-selected="true"] {
  background: var(--color-primary);
  color: var(--color-fg-inverse);
  border-color: var(--color-primary);
  box-shadow: 0 8px 24px rgba(22, 43, 92, 0.22);
}
.wizard-option-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  color: var(--color-secondary);
  transition: color var(--duration-fast) var(--ease-out);
}
.wizard-option[data-selected="true"] .wizard-option-icon {
  color: var(--color-fg-inverse);
}
.wizard-option strong {
  font-size: var(--fs-sm);
  color: var(--color-fg);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.005em;
}
.wizard-option span {
  font-size: var(--fs-xs);
  color: var(--color-fg-muted);
  line-height: var(--lh-snug);
}
.wizard-option[data-selected="true"] strong { color: var(--color-fg-inverse); }
.wizard-option[data-selected="true"] span { color: rgba(242, 236, 220, 0.78); }

.wizard-form p { margin-block-end: var(--space-4); }
.wizard-form--inline {
  margin-block-start: var(--space-5);
  max-width: 320px;
  margin-inline: auto;
}
.wizard-form--inline p:last-child { margin-block-end: 0; }

.wizard-photo-pickers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-block-end: var(--space-2);
}
@media (max-width: 380px) {
  .wizard-photo-pickers { grid-template-columns: 1fr; }
}
.wizard-photo-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-align: center;
  padding: var(--space-4) var(--space-3);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-fg);
}
.wizard-photo-picker:hover {
  border-color: var(--color-primary);
}
.wizard-photo-picker svg {
  width: 24px;
  height: 24px;
  color: var(--color-secondary);
}
.wizard-photos-trust {
  font-size: var(--fs-xs);
  color: var(--color-fg-muted);
  margin-block-start: var(--space-2);
  margin-block-end: var(--space-2);
  text-align: center;
}
.wizard-photos-step { margin-block-end: var(--space-2); }
.wizard-photos-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-block-start: var(--space-5);
}

.wizard-photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-start: var(--space-3);
  padding: 0;
  list-style: none;
}
.wizard-photo-previews li {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ECE6DC;
}
.wizard-photo-previews img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* hidden override: elements with explicit display:flex/block/grid don't
   honour the HTML hidden attribute by default (author CSS beats UA's
   [hidden] rule). One general rule for everything inside the wizard. */
.wizard [hidden] { display: none !important; }

.wizard-emergency-triage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-block-start: var(--space-5);
  padding: var(--space-5);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-md);
  background: rgba(182, 142, 46, 0.08);
  text-align: center;
}
.wizard-triage-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-fg-inverse);
  flex-shrink: 0;
}
.wizard-triage-icon svg { width: 24px; height: 24px; }
.wizard-emergency-triage h3 {
  font-size: var(--fs-lg);
  margin: 0;
  color: var(--color-fg);
}
.wizard-emergency-triage p {
  margin: 0;
  color: var(--color-fg-muted);
  max-width: 380px;
}
.wizard-triage-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: stretch;
  width: 100%;
  max-width: 280px;
  margin-block-start: var(--space-2);
}

.wizard-repairs-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-3);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  text-align: center;
  margin-block-start: var(--space-3);
}
.wizard-repairs-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-secondary);
  color: var(--color-fg-inverse);
  flex-shrink: 0;
}
.wizard-repairs-icon svg { width: 24px; height: 24px; }
.wizard-repairs-detail h3 {
  font-size: var(--fs-lg);
  margin: 0;
  color: var(--color-fg);
}
.wizard-repairs-detail > p {
  margin: 0;
  color: var(--color-fg-muted);
}

.wizard-options--sub {
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 380px;
  text-align: left;
}
.wizard-options--sub .wizard-option {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  min-height: unset;
  padding: var(--space-3) var(--space-4);
  gap: var(--space-1);
}
.wizard-options--sub .wizard-option strong { font-size: var(--fs-sm); }
.wizard-options--sub .wizard-option span { font-size: var(--fs-xs); }

.wizard-form label {
  display: block;
  font-weight: var(--fw-medium);
  color: var(--color-primary);
  font-size: var(--fs-sm);
}
.wizard-form input:not([hidden]):not([type="hidden"]),
.wizard-form textarea {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  margin-block-start: var(--space-2);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--color-fg);
  transition: border-color var(--duration-fast) var(--ease-out);
}
.wizard-form input:focus,
.wizard-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-error {
  display: block;
  color: var(--color-danger);
  font-size: var(--fs-sm);
  margin-block-start: var(--space-1);
  font-weight: var(--fw-medium);
}
.wizard-field-note {
  font-size: var(--fs-sm);
  color: var(--color-fg-muted);
  margin-block-start: var(--space-2);
  margin-block-end: var(--space-4);
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-start: var(--space-6);
  gap: var(--space-3);
}
.wizard-nav button[hidden] { display: none; }
.wizard-nav button:only-child { margin-inline-start: auto; }

.wizard-success {
  padding-block: var(--space-4);
}
.wizard-success-heading {
  font-size: var(--fs-2xl);
  color: var(--color-primary);
  margin-block-end: var(--space-3);
}
.wizard-success .lede {
  font-size: var(--fs-base);
  color: var(--color-fg);
  margin-block: 0 var(--space-5);
}
.wizard-success-reference {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-primary);
  color: var(--color-primary-fg);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-block-end: var(--space-5);
  width: fit-content;
}
.wizard-success-reference-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
  white-space: nowrap;
}
.wizard-success-reference code {
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
  font-size: var(--fs-sm);
  font-weight: 600;
  user-select: all;
}
.wizard-success-recap {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-4);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-block-end: var(--space-5);
}

/* ============================================================
   Mobile compact mode (≤640px): aggressive trims so the demo
   reads as a snappy product preview, not a long-scroll form.
   Hides decorative chrome, collapses option cards to compact
   horizontal rows, drops the success recap. Each step now fits
   in roughly one mobile viewport.
   ============================================================ */
@media (max-width: 640px) {
  /* Save vertical space: testimonial belongs to the homeowner
     wizard, not the H&P demo. The time-estimate is decorative. */
  .wizard-testimonial { display: none; }
  .wizard-time-estimate { display: none; }

  /* Tighter step intro */
  .wizard-step h2 {
    font-size: 1rem;
    margin-block-end: 6px;
  }
  .wizard-step > p {
    font-size: 0.82rem;
    margin-block-end: var(--space-3);
    line-height: 1.35;
  }

  /* Keep 2-col grid; compact cards instead of stacking 1-col */
  .wizard-options { gap: var(--space-2); }

  /* Compact horizontal cards: icon left, single-line title right.
     Drops the descriptor span, halves the height (116→56px). */
  .wizard-option {
    min-height: 56px;
    padding: 10px 10px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 8px;
  }
  .wizard-option-icon { width: 18px; height: 18px; }
  .wizard-option strong {
    font-size: 0.78rem;
    line-height: 1.2;
  }
  .wizard-option span { display: none; }

  /* Success state: drop the long recap dl; keep heading +
     reference + CTA only. Drops the lede font-size too. */
  .wizard-success-recap { display: none; }
  .wizard-success-heading { font-size: 1.3rem; margin-block-end: 8px; }
  .wizard-success .lede {
    font-size: 0.9rem;
    margin-block-end: var(--space-4);
  }
  .wizard-success-reference {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    margin-block-end: var(--space-4);
  }
  .wizard-success-reference-label { font-size: 0.65rem; }

  /* Form (step 3 postcode + step 5 form, if puppet ever shows it) */
  .wizard-form--inline { margin-block-start: var(--space-3); max-width: 100%; }
  .wizard-form label { font-size: 0.78rem; }

  /* Photo step compaction */
  .wizard-photo-pickers { gap: 8px; }
  .wizard-photo-picker {
    padding: 14px 8px;
    font-size: 0.78rem;
    flex-direction: row;
    justify-content: center;
    gap: 6px;
  }
  .wizard-photo-picker svg { width: 18px; height: 18px; }
  .wizard-photos-trust { font-size: 0.7rem; }
  .wizard-photos-nav { margin-block-start: var(--space-3); }
}
.wizard-success-recap dt {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-fg-muted);
  padding-block: var(--space-1);
  align-self: center;
  margin: 0;
}
.wizard-success-recap dd {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-fg);
  margin: 0;
  padding-block: var(--space-1);
  align-self: center;
}
@media (min-width: 560px) {
  .wizard-success-recap {
    grid-template-columns: repeat(2, max-content 1fr);
  }
}
