/* ============================================================
   Three-step quote form (js/quote-form.js). Builds on the shared
   .form-card, .form-group, .choice, .dropzone and .upload-* rules
   in style.css; only what the stepped form adds lives here.
   ============================================================ */

.quote-form-mount {
  /* Critically damped spring (no overshoot), sampled for linear(). On the mount so the success panel can use it too. */
  --qf-spring: linear(0, 0.033 4%, 0.109 8%, 0.206 12%, 0.308 16%, 0.408 20%, 0.522 25%, 0.620 30%, 0.702 35%, 0.769 40%, 0.864 50%, 0.922 60%, 0.956 70%, 0.976 80%, 0.987 90%, 1);
  /* Same content width as .section-heading above it on /booking. */
  max-width: 736px;
  margin-inline: auto;
  scroll-margin-top: 90px; /* clears the fixed navbar when preset() scrolls here */
}
/* Room for step 1 while the script renders it, so the page below does not jump.
   Only where scripting is on: without JS the form never replaces the fallback text, and a
   reserved 1000px would be an empty gap under it. If you change a field, re-measure (see
   the step-1 comment in js/quote-form.js; the landing pages have their own in css/lp.css).
   (scripting: enabled) needs Chrome 120+, Safari 17+ or Firefox 113+; older browsers only lose
   the reserved height, a small layout shift. No noscript workaround. */
/* Measured step-1 heights on /booking: 1039px at 390 wide, 898px at 1440. */
@media (scripting: enabled) { .quote-form-mount:not([data-ready]) { min-height: 1040px; } }
@media (scripting: enabled) and (min-width: 641px) { .quote-form-mount:not([data-ready]) { min-height: 900px; } }
.qf-fallback { color: var(--text-secondary); line-height: 1.65; }
.qf-fallback a, .qf-consent a { color: var(--accent); text-underline-offset: 3px; }

.quote-form {
  color-scheme: dark;
  touch-action: manipulation;
  scroll-margin-top: 100px;
}
.quote-form [hidden] { display: none !important; }

/* ---------- Progress ---------- */
.qf-progress {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.qf-progress li { display: flex; align-items: center; gap: 8px; transition: color 0.2s ease; }
.qf-num {
  width: 24px; height: 24px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.qf-progress li[aria-current], .qf-progress li.is-done { color: var(--text-primary); }
.qf-progress li[aria-current] .qf-num { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.qf-progress li.is-done .qf-num { border-color: var(--accent); }
.qf-track {
  height: 3px;
  margin: 14px 0 32px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.qf-track span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--qf-progress, 0.3333));
  transition: transform 350ms var(--qf-spring);
}
/* Narrow phones: only the current step keeps its name. */
@media (max-width: 420px) {
  .qf-progress li:not([aria-current]) .qf-step-name {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* ---------- Steps ---------- */
.qf-step { border: 0; padding: 0; margin: 0; min-width: 0; }
.qf-step > legend {
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: 22px;
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}
.quote-form[data-dir] .qf-step:not([hidden]) { animation: qfSlide 350ms var(--qf-spring) both; }
.quote-form[data-dir="back"] .qf-step { --qf-dx: -24px; }
@keyframes qfSlide {
  from { opacity: 0; transform: translateX(var(--qf-dx, 24px)); }
}
/* The success panel arrives like a fourth step. */
.quote-form-mount .form-success { animation: qfSlide 350ms var(--qf-spring) both; }

/* ---------- Fields ---------- */
.quote-form .qf-label { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.qf-optional { font-weight: 400; color: var(--text-secondary); opacity: 0.85; }
.quote-form .field-hint { color: var(--text-secondary); }
.quote-form .field-hint:empty { display: none; } /* the coverage line before a service is picked */
.quote-form .field-error:empty { margin-top: -8px; } /* no gap while there is nothing to say */
.quote-form .form-group :is(input:not([type="radio"], [type="checkbox"]), select, textarea) {
  font-size: 1rem; /* 16px: no zoom on iOS focus */
  min-height: 48px;
}
.quote-form .form-group :is(input:not([type="radio"], [type="checkbox"]), select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.quote-form ::placeholder { color: rgba(255, 255, 255, 0.55); }

.quote-form .choice {
  min-height: 44px;
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: transform 100ms ease-out, border-color 0.2s ease, background 0.2s ease;
}
/* A tap shows as selected at once; only un-selecting fades. */
.quote-form .choice:has(input:checked) { transition: transform 100ms ease-out; }
.quote-form .choice:has(input:checked) .choice-mark { transition: none; }
.qf-stack { flex-direction: column; }
.qf-stack .choice, .quote-form .qf-stack-item { display: flex; align-items: flex-start; line-height: 1.45; }
.qf-stack .choice .choice-mark, .quote-form .qf-stack-item .choice-mark { margin-top: 1px; }
.qf-consent { align-items: flex-start; padding: 14px 18px; line-height: 1.5; }
.qf-consent > span:last-child { font-size: 0.86rem; color: var(--text-secondary); }
.qf-consent .choice-mark { margin-top: 2px; }

.quote-form .dropzone-icon { color: var(--text-secondary); opacity: 1; }
.quote-form .dropzone-icon svg { width: 28px; height: 28px; margin: 0 auto; display: block; }

/* ---------- Navigation ---------- */
/* Back sits left of Next; when they no longer fit side by side, Next wraps above Back. */
.qf-nav { display: flex; flex-wrap: wrap-reverse; gap: 12px; margin-top: 8px; }
.qf-nav .btn-primary { flex: 999 1 13rem; padding: 14px 20px; min-height: 48px; }
.qf-nav .btn-secondary { flex: 1 0 auto; padding: 14px 20px; min-height: 48px; cursor: pointer; }
.quote-form :is(.btn-primary, .btn-secondary) {
  transition: transform 100ms ease-out, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.quote-form :is(.choice, .btn-primary, .btn-secondary, .qf-whatsapp):active { transform: scale(0.97); }
.quote-form button:disabled { opacity: 0.55; cursor: progress; transform: none; box-shadow: none; }

.qf-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 10px;
  color: var(--text-primary);
  font-size: 0.92rem;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 4px;
  transition: transform 100ms ease-out, text-decoration-color 0.2s ease;
}
.qf-whatsapp:hover { text-decoration-color: #25d366; }
.qf-whatsapp svg { width: 18px; height: 18px; fill: #25d366; flex-shrink: 0; }

.qf-reassure {
  margin-top: 16px;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-secondary);
  text-wrap: balance;
}
.quote-form .form-status a { color: var(--accent); }

@media (max-width: 640px) {
  .quote-form-mount.form-card { padding: 24px 18px; }
}

/* Reduced motion: a short fade instead of the slide. Beats the global 0.01ms override in style.css. */
@media (prefers-reduced-motion: reduce) {
  .quote-form[data-dir] .qf-step:not([hidden]), .quote-form-mount .form-success { animation: qfFade 150ms ease-out both !important; }
}
@keyframes qfFade { from { opacity: 0; } }
