/* ============================================================
   Webrivio — Contact / Get-a-quote
   Bold, full-screen, one-question-at-a-time flow.
   Isolated from styles.css/enhance.css on purpose (no shared-file
   edits). Progressive enhancement:
     • No JS  → every .q-step is visible, stacked = a normal form.
     • JS on  → .quote gets .is-enhanced, one step shows at a time.
   ============================================================ */

/* ---------- visually-hidden (SEO h1 / a11y) ---------- */
.q-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* progressive-enhancement visibility switches ------------- */
/* [data-enh] elements (Next/Back/progress/scroll-cue) are the
   step-flow chrome — meaningless without JS, so hide until enhanced. */
.quote:not(.is-enhanced) [data-enh] { display: none !important; }
/* [data-noenh] is the plain-form heading — drop it once enhanced. */
.quote.is-enhanced [data-noenh] { display: none !important; }

/* ============================================================
   The stage
   ============================================================ */
.quote {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: clamp(104px, 15vh, 168px);
  padding-bottom: clamp(56px, 9vh, 104px);
  overflow: hidden;
}
/* soft directional glow behind the flow — cinematic, cheap */
.quote::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 55% at 18% 30%, rgba(77,126,255,0.16), transparent 68%),
    radial-gradient(52% 48% at 92% 88%, rgba(127,227,255,0.08), transparent 70%);
}

.quote-inner {
  position: relative;
  width: 100%;
}

/* ---------- progress rail + counter (enhanced only) ---------- */
.q-progress {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: clamp(28px, 5vh, 56px);
  max-width: 760px;
}
.q-progress-bar {
  position: relative;
  flex: 1;
  height: 2px;
  background: rgba(123,164,255,0.16);
  border-radius: 999px;
  overflow: hidden;
}
.q-progress-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  box-shadow: 0 0 12px rgba(127,227,255,0.5);
  border-radius: 999px;
  transition: width .5s var(--ease-out);
}
.q-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--mute);
  white-space: nowrap;
}
.q-count b { color: var(--accent-glow); font-weight: 500; }

/* ============================================================
   Steps
   ============================================================ */
.q-form { position: relative; }

.q-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 860px;
}
/* stacked spacing for the no-JS fallback */
.quote:not(.is-enhanced) .q-step { margin-bottom: 44px; }

/* one-at-a-time when enhanced */
.quote.is-enhanced .q-step { display: none; margin-bottom: 0; }
.quote.is-enhanced .q-step.is-active {
  display: flex;
  animation: qStepIn .55s var(--ease-out) both;
}
@keyframes qStepIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* faint oversized step index — editorial texture */
.q-index {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-glow);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.q-index::before {
  content: '';
  width: 22px; height: 1px;
  background: currentColor;
  opacity: 0.55;
}

/* the question itself */
.q-q {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 5.2vw, 62px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-top: 6px;
}
.q-q .it { font-style: italic; color: var(--accent-glow); }
.q-q .opt {
  font-family: var(--mono);
  font-size: 0.28em;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute-2);
  vertical-align: middle;
  margin-left: 12px;
}

.q-help {
  font-size: clamp(14px, 1.2vw, 16px);
  color: var(--mute);
  line-height: 1.5;
  max-width: 54ch;
}

/* ---------- the big "typing across the screen" input ---------- */
.q-field { width: 100%; margin-top: clamp(10px, 2vh, 22px); }
.q-input,
.q-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border-strong);
  border-radius: 0;
  padding: 14px 2px;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(24px, 4.4vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  caret-color: var(--accent-glow);
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.q-input::placeholder,
.q-textarea::placeholder { color: var(--mute-2); font-weight: 300; }
.q-input:focus,
.q-textarea:focus {
  outline: none;
  border-color: var(--accent-glow);
  box-shadow: 0 2px 24px -12px rgba(127,227,255,0.7);
}
.q-textarea {
  font-size: clamp(19px, 2.6vw, 30px);
  resize: none;
  min-height: 1.6em;
  overflow: hidden; /* JS auto-grows; wraps within its own box */
}
/* iOS never zooms these — they are already large */

/* ---------- chip options (industry) ---------- */
.q-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(10px, 2vh, 22px);
  max-width: 760px;
}
.q-opt {
  font-family: var(--sans);
  font-size: clamp(15px, 1.5vw, 18px);
  padding: 14px 24px;
  background: rgba(5,11,24,0.4);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform .25s var(--ease-out), border-color .25s, background .25s, color .25s, box-shadow .25s;
  user-select: none;
  line-height: 1;
}
.q-opt:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  background: rgba(77,126,255,0.09);
  transform: translateY(-2px);
}
.q-opt.is-on {
  background: linear-gradient(180deg, #3F6BE2 0%, #2D55C8 100%);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 26px -8px rgba(77,126,255,0.55);
}

/* ---------- per-step controls (enhanced) ---------- */
.q-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: clamp(20px, 3.5vh, 40px);
}
.q-enter {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute-2);
}
.q-enter b { color: var(--ink-soft); font-weight: 500; }
.q-enter kbd {
  font-family: var(--mono);
  color: var(--ink-soft);
  background: rgba(123,164,255,0.1);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 10px;
}
.q-skip {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 8px 4px;
  transition: color .25s;
}
.q-skip:hover { color: var(--accent-glow); }

/* per-step inline error */
.q-error {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #FF8B8B;
  min-height: 1em;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s, transform .25s;
}
.q-error.show { opacity: 1; transform: translateY(0); }

/* ============================================================
   Review + send step
   ============================================================ */
.q-review {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 620px;
  margin: clamp(14px, 2.4vh, 26px) 0 6px;
  border-top: 1px solid var(--border);
}
.q-review-row {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--border);
}
.q-review-row .k {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--mute);
  flex: 0 0 128px;
}
.q-review-row .v {
  font-family: var(--serif);
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.q-review-row .v.empty { color: var(--mute-2); font-style: italic; }
.q-review-row .edit {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-glow);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  opacity: 0.75;
  transition: opacity .25s;
}
.q-review-row .edit:hover { opacity: 1; }

/* ============================================================
   Buttons — thin wrappers over the site .btn so we stay on brand
   without touching styles.css
   ============================================================ */
.q-next,
.q-submit {
  height: 52px;
  padding: 0 30px;
  font-size: 15px;
}
.q-submit { padding: 0 36px; }

/* ---------- back + scroll cue ---------- */
.q-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(30px, 6vh, 64px);
  max-width: 860px;
}
.q-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 10px 4px;
  transition: color .25s, transform .25s var(--ease-out);
}
.q-back svg { width: 16px; height: 10px; transition: transform .25s var(--ease-out); }
.q-back:hover { color: var(--ink); }
.q-back:hover svg { transform: translateX(-4px); }
.q-back[hidden] { visibility: hidden; }

.q-scrollcue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  transition: color .25s;
}
.q-scrollcue span {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  animation: qNudge 2.4s var(--ease) infinite;
}
.q-scrollcue:hover { color: var(--accent-glow); }
.q-scrollcue:hover span { border-color: var(--border-strong); }
@keyframes qNudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ============================================================
   Success takeover
   ============================================================ */
.q-done {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  max-width: 720px;
  animation: qStepIn .6s var(--ease-out) both;
}
.quote.is-done .q-done { display: flex; }
.quote.is-done .q-form,
.quote.is-done .q-progress,
.quote.is-done .q-foot { display: none !important; }
.q-done .q-check {
  width: 62px; height: 62px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1.5px solid var(--cyan);
  box-shadow: 0 0 40px -8px rgba(127,227,255,0.55);
}
.q-done .q-check svg { width: 30px; height: 30px; color: var(--cyan); }
.q-done .q-check svg path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: qDraw .5s .15s var(--ease-out) forwards;
}
@keyframes qDraw { to { stroke-dashoffset: 0; } }
.q-done h2 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.0;
  letter-spacing: -0.02em;
}
/* focus is moved here for keyboard flow; the aria-live region already
   announces to SR, so the heading doesn't need a visible focus box */
.q-done h2:focus, .q-done h2:focus-visible { outline: none; }
.q-done h2 .it { font-style: italic; color: var(--accent-glow); }
.q-done p { color: var(--ink-soft); font-size: clamp(15px, 1.3vw, 18px); max-width: 48ch; }

/* generic status live-region (kept for parity/errors) */
.quote .form-status {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--mute-2);
  min-height: 18px;
}
.quote .form-status.err { color: #FF8B8B; }
.quote .form-status.pending { color: var(--ink-soft); }

/* ============================================================
   Kept content below the flow (direct contact + FAQ)
   ============================================================ */
/* .section-pad sets `padding: <v> 0`, which (equal specificity, later rule)
   zeroes the .container horizontal gutter — the documented cascade gotcha.
   Restore it here so the kept content lines up with the questions above.
   Scoped to the contact page so other pages' sections are untouched. */
body[data-page="contact"] #more,
body[data-page="contact"] .faq-section {
  padding-left: calc(var(--gutter) + var(--safe-l));
  padding-right: calc(var(--gutter) + var(--safe-r));
}

.more-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 30px;
  margin-bottom: 46px;
  border-bottom: 1px solid var(--border);
}
.more-head h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.more-head h2 .it { font-style: italic; color: var(--accent-glow); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .quote {
    align-items: flex-start;
    padding-top: clamp(96px, 18vh, 140px);
  }
  .q-foot { max-width: none; }
  .q-review-row { flex-wrap: wrap; gap: 6px 14px; }
  .q-review-row .k { flex-basis: 100%; }
}
@media (max-width: 560px) {
  .q-controls { gap: 14px; }
  .q-next, .q-submit { width: 100%; }
  .q-enter { display: none; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .quote.is-enhanced .q-step.is-active,
  .q-done { animation: none; }
  .q-progress-bar span { transition: none; }
  .q-scrollcue span { animation: none; }
  .q-done .q-check svg path { animation: none; stroke-dashoffset: 0; }
}
