/* Quote form: one question per screen (17 Nov 2026).
   Loaded with assets/js/quote-steps.js for Gravity Forms form 1 only (inc/quote-steps.php).
   Builds on forms.css (the cards, 60px inputs, 18px text, 2px borders) and changes none of it.

   Nothing below applies until the script adds .gr-qs to the wrapper, so with the script off,
   blocked or failed this is the multi-page form as before. The script adds that class only once it
   can read --gr-qs, which proves this file has loaded.

   .gr-qs-on       the GF page on show, when its questions are shown one at a time (never the
                   contact and consent page, which stays whole)
   .gr-qs-current  the question (or the two that share a screen) on show
   .gr-qs-leaving  the question going out, and the one held out of sight while GF fetches a page
   .gr-qs-nonext   a single-choice question with no answer yet: a tap moves on, Continue waits
   .gr-qs-back     the last move was Back, so the slide runs the other way

   The prefix is gr-qs, not the spec's gr-steps: global.css already has a .gr-steps component (a
   three-column grid), which turned the form wrapper into three narrow columns.

   Two rules that must not be "tidied":
   1. A question that is not on show is taken out with visibility and position, never display. GF
      writes inline display:block on a field its logic shows (the battery question), which would
      beat a class rule here.
   2. GF's Continue is hidden with visibility, never display. GF refuses to submit from a button
      whose display is none, and every page change is a press of that button. */

#gform_wrapper_1 { --gr-qs: 1; }

/* Room for five cards, so the Back and Continue row does not jump between questions. */
#gform_wrapper_1.gr-qs .gr-qs-on .gform_page_fields { min-height: 340px; }
#gform_wrapper_1.gr-qs .gr-qs-on .gform_fields { position: relative; }
#gform_wrapper_1.gr-qs .gr-qs-on .gform_fields > .gfield:not(.gr-qs-current):not(.gr-qs-leaving):not(.gform_validation_container) {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* GF's controls transition every property (--gf-transition-ctrl), visibility included, so a text box
   whose question has just come on show stayed hidden for that transition (and refused focus; where
   the clock stalls, as in a background tab, it stayed hidden). Same transitions, minus visibility. */
#gform_wrapper_1.gr-qs .gr-qs-on .gfield :is(input, select, textarea) { transition-property: color, background-color, border-color, box-shadow, outline-color; }

/* In and out: 8px in the direction of travel. The script's timers match these durations. */
#gform_wrapper_1.gr-qs .gr-qs-on .gform_fields > .gfield.gr-qs-current { animation: gr-step-in 200ms ease-out both; }
#gform_wrapper_1.gr-qs .gr-qs-on .gform_fields > .gfield.gr-qs-leaving { animation: gr-step-out 140ms ease-in both; pointer-events: none; }
#gform_wrapper_1.gr-qs.gr-qs-back .gr-qs-on .gform_fields > .gfield.gr-qs-current { animation-name: gr-step-in-back; }
#gform_wrapper_1.gr-qs.gr-qs-back .gr-qs-on .gform_fields > .gfield.gr-qs-leaving { animation-name: gr-step-out-back; }
@keyframes gr-step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes gr-step-in-back { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes gr-step-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-8px); } }
@keyframes gr-step-out-back { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  #gform_wrapper_1.gr-qs .gr-qs-on .gform_fields > .gfield.gr-qs-current { animation: none; }
  #gform_wrapper_1.gr-qs .gr-qs-on .gform_fields > .gfield.gr-qs-leaving { animation: none; opacity: 0; }
}

/* The question steps up to a size already in use. The second question on a shared screen (house
   number, callback time) keeps the form's ordinary label size. */
#gform_wrapper_1.gr-qs .gr-qs-on .gfield .gfield_label { font-size: 1.2rem; line-height: 1.25; margin-bottom: 12px; }
#gform_wrapper_1.gr-qs .gr-qs-on .gfield:is(.gr-qs-current, .gr-qs-leaving) ~ .gfield:is(.gr-qs-current, .gr-qs-leaving) .gfield_label { font-size: 1rem; line-height: 1.35; margin-bottom: 10px; }
@media (min-width: 600px) {
  #gform_wrapper_1.gr-qs .gr-qs-on .gfield .gfield_label { font-size: 1.4rem; }
  #gform_wrapper_1.gr-qs .gr-qs-on .gfield:is(.gr-qs-current, .gr-qs-leaving) ~ .gfield:is(.gr-qs-current, .gr-qs-leaving) .gfield_label { font-size: 1.08rem; }
}
/* After a tap the script puts focus on the question itself (tabindex -1), never on an option. That
   focus is for screen readers and the Tab order; it draws nothing unless the keyboard is in use. */
#gform_wrapper_1.gr-qs .gr-qs-on .gfield:focus:not(:focus-visible) { outline: 0; }
/* Every choice question is required, so the word is kept for screen readers only. It stays in view
   on the typed questions, where postcode is required and house number is not. */
#gform_wrapper_1.gr-qs .gr-qs-on .gfield--type-choice .gfield_required {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The choices: the same cards, taller. More than six (product, property type) go two across at
   every width so they fit a phone. The callback day and time keep their own grid and label size. */
#gform_wrapper_1.gr-qs .gr-qs-on .gfield .gchoice { min-height: 56px; }
#gform_wrapper_1.gr-qs .gr-qs-on .gfield:not(.gr-callback-day):not(.gr-callback-time) .gchoice label { font-size: 1rem; }
#gform_wrapper_1.gr-qs .gr-qs-on .gfield:not(.gr-callback-day):not(.gr-callback-time) .gfield_radio:has(> .gchoice:nth-child(7)),
#gform_wrapper_1.gr-qs .gr-qs-on .gfield:not(.gr-callback-day):not(.gr-callback-time) .gfield_checkbox:has(> .gchoice:nth-child(7)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 599px) {
  #gform_wrapper_1.gr-qs .gr-qs-on .gfield:not(.gr-callback-day):not(.gr-callback-time) .gfield_radio:has(> .gchoice:nth-child(7)) .gchoice,
  #gform_wrapper_1.gr-qs .gr-qs-on .gfield:not(.gr-callback-day):not(.gr-callback-time) .gfield_checkbox:has(> .gchoice:nth-child(7)) .gchoice { gap: 6px; padding-right: 8px; padding-left: 8px; }
  /* 0.9rem so the longest single word ("Conservatory") fits a half-width card from 360px. */
  #gform_wrapper_1.gr-qs .gr-qs-on .gfield:not(.gr-callback-day):not(.gr-callback-time) .gfield_radio:has(> .gchoice:nth-child(7)) .gchoice label,
  #gform_wrapper_1.gr-qs .gr-qs-on .gfield:not(.gr-callback-day):not(.gr-callback-time) .gfield_checkbox:has(> .gchoice:nth-child(7)) .gchoice label { font-size: 0.9rem; overflow-wrap: anywhere; }
}

/* Continue keeps its place while it waits, so Back never moves. */
#gform_wrapper_1.gr-qs .gr-qs-on.gr-qs-nonext .gform_page_footer .gform_next_button { visibility: hidden; }

/* "Your request: Solar panels", under the bar, when the product came from the link. */
#gform_wrapper_1.gr-qs .gr-qs-request { margin: -8px 0 20px; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
