/* ==========================================================================
   Get a quote

   The header's call to action opens this rather than sending the reader to the
   contact page. It is a native <dialog>: the browser gives us the backdrop, the
   top layer, Escape to close, the focus trap and the inertness of everything
   behind it, none of which is worth reimplementing and all of which is easy to
   get wrong by hand.

   The trigger stays an <a href="contact.html">. The script cancels the click
   and opens the dialog; with JavaScript off, or before it loads, the link goes
   to the contact page and the form there does the same job. Nothing depends on
   the script to be reachable.

   Its own stylesheet because it appears on every page including the homepage,
   and the homepage loads style.css only. Adding page.css there to carry one
   component would pull in eleven hundred lines the homepage does not use.
   ========================================================================== */
.quotebox {
  /* Centred explicitly. A modal dialog is centred by the browser's own
     `margin: auto`, and something in style.css resets it to 0, which pinned
     the panel to the top left corner. Depending on a UA default that another
     stylesheet can knock out is not a dependency worth having. */
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(560px, calc(100vw - 32px));
  max-height: min(92svh, 780px);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #15181B;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15, 17, 21, .28);
}
.quotebox::backdrop { background: rgba(15, 17, 21, .55); backdrop-filter: blur(3px); }

/* Opening and closing. A dialog is display:none when shut, so the closing
   animation has to be driven from the element's own transition rather than a
   class: allow-discrete keeps it in the layout long enough to be seen out.

   Both states are declared rather than left to the browser. This component was
   called .quote until a class of that name in style.css -- the testimonial card
   on the homepage -- reached it and gave it `display: flex`. An author rule
   beats the browser's own `dialog:not([open]) { display: none }`, so the shut
   dialog stayed in the layout on every page: invisible at opacity 0, 549x692,
   fixed over the middle of the viewport, swallowing every click that landed on
   it and holding its eight fields in the tab order. Nothing errored and nothing
   looked wrong. The block is namespaced now, and saying it here as well means
   the next collision cannot put it back. */
.quotebox:not([open]) { display: none; }
.quotebox[open] { display: block; }
.quotebox { opacity: 0; transform: translateY(14px) scale(.98); }
.quotebox[open] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .quotebox {
    transition: opacity .28s cubic-bezier(.4, 0, .2, 1),
                transform .28s cubic-bezier(.33, 1, .68, 1),
                overlay .28s allow-discrete,
                display .28s allow-discrete;
  }
  @starting-style { .quotebox[open] { opacity: 0; transform: translateY(14px) scale(.98); } }
  .quotebox::backdrop { transition: opacity .28s ease, overlay .28s allow-discrete, display .28s allow-discrete; }
}

.quotebox__form { display: block; max-height: inherit; overflow-y: auto; padding: 30px; }
@media (min-width: 560px) { .quotebox__form { padding: 32px 40px 28px; } }

.quotebox__head { display: grid; gap: 10px; margin-bottom: 22px; padding-right: 40px; }
.quotebox__eyebrow {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #BE1622;
}
.quotebox h2 {
  margin: 0;
  font-family: "Inter Tight", "Inter", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  color: #15181B;
}
.quotebox__head p { margin: 0; font-size: 16px; line-height: 1.7; color: #454C52; }

/* Top right, over the heading rather than in the flow, so the heading keeps
   the full width of the panel to wrap in. */
.quotebox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #E3E6EA;
  border-radius: 50%;
  background: #fff;
  color: #15181B;
  font-size: 18px;
  cursor: pointer;
  transition: background-color .3s cubic-bezier(.4, 0, .2, 1), color .3s cubic-bezier(.4, 0, .2, 1),
              border-color .3s cubic-bezier(.4, 0, .2, 1);
}
.quotebox__close:hover { background: #15181B; border-color: #15181B; color: #fff; }

.quotebox__grid { display: grid; gap: 14px; }
@media (min-width: 560px) { .quotebox__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } }
.quotebox__field { display: grid; gap: 8px; }
.quotebox__field label { font-size: 14px; font-weight: 500; color: #15181B; }
.quotebox__field label span { color: #BE1622; }
.quotebox__field input,
.quotebox__field select,
.quotebox__field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #E3E6EA;
  border-radius: 3px;
  background: #fff;
  color: #15181B;
  font-family: inherit;
  font-size: 16px;   /* 16 or smaller triggers zoom-on-focus in iOS Safari */
  line-height: 1.4;
  transition: border-color .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s cubic-bezier(.4, 0, .2, 1);
}
.quotebox__field textarea { min-height: 92px; resize: vertical; }
.quotebox__field input:focus,
.quotebox__field select:focus,
.quotebox__field textarea:focus {
  outline: none;
  border-color: #BE1622;
  box-shadow: 0 0 0 3px rgba(190, 22, 34, .14);
}
/* Sticky, so the one button that matters is on screen whatever the height of
   the window. A six-field form does not fit a laptop's viewport once the
   browser chrome is taken off it, and a submit button you have to find by
   scrolling is a submit button a share of people never reach. The gradient
   lets the fields pass under it instead of meeting a hard edge. */
.quotebox__actions {
  position: sticky;
  bottom: -28px;
  margin-top: 22px;
  padding-block: 16px 28px;
  background: linear-gradient(to top, #fff 62%, rgba(255, 255, 255, 0));
}
.quotebox__submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid #BE1622;
  border-radius: 3px;
  background: #BE1622;
  color: #fff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .3s cubic-bezier(.4, 0, .2, 1), border-color .3s cubic-bezier(.4, 0, .2, 1);
}
.quotebox__submit:hover { background: #9E121C; border-color: #9E121C; }

/* Netlify reads this field; a bot that fills it in is discarded. */
.quotebox__bot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
