/* ==========================================================================
   Coventry — lead capture layer
   Loaded after coventry.css; uses its tokens. Built to LEAD-CAPTURE-PLAYBOOK.md.

   Contrast note (§12): the design system's hairline is #E4E4E4, which is below
   the 3:1 WCAG asks of a UI boundary. Form inputs use a slightly stronger
   #C4C4C4 so a field reads as a field, and the on-dark equivalent is set to
   the same perceptual weight rather than being left fainter. Recorded here
   deliberately — see README, "Contrast deviations".
   ========================================================================== */

:root {
  --lc-line: #C4C4C4;               /* input underline, light ground */
  --lc-line-dark: rgba(255, 255, 255, .45);
  --lc-label: #5A5A5A;              /* 7.0:1 on white */
  --lc-hint: #6E6E6E;               /* 5.1:1 on white */
  --lc-placeholder: #767676;        /* 4.5:1 on white */
  --lc-error: #B4564B;              /* 4.6:1 on white */
  --lc-error-dark: #E7A79F;         /* on forest */
  --lc-label-dark: #C7D3CA;
  --lc-hint-dark: #A9BAAE;
}

/* --- Honeypot ------------------------------------------------------------
   Off-screen, never display:none — a bot that skips hidden inputs is exactly
   the bot this is meant to catch. */
.lc-hp {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* --- Form --------------------------------------------------------------- */

.lc-form {
  display: grid;
  gap: clamp(12px, 2.2vh, 22px);
  text-align: left;
}

.lc-field { display: block; }

.lc-label {
  display: block;
  font-size: 12px; line-height: 1.4; letter-spacing: .12em;
  text-transform: uppercase; color: var(--lc-label);
  margin-bottom: clamp(4px, .9vh, 9px);
}
.lc-label__hint { color: var(--lc-hint); font-weight: 300; letter-spacing: .08em; }

.lc-input {
  width: 100%;
  border: none; border-bottom: 1px solid var(--lc-line);
  background: transparent; border-radius: 0;
  padding: 0 0 clamp(6px, 1vh, 10px);
  font-size: 16px; line-height: 1.5; color: var(--ink);
  transition: border-color var(--fast) var(--ease);
}
.lc-input::placeholder { color: var(--lc-placeholder); }
.lc-input:focus { outline: none; border-bottom-color: var(--forest); }
.lc-input:focus-visible { outline: none; }

.lc-error {
  margin: 6px 0 0;
  font-size: 13px; line-height: 1.5; color: var(--lc-error);
  display: none;
}
.lc-field[data-invalid="true"] .lc-error,
.lc-consent[data-invalid="true"] + .lc-error,
.lc-error--form:not(:empty) { display: block; }
.lc-field[data-invalid="true"] .lc-input { border-bottom-color: var(--lc-error); }
.lc-error:empty { display: none; }
.lc-error--form { text-align: center; margin-top: 4px; }

/* --- Consent ------------------------------------------------------------ */

.lc-consents { display: grid; gap: 10px; }

.lc-consent {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  font-size: 13px; line-height: 1.55; color: var(--ink-2); cursor: pointer;
}
.lc-consent input {
  width: 16px; height: 16px; margin: 3px 0 0;
  accent-color: var(--forest); cursor: pointer; flex: none;
}
.lc-consent a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.lc-consent[data-invalid="true"] { color: var(--lc-error); }

/* --- Submit, reassurance, legal ----------------------------------------- */

.lc-submit { margin-top: 4px; }

.lc-note {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); text-align: center;
}
.lc-note__icon { width: 15px; height: 15px; flex: none; fill: var(--forest); }

.lc-legal {
  margin: 0; font-size: 11px; line-height: 1.5; color: var(--ink-3); text-align: center;
}
.lc-legal a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }

.lc-spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1.5px solid currentColor; border-top-color: transparent;
  display: inline-block; vertical-align: -1px;
  animation: lc-spin 700ms linear infinite;
}
@keyframes lc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lc-spinner { animation-duration: 2s; } }

/* --- On-dark treatment --------------------------------------------------
   A complete block, not patched colour by colour: labels, hints, input text,
   placeholder, underline, focus, consent text, consent links, error states
   and the phone widget's own colours. A form authored for white and dropped
   onto forest is how input text ends up at 1.05:1. */

.lc-form--dark .lc-label { color: var(--lc-label-dark); }
.lc-form--dark .lc-label__hint { color: var(--lc-hint-dark); }
.lc-form--dark .lc-input { color: #FFFFFF; border-bottom-color: var(--lc-line-dark); }
.lc-form--dark .lc-input::placeholder { color: #A9BAAE; }
.lc-form--dark .lc-input:focus { border-bottom-color: #FFFFFF; }
.lc-form--dark .lc-error { color: var(--lc-error-dark); }
.lc-form--dark .lc-field[data-invalid="true"] .lc-input { border-bottom-color: var(--lc-error-dark); }
.lc-form--dark .lc-consent { color: var(--on-forest-2); }
.lc-form--dark .lc-consent a { color: #FFFFFF; }
.lc-form--dark .lc-consent[data-invalid="true"] { color: var(--lc-error-dark); }
.lc-form--dark .lc-consent input { accent-color: #FFFFFF; }
.lc-form--dark .lc-note { color: var(--on-forest-2); }
.lc-form--dark .lc-note__icon { fill: #FFFFFF; }
.lc-form--dark .lc-legal { color: var(--on-forest-3); }
.lc-form--dark .lc-legal a { color: var(--on-forest-2); }
.lc-form--dark .iti__selected-country-primary { color: #FFFFFF; }
.lc-form--dark .iti__selected-dial-code { color: #FFFFFF; }
.lc-form--dark .iti__selected-country:hover,
.lc-form--dark .iti__selected-country-primary:hover { background: rgba(255, 255, 255, .10); }
.lc-form--dark .iti__arrow { border-top-color: rgba(255, 255, 255, .8); }

/* --- Phone widget -------------------------------------------------------
   The dial code sits beside the flag, outside the input, so the visitor types
   only their national number. The dropdown is parented to <body>, so it is
   always on a light ground and needs no dark variant. */

.iti { width: 100%; display: block; }
.iti--separate-dial-code .iti__selected-country { background: transparent; }
.iti__selected-country { border-radius: 0; }
.iti__selected-country-primary { padding: 0 6px 0 0; }
.lc-field .iti__tel-input,
.lc-field .iti input[type="tel"] { padding-left: 0; }
.iti__dropdown-content {
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  box-shadow: var(--lift);
  font-size: 15px;
}
.iti__search-input { font-size: 15px; padding: 12px 14px; }
.iti__country { padding: 9px 14px; }
.iti__country-name { color: var(--ink); }
.iti__dial-code { color: var(--ink-3); }
.iti__country.iti__highlight { background: var(--mint); }

/* --- Dialog -------------------------------------------------------------
   The form must not scroll: a scrollbar inside a lead form hides fields below
   the fold. Every internal vertical measurement is clamped against vh so the
   whole form still fits on a 700px-tall laptop. `overflow: auto` on the card
   is a floor, not a plan. */

.lc-dialog {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(16, 32, 22, .62); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(12px, 3vh, 32px);
}
.lc-dialog[hidden] { display: none; }

.lc-dialog__card {
  position: relative;
  background: var(--white); border-radius: var(--r-media);
  padding: clamp(24px, 4.6vh, 52px);
  width: 100%; max-width: 560px;
  max-height: 94vh; overflow: auto;
}
.lc-dialog__close {
  position: absolute; top: clamp(10px, 2vh, 22px); right: clamp(14px, 2.4vh, 26px);
  background: transparent; border: none; cursor: pointer;
  font-size: 26px; font-weight: 300; line-height: 1; color: var(--ink-3);
}
.lc-dialog__close:hover { color: var(--ink); }

.lc-dialog__title {
  font-size: clamp(23px, 3.4vh, 32px); line-height: 1.16; font-weight: 400;
  text-transform: uppercase; margin: 0 0 clamp(6px, 1.2vh, 14px); padding-right: 32px;
}
.lc-dialog__intro {
  font-size: 15px; line-height: 1.6; color: #6A6A6A;
  margin: 0 0 clamp(16px, 3vh, 32px); max-width: 48ch;
}
/* The mark sits against the word, so it rides the text baseline rather than
   sitting in its own column. */
.lc-messenger { white-space: nowrap; }
.lc-glyph {
  display: inline-block; vertical-align: -3px;
  width: 17px; height: 17px; margin-right: 5px;
}

/* --- Confirmation -------------------------------------------------------
   Mark, one line, acknowledgement. Nothing else: everything the visitor
   needed to know was true before they pressed the button. */

.lc-done {
  text-align: center; display: grid; gap: 16px; justify-items: center;
  padding: 8px 0 4px;
}
.lc-done__mark { height: 22px; width: auto; }
.lc-done__heading {
  margin: 0; font-size: clamp(21px, 3vh, 26px); line-height: 1.16;
  font-weight: 400; text-transform: uppercase;
}
.lc-done__heading:focus-visible { outline: 2px solid var(--forest); outline-offset: 4px; }
.lc-done__lead { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 40ch; }
.lc-done__actions { display: flex; justify-content: center; margin-top: 6px; }
.lc-done__actions .btn { min-width: 160px; }

[data-on-dark] .lc-done__lead { color: var(--on-forest-2); }
[data-on-dark] .lc-done__heading { color: #FFFFFF; }

/* --- Captcha badge -------------------------------------------------------
   Lifted clear of the sticky mobile bar, which wants the same corner. */

.grecaptcha-badge { bottom: 100px !important; z-index: 65 !important; }

/* --- Legal documents ----------------------------------------------------- */

.doc h2 {
  font-size: 17px; line-height: 1.4; letter-spacing: .03em; text-transform: uppercase;
  font-weight: 400; margin: 44px 0 14px;
}
.doc h2:first-child { margin-top: 0; }
.doc p { font-size: 16px; line-height: 1.7; color: var(--ink-2); margin: 0 0 14px; }
.doc ul { margin: 0 0 14px; padding-left: 20px; }
.doc li { font-size: 16px; line-height: 1.7; color: var(--ink-2); margin-bottom: 8px; }
.doc code {
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--mint); padding: 1px 6px; border-radius: 4px;
}
.doc a { text-decoration: underline; text-underline-offset: 2px; }

/* --- In-page lead section ------------------------------------------------ */

.cta__form-host { width: 100%; max-width: 440px; margin: 0 auto; }

/* --- CTA pairs ---------------------------------------------------------- */

.section__actions--band { margin-top: 48px; }

/* --- Responsive ---------------------------------------------------------- */

/* Section CTAs run the full width of the screen on small phones. Opt-in via
   .section__actions only — header CTAs and dialog button pairs keep their
   intrinsic width. Wrapping is re-enabled: a full-width button is wide enough
   that a two-line label is no longer the failure nowrap guards against. */
@media (max-width: 560px) {
  .section__actions { flex-direction: column; align-items: stretch; width: 100%; }
  .section__actions .btn { width: 100%; white-space: normal; }
  .quickbar { gap: 8px; padding: 8px; }
  .quickbar .btn { flex: 1 1 0; padding: 13px 8px; font-size: 11px; letter-spacing: .08em; white-space: normal; }
}

@media (max-width: 768px) {
  .grecaptcha-badge { bottom: 160px !important; }

  .lc-dialog { padding: 12px; align-items: flex-start; }
  .lc-dialog__card { max-height: 96vh; margin-top: 2vh; }
  .lc-done__actions { flex-direction: column; align-items: stretch; width: 100%; }
  .lc-done__actions .btn { width: 100%; }
}
