/*
 * Form styling.
 *
 * The ported stylesheet already styles .application-form, .field-grid,
 * .service-select and .quote-success — those came across from the source. What
 * it has no rules for is anything the source never built: validation errors,
 * the consent checkbox, and the honeypot. Those are added here rather than
 * into a vendored partial, so src/css stays a faithful copy of production CSS.
 */

/* The honeypot must be invisible to people but not to bots, which means it
   cannot use display:none — many bots skip hidden fields, defeating the trap. */
.gg-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gg-form-errors {
  margin: 0 0 22px;
  padding: 16px 18px;
  border-left: 4px solid #b3261e;
  border-radius: 8px;
  background: #fdeceb;
  color: #5f1a15;
  font-size: 13px;
  line-height: 1.6;
}

.gg-form-errors strong {
  display: block;
  margin-bottom: 6px;
}

.gg-form-errors ul {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}

.gg-form-errors li {
  margin-top: 4px;
}

.gg-quote-form h2,
.gg-enquiry-form h2 {
  margin: 30px 0 6px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.gg-quote-form h2:first-of-type {
  margin-top: 0;
}

.gg-quote-form .service-select label {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: 1px solid var(--line, #dbe2dc);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.gg-quote-form .service-select label:hover {
  border-color: var(--green-2, #1f6b43);
}

/* :has() gives a checked-state style with no JavaScript. Browsers without it
   simply show the radio itself, which is still perfectly usable. */
.gg-quote-form .service-select label:has(input:checked) {
  border-color: var(--green, #123e2b);
  background: #f0f7f2;
  box-shadow: inset 0 0 0 1px var(--green, #123e2b);
}

.gg-quote-form .service-select input[type="radio"] {
  margin: 0;
}

.gg-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin: 22px 0 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted, #657168);
}

.gg-consent input {
  margin-top: 3px;
}

.gg-form-note {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted, #657168);
}

/* The focus ring is non-negotiable — Section 5 keeps it at 3px solid yellow. */
.gg-quote-form :is(input, select, textarea, button):focus-visible,
.gg-enquiry-form :is(input, select, textarea, button):focus-visible {
  outline: 3px solid var(--yellow, #ffd523);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------------------
   Hero quote wizard
   ---------------------------------------------------------------------------
   The panel's own look — .quote-panel, .service-select, .field-grid,
   .booking-note, .reassurance, .text-button — is all inherited from the ported
   stylesheet. Only the things that stylesheet never had to describe are here:
   how the steps hide, and how the no-JavaScript fallback presents itself.

   Note the direction of the defaults. With no stylesheet and no script, every
   step is visible and the radio list is visible: the form still works. Each
   rule below removes something, and only once the script has said it is safe
   to by adding .gg-wizard-paged.                                            */

.gg-quote-wizard .gg-step + .gg-step {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line, #dbe2dc);
}

/* Paginated: one step at a time, and no rules between them. */
.gg-wizard-paged .gg-step + .gg-step {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.gg-quote-wizard .gg-step[hidden] {
  display: none;
}

/* The step counter is a lie when every step is on screen at once. */
.gg-quote-wizard .gg-step-count {
  display: none;
}

.gg-wizard-paged .gg-step-count {
  display: inline;
}

/* The tiles carry no meaning without the script that wires them to the radios,
   so they start hidden and the radio group is what a visitor sees.

   The explicit rule is not redundant. The `hidden` attribute only sets
   `display:none` in the UA stylesheet, and .service-select{display:grid} from
   the ported CSS outranks it — so without this the tiles would show alongside
   the radios for anyone whose JavaScript never ran. */
.gg-quote-wizard .gg-tiles[hidden] {
  display: none;
}

.gg-wizard-paged .gg-service-radios {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gg-quote-wizard .gg-service-radios {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.gg-quote-wizard .gg-service-radios legend {
  padding: 0;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 8px;
}

.gg-quote-wizard .gg-service-radios label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  margin: 7px 0;
  font-weight: 600;
}

.gg-quote-wizard .gg-service-radios input {
  width: 16px;
  margin: 0;
}

.gg-quote-wizard .gg-service-radios small {
  color: var(--muted, #657168);
  font-weight: 500;
}

/* A hidden radio cannot raise a native validation bubble, so an unanswered
   step one would otherwise look like a dead button. */
.gg-tiles-invalid {
  animation: gg-nudge 0.4s ease-in-out 0s 2;
}

@keyframes gg-nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .gg-tiles-invalid {
    animation: none;
    outline: 2px solid #b3261e;
    outline-offset: 4px;
  }
}

.gg-quote-wizard .gg-form-errors {
  margin-bottom: 18px;
}

.gg-quote-wizard .text-button {
  display: block;
  width: 100%;
  margin-top: 12px;
  text-align: center;
}

.gg-quote-wizard :is(input, select, textarea, button):focus-visible {
  outline: 3px solid var(--yellow, #ffd523);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------------------
   Quote dialog
   ---------------------------------------------------------------------------
   .quote-modal, .quote-modal-backdrop, .quote-modal-panel and
   .quote-modal-title all come from the ported stylesheet, including the
   bottom-sheet treatment under 760px. Only the open/closed mechanics are here.

   The dialog is inert markup until a script opens it, so `hidden` is the
   resting state and nothing below undoes that on its own.                   */

.quote-modal[hidden] {
  display: none;
}

/* Stops the page behind scrolling under the dialog. A visitor who scrolls the
   background loses their place in the page that persuaded them to ask. */
html.gg-modal-open,
html.gg-modal-open body {
  overflow: hidden;
}

.quote-modal-panel:focus {
  outline: none;
}

.quote-modal-panel:focus-visible {
  outline: 3px solid var(--yellow, #ffd523);
  outline-offset: -3px;
}

/* The dialog's copy of the wizard sits inside a panel that already has the
   card treatment, so it must not paint a second one. */
.quote-modal-panel .gg-quote-wizard {
  box-shadow: none;
  border-radius: 0;
}
