/* ==========================================================================
 * WattWisely — pricing page (request pricing)
 *
 * The page is a short hero, then the request form in a card with what the
 * quote contains beside it, then the shape of the model, what happens next,
 * and the FAQ. Generic form controls are styled in components.css; this file
 * holds the layout and the stepper.
 * ========================================================================== */

@layer pages {

  /* Compact: the form should be reachable without a scroll on a laptop. */
  .hero { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 4vw, 3rem); }

  .hero__lead { max-width: 44rem; }

  /* -- Layout -------------------------------------------------------------- */

  .quote-section { padding-block: 0 var(--ww-section-y); }

  .quote-layout { align-items: start; }

  /* The form is first in the DOM and first on a phone. On desktop it moves to
     the wide right-hand track of the split; `order` moves the item, not the
     tracks, so the aside lands in the narrow 5fr column as intended. */
  @media (min-width: 1024px) {
    .quote-card { order: 2; }
  }

  /* -- Aside --------------------------------------------------------------- */

  .quote-aside__title { font-size: var(--ww-step-2); }

  .quote-aside__list { margin-top: var(--ww-space-5); }

  .quote-aside__list li { font-size: var(--ww-step-0); }

  .quote-aside__note {
    margin-top: var(--ww-space-5);
    font-size: var(--ww-step--1);
    color: var(--ww-muted);
  }

  .quote-aside__contact {
    padding-top: var(--ww-space-6);
    border-top: 1px solid var(--ww-border);
  }

  .quote-aside__subtitle { font-size: var(--ww-step-1); }

  .quote-aside__contact p {
    margin-top: var(--ww-space-3);
    font-size: var(--ww-step-0);
  }

  @media (min-width: 1024px) {
    /* Stays in view while the longer stages are being filled in. */
    .quote-aside {
      position: sticky;
      top: calc(var(--ww-header-h, 4.5rem) + var(--ww-space-5));
    }
  }

  /* -- Card ---------------------------------------------------------------- */

  .quote-card {
    padding: var(--ww-space-6);
    background: var(--ww-white);
    border: 1px solid var(--ww-border);
    border-radius: var(--ww-radius-lg);
    box-shadow: var(--ww-shadow-lg);
  }

  @media (min-width: 600px) {
    .quote-card { padding: var(--ww-space-7) var(--ww-space-8); }
  }

  .quote-form .alert,
  .quote-form .form-status { margin-bottom: var(--ww-space-6); }

  .quote-form .alert a { color: var(--ww-error); }

  /* -- Stepper ------------------------------------------------------------- */

  .stepper__head { margin-bottom: var(--ww-space-6); }

  .stepper__count {
    margin: 0 0 var(--ww-space-2);
    font-size: var(--ww-step--1);
    font-weight: var(--ww-weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ww-muted);
  }

  .stepper__progress {
    height: 6px;
    background: var(--ww-border);
    border-radius: var(--ww-radius-full);
    overflow: hidden;
  }

  .stepper__bar {
    height: 100%;
    width: 0;
    background: var(--ww-primary);
    border-radius: inherit;
    transition: width 320ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  @media (prefers-reduced-motion: reduce) {
    .stepper__bar { transition: none; }
  }

  /* A fieldset has its own box model; reset it so the stages read as plain
     sections of the card. */
  .stepper__stage {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  /* Without JavaScript all stages are shown, so they need a gap between them. */
  .stepper__stage + .stepper__stage {
    margin-top: var(--ww-space-8);
    padding-top: var(--ww-space-7);
    border-top: 1px solid var(--ww-border);
  }

  .stepper__stage[hidden] { display: none; }

  /* Once the stepper runs, every visible stage after the first has a hidden
     predecessor, and the no-JS separator above must not show through. */
  .stepper__stage[hidden] + .stepper__stage {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .stepper__legend {
    padding: 0;
    font-size: var(--ww-step-2);
    font-weight: var(--ww-weight-bold);
    letter-spacing: -0.01em;
    color: var(--ww-ink);
  }

  .stepper__legend:focus { outline: none; }

  .stepper__intro {
    margin: var(--ww-space-2) 0 0;
    font-size: var(--ww-step-0);
    color: var(--ww-muted);
  }

  .stepper__fields {
    display: grid;
    gap: var(--ww-space-5);
    grid-template-columns: 1fr;
    margin-top: var(--ww-space-6);
  }

  @media (min-width: 600px) {
    .stepper__fields { grid-template-columns: repeat(2, 1fr); }
    .stepper__fields > .field { grid-column: 1 / -1; }
    .stepper__fields > .stepper__half { grid-column: auto; }
  }

  .stepper__nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--ww-space-3);
    margin-top: var(--ww-space-7);
  }

  .stepper__nav [data-stepper-back] { margin-inline-end: auto; }

  .stepper__nav [hidden] { display: none; }

  .quote-form__note {
    margin: var(--ww-space-4) 0 0;
    text-align: end;
    font-size: var(--ww-step--1);
    color: var(--ww-muted);
  }

  /* -- Model, steps, FAQ: shared components ------------------------------- */
}
