/* THE TWO-MINUTE AD CHECK, which every "Start a project" opens
   On /check it is part of the page, in a panel drawn like the pop-up.
   Everywhere else it opens in the pop-up itself. The questions use the form
   look's answer tiles and buttons (lead.css); this file adds the result, the
   recommendation and the contact step.

   Rules for what sits inside the pop-up's text block are named through their
   parent, to outrank that block's own rules for paragraphs and links. */

/* HEADINGS: the check's title, each question, the result's title and the
   headings inside the result are set like the headings on the landing pages:
   lower case, weight 800, no full stop (check.js lowers the first letter and
   drops the stop). The small labels, the marks, the answer tiles and the
   running text keep their own styles. .is-check-modal is on the pop-up while
   the check is in it, and on the panel on /check. */

.modal-window.is-check-modal .modal-info h2 {
  line-height: 1.02;
  font-weight: var(--heading-weight, 800);
  text-transform: none;
}

/* THE QUESTION */

/* A small line under the question, where it has one (hint, in
   site.config.js). It sits close under the heading, ahead of the answers. */
.modal-description .check-hint {
  max-width: var(--measure);
  margin: -16px 0 26px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  line-height: 1.5;
}

/* "Not sure" comes after the answers, and "Rather not say" after that where
   a question offers it. Both are drawn exactly like every other answer
   (lead.css): a dimmer tile with no fill read as switched off. */

/* Back on the left, Skip on the right: both always there. */
.check-nav {
  margin-top: 26px;
}

.check-nav .lead-back:disabled {
  color: rgba(255, 255, 255, 0.24);
  cursor: default;
}

.check-nav .check-skip {
  padding: 16px 0 15px 14px;
}

/* THE RESULT */

.modal-description .check-text {
  max-width: var(--measure);
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 15px;
  line-height: 1.7;
}

.modal-description .check-action {
  margin: 0 0 30px;
}

.check-rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

/* The mark on the left, on one line with the name; the answer and the
   sentence under the name. */
.modal-description .check-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 0 22px;
  align-items: start;
  margin: 0;
  padding: 20px 0 21px;
  border-bottom: 1px solid var(--line);
}

/* Not the pop-up's bulleted list. */
.modal-description .check-row::before {
  content: none;
}

.check-mark {
  justify-self: start;
  padding: 8px 11px 7px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-s);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Fix: the site's red, kept low. Good: the green of the primary pill. Worth
   finding out: a broken outline, because it is not a verdict. */
.check-row.is-fix .check-mark {
  border-color: rgba(224, 96, 114, 0.62);
  color: #f2a3ae;
  background: rgba(134, 22, 38, 0.2);
}

.check-row.is-good .check-mark {
  border-color: rgba(112, 255, 178, 0.42);
  color: rgba(185, 255, 215, 0.9);
  background: rgba(80, 255, 165, 0.035);
}

.check-row.is-unknown .check-mark {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.34);
  color: rgba(255, 255, 255, 0.7);
}

.check-name {
  margin: 0;
  padding-top: 3px;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  font-weight: var(--heading-weight, 800);
  letter-spacing: -0.02em;
}

.check-row .check-echo {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  line-height: 1.5;
}

.check-row .check-echo + .check-echo {
  margin-top: 2px;
}

.check-row .check-says {
  max-width: 560px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.6;
}

/* THE RECOMMENDATION: a block within the result. */

.check-recommend {
  margin-top: 30px;
  padding: 24px 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface-2);
}

.check-recommend .check-recommend-label {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 9px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.check-recommend-name {
  margin: 0;
  color: #fff;
  font-size: calc(clamp(22px, calc(2.1 * var(--u)), 34px) * var(--type-scale));
  line-height: 1;
  font-weight: var(--heading-weight, 800);
  letter-spacing: var(--tracking-display);
}

.check-recommend .check-recommend-why {
  max-width: 560px;
  margin: 12px 0 20px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  line-height: 1.6;
}

/* The solid button from the offer block: the links out of a result, and
   the way on from a result to the contact step. */
.modal-description .check-link,
.modal-description .check-continue {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px 14px;
  border-radius: var(--radius-m);
  color: #060606;
  font-size: 9px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
  background: var(--white);
  transition: background-color 240ms ease;
}

.modal-description .check-link span,
.modal-description .check-continue span {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  transition: transform 420ms var(--ease-cinema);
}

.modal-description .check-link:hover,
.modal-description .check-continue:hover {
  background: #fff;
}

.modal-description .check-link:hover span,
.modal-description .check-continue:hover span {
  transform: translateX(3px);
}

/* UNDER A RESULT: Back and Start again, quiet, on the left; "Start a
   project" on the right. */

.check-result-nav {
  flex-wrap: wrap;
  margin-top: 30px;
}

.check-nav-quiet {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* THE CONTACT STEP, headed "start a project": email and phone side by side
   with a small line under them (one of the two is enough), then the brand
   or website, then the box to check. */

.check-contact {
  margin: 0;
}

.check-contact-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  max-width: 640px;
}

.check-contact-fields .is-wide {
  grid-column: 1 / -1;
}

/* Email and phone, as one group. */
.check-reach {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.modal-description .check-either {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  line-height: 1.5;
}

/* "optional", beside the label of the field that can be left empty. */
.lead-field .lead-optional {
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-style: normal;
  font-weight: 500;
}

/* THE CONSENT: a box and the words beside it. The box is a real checkbox
   drawn in the fields' look: the fields' surface and border, and the accent
   when it is checked. */
.check-consent {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 0 14px;
  align-items: start;
  max-width: 640px;
  margin-top: 24px;
}

.check-consent-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-s);
  background: var(--surface-2);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color 240ms ease,
    background-color 240ms ease;
}

/* A larger area to press than the box itself. */
.check-consent-box::before {
  content: "";
  position: absolute;
  inset: -10px;
}

/* The check mark. */
.check-consent-box::after {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  opacity: 0;
  transform: translateY(-2px) rotate(-45deg);
}

.check-consent-box:checked {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.check-consent-box:checked::after {
  opacity: 1;
}

.check-consent.is-invalid .check-consent-box {
  border-color: #e06072;
  background: rgba(134, 22, 38, 0.2);
}

.modal-description .check-consent-text {
  margin: 0;
  padding-top: 2px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  line-height: 1.55;
}

.check-consent-text label {
  cursor: pointer;
}

/* The link to the privacy policy, which opens in the pop-up. */
.modal-description .check-consent-text a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  text-underline-offset: 4px;
  white-space: nowrap;
  transition: text-decoration-color 180ms ease;
}

.modal-description .check-consent-text a:hover,
.modal-description .check-consent-text a:focus-visible {
  text-decoration-color: #fff;
}

/* THE PAGE (/check) */

/* The page's title is its h1, set like the section headings on the landing
   pages: lower case, weight 800. */
.check-section .section-heading h1 {
  max-width: 900px;
  margin: 0;
  color: rgba(255, 255, 255, 0.96);
  font-size: calc(clamp(32px, calc(4.85 * var(--u)), 74px) * var(--type-scale));
  line-height: 1;
  font-weight: var(--heading-weight, 800);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.check-section {
  min-height: 100vh;
  padding-top: 168px;
}

/* The pop-up's window, set down in the page: no lift, no scroll of its own. */
.modal-window.check-panel {
  width: min(860px, 100%);
  max-height: none;
  margin: 44px 0 0;
  overflow: visible;
  transform: none;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.modal-window.check-panel .modal-info {
  padding: 44px 0 46px;
}

.check-panel #checkTitle:focus {
  outline: none;
}

/* The two links under the panel, to the landing pages. */
.check-section .service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 44px;
}

.check-section .service-actions a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transition:
    color 260ms ease,
    transform 260ms var(--ease-cinema),
    letter-spacing 320ms var(--ease-cinema);
}

.check-section .service-actions a:hover {
  color: #fff;
  transform: translateY(-1px);
  letter-spacing: 0.3em;
}

@media (max-width: 760px) {
  .modal-description .check-row {
    grid-template-columns: 1fr;
    gap: 12px 0;
    padding: 18px 0 19px;
  }

  .check-name {
    padding-top: 0;
  }

  .modal-description .check-hint {
    margin: -12px 0 22px;
  }

  .check-recommend {
    padding: 22px 18px 22px;
  }

  .check-contact-fields,
  .check-reach {
    grid-template-columns: 1fr;
  }

  .check-reach {
    gap: 16px 12px;
  }

  .check-consent {
    margin-top: 22px;
  }

  /* The way on, full width, above the quiet ways back. */
  .check-result-nav {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 6px;
  }

  .modal-description .check-continue {
    justify-content: space-between;
  }

  /* TOUCH: 44px tall for the solid buttons, and for the two small links
     under the panel (which stay where they were). */
  .modal-description .check-link,
  .modal-description .check-continue {
    min-height: 44px;
  }

  .check-section .service-actions a {
    margin: -17px 0;
    padding: 17px 0;
  }

  .check-section {
    padding-top: 112px;
  }

  .modal-window.check-panel {
    margin-top: 32px;
  }

  .modal-window.check-panel .modal-info {
    padding: 30px 0 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-description .check-link span,
  .modal-description .check-continue span {
    transition: none;
  }
}
