/* ========================= LEAD FORM (one form, every page) =========================
   Styles for partials/lead-form.html, the form on /contact, the 8 industry pages and the 8 /lp landings.
   Self-contained: those pages do not share a stylesheet (industry pages have no styles.css), so the form
   brings its own colours, resets and sizes.

   The layout: one card. Across its top, three step tabs with a line under each; then the step's title and,
   where it has one, a line of text; then the fields, each label on the left and its field on the right;
   then the buttons, Back on the left and the main one on the right. On a laptop the card is 38 units wide
   with 2.5 units of padding, a 12-unit label column, fields 3 units tall and 1 unit apart, and 2.5 units
   between the heading, the fields and the buttons.

   Sizes are multiples of --u, the form's unit: 16px unless the page sets --cj-lf-unit (contact.css lowers it
   in a short window, so a whole step still fits on the screen). Same proportions everywhere; each page
   decides how big one unit is. Keep sizes in units, never px, so that stays true.

   The form reads its own width through its container (cj-lf): labels go above their fields in a narrow
   column, and the card's padding and label column tighten in a medium one. The phone layout follows the
   viewport (max-width: 767px), as it always has. */

.cj-lf-host { display: block; }

.cj-lf {
  --u: var(--cj-lf-unit, 16px);
  --accent: #d8fc14;
  --fg: #f7f8f8;
  --gray: #8a8f98;
  --line: #2a2b2d;
  container: cj-lf / inline-size;
  position: relative;
  color: var(--fg);
  font-family: 'Sohne', sans-serif;
  font-size: var(--u);
  line-height: normal;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* resets the pages do not all bring */
.cj-lf *, .cj-lf *::before, .cj-lf *::after { box-sizing: border-box; }
.cj-lf :is(h1, h2, h3, p, ol, ul, fieldset, legend) { margin: 0; padding: 0; }
.cj-lf :is(button, input, select) { font: inherit; letter-spacing: normal; text-transform: none; }
.cj-lf button { border: none; background: none; cursor: pointer; color: inherit; }
.cj-lf a { text-decoration: none; color: inherit; }
.cj-lf iframe { display: block; max-width: 100%; }

.cj-lf .cj-form-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ========================= FORM CARD ========================= */
.cj-lf .ct-card {
  /* the pinned buttons bar (end of this file) reads these to reach the card's edges. Less the 1px border,
     so the card's 38 units leave 33 for its content: a 12-unit label column and a 21-unit field. */
  --lf-pad-x: calc(2.5 * var(--u) - 1px);
  --lf-pad-bottom: calc(2.5 * var(--u) - 1px);
  /* the label column of a field row */
  --lf-label: calc(12 * var(--u));
  border-radius: calc(0.75 * var(--u));
  border: 1px solid #1b1c1d;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 72%),
    linear-gradient(180deg, #111213 0%, #0a0b0c 100%);
  padding: calc(2 * var(--u) - 1px) var(--lf-pad-x) var(--lf-pad-bottom);
  position: relative;
}

/* ========================= STEP TABS ========================= */
/* Three equal tabs across the top of the card: a small state mark, the step's name and a line under both.
   The step on show and the ones already done are lit; a done step swaps its ring for a tick. */
.cj-lf .ct-tabs {
  display: flex;
  gap: calc(0.5 * var(--u));
  padding-bottom: calc(1.5 * var(--u));
}

.cj-lf .ct-tabs__tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: calc(0.375 * var(--u));
  margin: 0;
  padding: 0 0 calc(0.4375 * var(--u));
  border-bottom: 1px solid var(--line);
  font-family: 'Sohne', sans-serif;
  font-weight: 400;
  font-size: calc(0.875 * var(--u));
  line-height: 1.4;
  text-align: left;
  color: #6b6f76;
  cursor: default;
  transition: color 300ms ease, border-color 300ms ease, box-shadow 300ms ease, opacity 220ms ease;
}

.cj-lf .ct-tabs__label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* the state mark: a ring, lit on the current step */
.cj-lf .ct-tabs__icon {
  position: relative;
  flex: none;
  width: calc(0.75 * var(--u));
  height: calc(0.75 * var(--u));
  border: 1px solid #3a3b3e;
  border-radius: 50%;
  transition: border-color 300ms ease, background-color 300ms ease;
}

.cj-lf .ct-tabs__tab.is-active,
.cj-lf .ct-tabs__tab.is-completed {
  border-bottom-color: var(--accent);
  /* one more pixel of line, without moving the tabs */
  box-shadow: 0 1px 0 var(--accent);
  color: var(--fg);
}

.cj-lf .ct-tabs__tab.is-active .ct-tabs__icon { border-color: var(--accent); }

/* done: a tick on a soft disc */
.cj-lf .ct-tabs__tab.is-completed .ct-tabs__icon {
  border-color: transparent;
  background: rgba(216, 252, 20, 0.16);
}

.cj-lf .ct-tabs__tab.is-completed .ct-tabs__icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  width: 28%;
  height: 52%;
  border: solid var(--accent);
  border-width: 0 1.5px 1.5px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* a done step is a way back to it */
.cj-lf button.ct-tabs__tab.is-completed:not(:disabled) { cursor: pointer; }
.cj-lf button.ct-tabs__tab.is-completed:not(:disabled):hover { opacity: 0.8; }
.cj-lf button.ct-tabs__tab:focus-visible { outline: 2px solid rgba(247, 248, 248, 0.72); outline-offset: 3px; }

/* ========================= STEPS ========================= */
.cj-lf .ct-card__step { display: none; }

.cj-lf .ct-card__step.is-active {
  display: block;
  animation: cj-lf-step-in 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cj-lf-step-in {
  from { opacity: 0; transform: translateY(calc(1 * var(--u, 16px))); }
  to { opacity: 1; transform: translateY(0); }
}

.cj-lf .ct-card__title {
  font-family: 'Sohne', sans-serif;
  font-weight: 400;
  font-size: calc(1.625 * var(--u));
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.cj-lf .ct-card__desc {
  font-family: 'Sohne', sans-serif;
  font-weight: 400;
  font-size: calc(1.125 * var(--u));
  line-height: 1.4;
  color: var(--gray);
  margin-top: calc(0.5 * var(--u));
}

/* ========================= FIELDS ========================= */
.cj-lf .ct-card__fields {
  display: flex;
  flex-direction: column;
  gap: var(--u);
  margin-top: calc(2.5 * var(--u));
}

/* A field: its label above it (a narrow card; wider cards turn it into a row further down) */
.cj-lf .ct-card__field {
  display: flex;
  flex-direction: column;
  gap: calc(0.5 * var(--u));
  min-width: 0;
}

/* The AI prompt row stays out until "How you found us" is the AI assistant option */
.cj-lf .ct-card__field[hidden] { display: none; }

.cj-lf .ct-card__label {
  font-family: 'Sohne', sans-serif;
  font-weight: 600;
  font-size: calc(0.875 * var(--u));
  line-height: 1.4;
  color: var(--fg);
}

/* "Optional", the one mark a label carries: every other field is required */
.cj-lf .ct-card__optional {
  margin-left: 0.375em;
  color: var(--gray);
  font-weight: 400;
}

.cj-lf .ct-card__input,
.cj-lf .ct-card__select {
  width: 100%;
  height: calc(3 * var(--u));
  margin: 0;
  padding: 0 var(--u);
  border: 1px solid #1b1c1d;
  border-radius: calc(0.375 * var(--u));
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font-family: 'Sohne', sans-serif;
  font-size: var(--u);
  line-height: normal;
  transition: border-color 220ms ease, box-shadow 220ms ease;
  outline: none;
}

.cj-lf .ct-card__input::placeholder { color: #434345; }

.cj-lf .ct-card__input:focus,
.cj-lf .ct-card__select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 252, 20, 0.1);
}

.cj-lf .ct-card__input.is-invalid,
.cj-lf .ct-card__select.is-invalid {
  border-color: #f8280d;
  box-shadow: 0 0 0 3px rgba(248, 40, 13, 0.08);
}

/* One line under the field, only while its value is turned down: lead-form.js writes the reason. Empty, it
   takes no room. */
.cj-lf .ct-card__error {
  font-family: 'Sohne', sans-serif;
  font-size: calc(0.8125 * var(--u));
  line-height: 1.4;
  color: #f8280d;
}

.cj-lf .ct-card__error:empty { display: none; }

/* Select */
.cj-lf .ct-card__select-wrap { position: relative; min-width: 0; }

.cj-lf .ct-card__select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: calc(2.75 * var(--u));
  /* an option longer than the field ends in an ellipsis, clear of the arrow */
  text-overflow: ellipsis;
}

/* the arrow: a small chevron */
.cj-lf .ct-card__select-wrap::after {
  content: '';
  position: absolute;
  right: calc(1.125 * var(--u));
  top: 50%;
  width: calc(0.5 * var(--u));
  height: calc(0.5 * var(--u));
  border: solid var(--gray);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.cj-lf .ct-card__select option { background: #0e0f10; color: var(--fg); }

/* Consent: the last line of step 2, across the card */
.cj-lf .ct-card__consent {
  display: flex;
  align-items: flex-start;
  gap: calc(0.75 * var(--u));
  margin-top: calc(0.5 * var(--u));
}

.cj-lf .ct-card__checkbox {
  flex-shrink: 0;
  width: calc(1.125 * var(--u));
  height: calc(1.125 * var(--u));
  margin: calc(0.125 * var(--u)) 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* An unticked consent used to fail in silence: the button did nothing and nothing said why */
.cj-lf .ct-card__checkbox.is-invalid {
  outline: 2px solid #f8280d;
  outline-offset: 2px;
}

.cj-lf .ct-card__checkbox.is-invalid + .ct-card__consent-label { color: #ff7c6c; }

.cj-lf .ct-card__consent-label {
  font-family: 'Sohne', sans-serif;
  font-size: calc(0.875 * var(--u));
  line-height: 1.5;
  color: var(--gray);
}

.cj-lf .ct-card__consent-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: calc(0.15 * var(--u));
  transition: opacity 220ms ease;
}

.cj-lf .ct-card__consent-link:hover { opacity: 0.7; }

/* Calendar screen: the lead is already saved, so the confirmation comes first and the booking offer second */
.cj-lf .ct-card__done {
  display: flex;
  align-items: center;
  gap: calc(0.5 * var(--u));
  margin: 0 0 calc(0.75 * var(--u));
  font-family: 'Sohne', sans-serif;
  font-weight: 600;
  font-size: calc(0.875 * var(--u));
  line-height: 1.3;
  color: var(--accent);
}

.cj-lf .ct-card__done svg {
  flex: none;
  width: calc(1.125 * var(--u));
  height: calc(1.125 * var(--u));
}

/* Calendar */
.cj-lf .ct-card__calendar-shell {
  margin-top: calc(2.5 * var(--u));
  width: 100%;
  min-height: 600px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(0.5 * var(--u));
  background: #ffffff;
}

.cj-lf .ct-card__calendar-frame {
  display: block;
  width: 100%;
  min-height: 600px;
  background: #ffffff;
}

/* ========================= BUTTONS ========================= */
/* Back on the left, the main button on the right, nothing between the fields and them but air */
.cj-lf .ct-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: var(--u);
  margin-top: calc(2.5 * var(--u));
}

.cj-lf .ct-card__status {
  margin: 0;
  flex: 0 0 100%;
  order: -1;
  min-width: 0;
  color: var(--gray);
  font-family: 'Sohne', sans-serif;
  font-size: calc(0.875 * var(--u));
  line-height: 1.45;
}

.cj-lf .ct-card__status:empty { display: none; }
.cj-lf .ct-card__status[data-tone="error"] { color: #ff7c6c; }

.cj-lf .ct-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(0.5 * var(--u));
  height: calc(3 * var(--u));
  padding: 0 calc(1.5 * var(--u));
  border-radius: 100px;
  font-family: 'Sohne', sans-serif;
  font-weight: 600;
  font-size: var(--u);
  letter-spacing: calc(-0.02 * var(--u));
  line-height: 1.02;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    transform 220ms ease,
    background-color 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
}

.cj-lf .ct-card__btn:hover { transform: translateY(-1px); }

.cj-lf .ct-card__btn--next,
.cj-lf .ct-card__btn--submit {
  margin-left: auto;
  background: var(--accent);
  color: #08090a;
}

.cj-lf .ct-card__btn--next:hover,
.cj-lf .ct-card__btn--submit:hover {
  background: #e5ff4d;
  box-shadow: 0 calc(0.75 * var(--u)) calc(1.75 * var(--u)) rgba(216, 252, 20, 0.18);
}

/* Back: an outlined button */
.cj-lf .ct-card__btn--back {
  background: transparent;
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line);
}

.cj-lf .ct-card__btn--back:hover {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px #4a4b4e;
}

/* ========================= FIELD ROWS (a card wide enough for two columns) =========================
   The form reads its own width, in em, which a container query takes from the form's unit: /contact is 38
   units wide on a laptop, an industry page's column 35, a landing page hero about 31. */

/* Label on the left, field on the right. The label sits level with the middle of its field; the line that
   says why an email was turned down goes under the field, in the field's column. */
@container cj-lf (min-width: 30em) {
  .cj-lf .ct-card__field {
    display: grid;
    grid-template-columns: var(--lf-label) minmax(0, 1fr);
    align-items: center;
    gap: calc(0.375 * var(--u)) 0;
  }

  .cj-lf .ct-card__field > .ct-card__label { grid-column: 1; padding-right: calc(1.5 * var(--u)); }
  .cj-lf .ct-card__field > :not(.ct-card__label) { grid-column: 2; }

  /* "Optional" on its own line, under the label */
  .cj-lf .ct-card__optional { display: block; margin-left: 0; }
}

/* A medium column (a landing page hero, an industry page): the same rows with less padding around them and a
   slimmer label column, so the field keeps its width */
@container cj-lf (max-width: 36em) {
  .cj-lf .ct-card {
    --lf-pad-x: calc(2 * var(--u));
    --lf-pad-bottom: calc(2 * var(--u));
    --lf-label: calc(10 * var(--u));
  }

  .cj-lf .ct-card__field > .ct-card__label { padding-right: var(--u); }
  .cj-lf .ct-card__desc { font-size: var(--u); line-height: 1.45; }
  .cj-lf .ct-card__fields,
  .cj-lf .ct-card__actions,
  .cj-lf .ct-card__calendar-shell { margin-top: calc(2 * var(--u)); }
}

/* A column too narrow for three equal tabs: each tab takes the room its name needs, so none is cut. Narrower
   still, the marks go and the names and the lines stay. */
@container cj-lf (max-width: 22em) {
  .cj-lf .ct-tabs__tab { flex: 1 1 auto; }
}

@container cj-lf (max-width: 19em) {
  .cj-lf .ct-tabs__icon { display: none; }
}

/* ========================= PHONE ========================= */
/* Labels above their fields (the card is under 30 units wide), and tighter spacing: on a phone a step has to
   fit above the keyboard-less fold, so the air between rows gives way first. */
@media (max-width: 767px) {
  .cj-lf .ct-card {
    --lf-pad-x: calc(1.25 * var(--u));
    --lf-pad-bottom: calc(1.25 * var(--u));
    padding-top: calc(1.25 * var(--u));
  }

  .cj-lf .ct-tabs { gap: calc(0.375 * var(--u)); padding-bottom: var(--u); }
  .cj-lf .ct-tabs__tab { gap: calc(0.3125 * var(--u)); padding-bottom: calc(0.375 * var(--u)); font-size: calc(0.8125 * var(--u)); }
  .cj-lf .ct-tabs__icon { width: calc(0.6875 * var(--u)); height: calc(0.6875 * var(--u)); }

  .cj-lf .ct-card__title { font-size: calc(1.375 * var(--u)); }
  .cj-lf .ct-card__desc { margin-top: calc(0.25 * var(--u)); font-size: calc(0.9375 * var(--u)); line-height: 1.4; }

  .cj-lf .ct-card__fields { gap: calc(0.75 * var(--u)); margin-top: var(--u); }
  .cj-lf .ct-card__field { gap: calc(0.25 * var(--u)); }
  .cj-lf .ct-card__label { font-size: calc(0.8125 * var(--u)); }
  .cj-lf .ct-card__error { font-size: calc(0.75 * var(--u)); }

  /* 16px or more: under that, iOS Safari zooms the page in every time a field takes focus */
  .cj-lf .ct-card__input,
  .cj-lf .ct-card__select {
    height: calc(2.75 * var(--u));
    padding: 0 calc(0.75 * var(--u));
    font-size: max(16px, var(--u));
  }
  /* a slimmer arrow area: on a phone every pixel of the role list's text counts. After the shorthand above,
     which also resets the list's right padding. */
  .cj-lf .ct-card__select { padding-right: calc(2 * var(--u)); }
  .cj-lf .ct-card__select-wrap::after { right: calc(0.875 * var(--u)); }

  .cj-lf .ct-card__consent { gap: calc(0.625 * var(--u)); margin-top: calc(0.25 * var(--u)); }
  .cj-lf .ct-card__consent-label { font-size: calc(0.75 * var(--u)); line-height: 1.45; }

  /* Back and the main button on one row */
  .cj-lf .ct-card__actions {
    gap: calc(0.5 * var(--u)) calc(0.75 * var(--u));
    margin-top: calc(1.25 * var(--u));
  }
  .cj-lf .ct-card__calendar-shell { margin-top: calc(1.25 * var(--u)); }
  .cj-lf .ct-card__done { margin-bottom: calc(0.625 * var(--u)); font-size: calc(0.8125 * var(--u)); }
  .cj-lf .ct-card__status { text-align: center; }
  .cj-lf .ct-card__btn { height: calc(2.875 * var(--u)); padding: 0 calc(1.25 * var(--u)); font-size: calc(0.9375 * var(--u)); }
  .cj-lf .ct-card__actions .ct-card__btn--next,
  .cj-lf .ct-card__actions .ct-card__btn--submit {
    flex: 1 1 auto;
    margin-left: 0;
  }
}

/* The narrowest phones (after the phone rules, which it overrides): slimmer buttons, so Back and the longest main label still share one row */
@container cj-lf (max-width: 20em) {
  .cj-lf .ct-card__actions { column-gap: calc(0.5 * var(--u)); }
  .cj-lf .ct-card__actions .ct-card__btn { padding: 0 calc(0.875 * var(--u)); font-size: calc(0.875 * var(--u)); }
}

/* ========================= PINNED BUTTONS (a placement asks for it: data-lf-pin) =========================
   For a page where the form is the page (/contact). Safety net for the screens where a step still does not
   fit (small phones, a phone on its side, a window much wider than tall, the cookie strip on a first visit):
   the buttons of steps 1 and 2 stay pinned to the bottom of the window while the fields scroll under them.
   Where the step fits, they sit in their place. Other placements leave it off: there the form is one section
   of a long page, and a bar pinned to the window would show up before the form itself. */
@media (max-width: 767px), (max-height: 520px), (min-aspect-ratio: 5/2) {
  .cj-lf-host[data-lf-pin] .ct-card__step[data-step="1"] .ct-card__actions,
  .cj-lf-host[data-lf-pin] .ct-card__step[data-step="2"] .ct-card__actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: var(--u) calc(-1 * var(--lf-pad-x)) calc(-1 * var(--lf-pad-bottom));
    padding: calc(0.75 * var(--u)) var(--lf-pad-x);
    border-radius: 0 0 calc(0.75 * var(--u)) calc(0.75 * var(--u));
    background: #0a0b0c;
  }

  /* soft edge over the fields that scroll under the bar */
  .cj-lf-host[data-lf-pin] .ct-card__step[data-step="1"] .ct-card__actions::before,
  .cj-lf-host[data-lf-pin] .ct-card__step[data-step="2"] .ct-card__actions::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: calc(0.75 * var(--u));
    background: linear-gradient(to top, #0a0b0c, rgba(10, 11, 12, 0));
    pointer-events: none;
  }
}

/* First visit: the pinned bar sits on top of the cookie strip (half a unit off the bottom, about 3 units
   tall). Only under 992px: on a laptop the strip stays in the left corner, clear of the card. */
@media (max-width: 991px) {
  html.cw-banner-open .cj-lf-host[data-lf-pin] .ct-card__step[data-step="1"] .ct-card__actions,
  html.cw-banner-open .cj-lf-host[data-lf-pin] .ct-card__step[data-step="2"] .ct-card__actions {
    bottom: calc(3.75 * var(--u));
  }
}
