/*
 * ThePhoneLab careers site: the apply flow (the apply page and the thank-you page). Values from
 * the design export's apply page (Sollicitatieformulier Verkoopmedewerker Amsterdam). site.css
 * holds the tokens, the shell, the buttons, the kicker and badges, the step bar and the apply
 * grid (.apply-layout, .apply-main, .apply-aside) this file builds on; this file loads after it.
 *
 * The hidden attribute is the only toggle the scripts use (steps, follow-up questions, error
 * lines); site.css keeps it working on grid and flex elements. A field shows its error state
 * while its own error line is visible (:has), so the script never sets a class for it.
 *
 * Breakpoints as in site.css: bp-apply is 1024px (literal values in every media query).
 */

/* ---------- page ---------- */
.apply-page, .thanks-page {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) clamp(72px, 10vw, 128px);
}
.apply-head { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 36px; }
.apply-head .h1-apply { overflow-wrap: anywhere; }

/* The grid of site.css: from the apply breakpoint three equal tracks, the main column spanning
 * two and the panel beside it in the third. auto-fit alone makes only two tracks between 1024px
 * and about 1125px (three need 900px plus two gaps), so the main column filled the row and the
 * panel dropped below it. From 1125px up auto-fit makes these same three tracks. */
@media (min-width: 1024px) {
  .apply-layout { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Below it the main column takes the whole row (every track auto-fit made, never an implicit
 * one, which would scroll sideways), and the panel follows under it. */
@media (max-width: 1023px) {
  .apply-main { grid-column: 1 / -1; }
}
.apply-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
/* Below 600px only the current step shows its label (site.css); one line, running on over the
 * label-less columns after it, instead of wrapping inside its own narrow column. */
@media (max-width: 599px) {
  .steps > li.current .step-label { white-space: nowrap; }
}

/* ---------- step card ---------- */
.step-card {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: clamp(24px, 4vw, 44px);
  background: var(--tpl-white);
  border: 1px solid var(--tpl-cream-300);
  border-radius: 8px;
}
.step-head { display: flex; flex-direction: column; gap: 10px; }
.step-of { white-space: nowrap; }
.step-intro { font-size: 17px; line-height: 1.5; text-wrap: pretty; }
.step-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--tpl-cream-300);
}
.step-footer-end { justify-content: flex-end; }
/* When the footer wraps (a phone), the next or submit button keeps to the right edge. The design
 * draws these step buttons a size smaller than its large button, without a border (50 px high). */
.step-footer > .btn { margin-left: auto; gap: 10px; padding: 15px 26px; font-size: 17px; line-height: 1.2; border-width: 0; }
.step-prev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 15px 4px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: var(--tpl-ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.step-prev:hover { color: var(--tpl-red); }
/* Sending (the Turnstile run and the POST): apply.js disables the submit button, which dims and
 * shows the wait cursor. Every step button looks the same when disabled. */
.step-card button:disabled, .step-footer > .btn:disabled { opacity: .6; cursor: progress; }
/* The server's messages: a refused field, a failed send. */
.form-error { font-size: 15px; font-weight: 700; line-height: 1.5; color: var(--tpl-error); }
/* The Turnstile widget (300 x 65) is drawn into this box; the box keeps its height meanwhile. */
.tpl-turnstile { min-height: 65px; }
/* Keyboard focus on every button of the flow (the design draws none). */
.step-card button:focus-visible, .thanks-panel .btn:focus-visible { outline: 2px solid var(--tpl-ink); outline-offset: 2px; }

/* ---------- fields ---------- */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { font-size: 16px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.req { color: var(--tpl-red); }
.field > input,
.question-container > :is(input, textarea, select) {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  font-size: 17px;
  line-height: 1.4;
  color: var(--tpl-ink);
  background: var(--tpl-white);
  border: 1px solid var(--tpl-cream-300);
  border-radius: 4px;
  outline: none;
}
.question-container > textarea { resize: vertical; }
.question-container > select:not([multiple]) { padding-right: 40px; }
.field > input:focus,
.question-container > :is(input, textarea, select):focus { box-shadow: var(--focus-ring); }
.field-error { font-size: 14px; line-height: 1.4; color: var(--tpl-error); }
/* The error state, while the field's own error line shows. */
.field:has(> .field-error:not([hidden])) > input,
.question-container:has(> .field-error:not([hidden])) > :is(input, textarea, select),
.question-container:has(> .field-error:not([hidden])) > .button-grid > .answer-button,
.file:has(> .field-error:not([hidden])) .file-zone { border-color: var(--tpl-red); }

/* ---------- file zones ---------- */
.file-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* The design's 120px is the content height (its zone is content-box): 120 + 2 x 20 + 2 x 1. */
  min-height: 162px;
  padding: 20px;
  text-align: center;
  background: var(--tpl-cream);
  border: 1px dashed var(--tpl-cream-300);
  border-radius: 4px;
  transition: background-color 120ms ease-out;
}
.file-zone:hover { background: var(--tpl-row-hover); }
.file-zone:focus-within { box-shadow: var(--focus-ring); }
/* The file input lies over the whole zone, invisible: a click opens the picker and a file
 * dropped on the zone lands on the input. */
.file-zone > input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-cta { font-size: 16px; font-weight: 700; line-height: 1.2; color: var(--tpl-red); }
.file-hint { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
/* The chosen files under the zone, each with its remove button (apply.js fills the list). */
.attachments { display: flex; flex-direction: column; gap: 6px; }
.attachments:empty { display: none; }
.attachments > li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.attachments button {
  flex: none;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--tpl-red);
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* ---------- questions ---------- */
.questions { display: flex; flex-direction: column; gap: 28px; }
.question-container { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* A follow-up inside its trigger: under the trigger's answers, a line on its left ties it to them. */
.question-container .question-container { margin-top: 8px; padding-left: 16px; border-left: 2px solid var(--tpl-cream-300); }
.button-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px; }
.answer-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.35;
  text-align: left;
  color: var(--tpl-ink);
  background: var(--tpl-white);
  border: 1px solid var(--tpl-cream-300);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}
.answer-button:hover { background: var(--tpl-row-hover); }
.answer-button[aria-pressed="true"] { background: var(--tpl-selected); border-color: var(--tpl-red); }
.letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: 700;
  color: var(--tpl-ink);
  background: var(--tpl-cream-200);
  border-radius: 4px;
}
.answer-button[aria-pressed="true"] .letter { color: var(--tpl-white); background: var(--tpl-red); }
.answer-text { overflow-wrap: anywhere; }

/* ---------- preview ---------- */
.preview-group { display: flex; flex-direction: column; gap: 4px; padding-top: 18px; border-top: 1px solid var(--tpl-cream-300); }
.preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.preview-head h3 { font-size: 20px; line-height: 1.3; }
.preview-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 4px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--tpl-red);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.preview-change:hover { color: var(--tpl-red-hover); }
.preview-row, .preview-question {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 4px 24px;
  padding: 10px 0;
}
.preview-label { font-size: 15px; line-height: 1.45; color: var(--tpl-muted); overflow-wrap: anywhere; }
.preview-value { font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- consent ---------- */
.checkbox-container {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid var(--tpl-cream-300);
  font-size: 15px;
  line-height: 1.55;
  cursor: pointer;
}
.checkbox-container input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--tpl-red); }

/* ---------- chevrons after a link-styled button or link ---------- */
.link-arrow { display: inline-flex; }
.link-arrow .icon, .step-prev .icon { width: .8em; height: .8em; }

/* ---------- side panel ---------- */
.panel { overflow: hidden; background: var(--tpl-white); border: 1px solid var(--tpl-cream-300); border-radius: 8px; }
.panel-photo { aspect-ratio: 16 / 10; }
.panel-photo > img { object-position: center 22%; }
.panel-body { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.panel-title { font-size: 19px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.panel-later {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

/* ---------- thank-you ---------- */
.thanks-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.thanks-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
  padding: clamp(32px, 5vw, 56px);
}
.thanks-text .h2-thanks { overflow-wrap: anywhere; }
.thanks-lead { font-size: 18px; line-height: 1.55; text-wrap: pretty; }
.thanks-photo { min-height: 300px; }
.thanks-photo > img { object-position: 62% 30%; }
