/* ============================================================
   Careers portal — contract preferences questionnaire
   Radio/checkbox cards on the website design system. Loaded per-page
   from pages/careers/contract.js.
   NOTE: the spacing scale has no --space-7/9/11 — 6 jumps to 8.
   ============================================================ */

.tl-qn {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
  max-width: 720px;
}

.tl-qn__head { margin-bottom: var(--space-8); }
.tl-qn__title {
  font-size: var(--fs-h2);
  font-weight: var(--weight-semibold);
  color: var(--fg-1);
  line-height: 1.2;
  margin: 0;
}
.tl-qn__lede {
  margin: var(--space-2) 0 0;
  color: var(--fg-2);
  font-size: var(--fs-small);
  line-height: 1.6;
  max-width: 60ch;
}

/* --- Card --------------------------------------------------------- */
.tl-qn-card {
  background: var(--surface-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8);
}

.tl-qn-card--guest { display: flex; flex-direction: column; align-items: flex-start; }
.tl-qn-guest__body {
  margin: 0 0 var(--space-6);
  color: var(--fg-2);
  font-size: var(--fs-body);
  line-height: 1.7;
  max-width: 62ch;
}

/* --- Question block ----------------------------------------------- */
/* fieldset resets: browsers give it default border/margin/padding. */
.tl-qn-q {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.tl-qn-q + .tl-qn-q { margin-top: var(--space-6); }

.tl-qn-q__legend {
  display: block;
  padding: 0;
  margin-bottom: var(--space-3);
}
.tl-qn-q__label {
  font-size: var(--fs-small);
  font-weight: var(--weight-medium);
  color: var(--fg-1);
  line-height: 1.4;
}
.tl-qn-q__req { color: var(--danger); }

/* Text/number questions use the shared .tl-field primitive, which brings its
   own label — cap the width so a lone input doesn't span the whole card. */
.tl-qn-q--input { max-width: 340px; }

/* --- Option cards ------------------------------------------------- */
.tl-qn-opts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.tl-qn-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5) var(--space-3) var(--space-4);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.tl-qn-opt:hover { border-color: var(--fg-3); }
.tl-qn-opt.is-selected {
  border-color: var(--navy-700);
  background: rgba(30, 47, 79, 0.04);
  box-shadow: inset 0 0 0 1px var(--navy-700);
}

/* The native control IS the indicator (appearance:none), rather than being
   hidden behind a decorative span: a zero-sized or display:none input is
   dropped from the accessibility tree, and this way native keyboard behaviour
   (arrow-key radio-group navigation, space to toggle) and the focus ring come
   for free. */
.tl-qn-opt__input {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--fg-3);
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.tl-qn-opt__input[type="checkbox"] { border-radius: 5px; }

.tl-qn-opt__input:focus-visible {
  outline: 2px solid var(--fg-link);
  outline-offset: 2px;
}

/* Radio: inner dot via an inset ring. Checkbox: a drawn tick. */
.tl-qn-opt__input:checked {
  border-color: var(--navy-700);
  background-color: var(--navy-700);
  box-shadow: inset 0 0 0 3.5px var(--surface-card);
}
.tl-qn-opt__input[type="checkbox"]:checked {
  box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");
  background-size: 14px 14px;
  background-position: center;
  background-repeat: no-repeat;
}

.tl-qn-opt__text {
  font-size: var(--fs-small);
  font-weight: var(--weight-medium);
  color: var(--fg-1);
  line-height: 1.4;
}

/* --- Native select fallback (many-option questions) --------------- */
.tl-qn-select {
  width: 100%;
  max-width: 340px;
  padding: 12px 14px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--fg-1);
  font-size: var(--fs-small);
  font-family: var(--font-sans);
  box-sizing: border-box;
}
.tl-qn-select:focus {
  outline: none;
  border-color: var(--fg-link);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* --- Card footer -------------------------------------------------- */
.tl-qn-card__foot {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-1);
}
.tl-qn-card__foot .tl-qn-status { margin-left: auto; }

/* App-scale controls: the marketing .tl-btn is 48px / 128px min-width, too
   heavy for a form screen (same treatment as the account page). */
.tl-qn .tl-btn {
  height: 40px;
  min-width: 0;
  padding: 0 var(--space-5);
  font-size: var(--fs-small);
}
.tl-qn-card--guest .tl-btn { height: 48px; padding: 0 var(--space-6); }

.tl-qn-status { font-size: 13px; font-weight: var(--weight-medium); }
.tl-qn-status--ok { color: var(--success); }
.tl-qn-status--err { color: var(--danger); }
.tl-qn-status--warn { color: var(--orange-900); }

/* --- Saved summary ------------------------------------------------ */
.tl-qn-summary {
  margin-top: var(--space-6);
  background: var(--surface-quiet);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8);
}
.tl-qn-summary__title {
  font-size: 16px;
  font-weight: var(--weight-semibold);
  color: var(--fg-1);
  margin: 0 0 var(--space-5);
}
.tl-qn-summary__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-5);
  margin: 0;
}
.tl-qn-summary__row dt {
  font-size: var(--fs-meta);
  color: var(--fg-3);
  margin: 0 0 2px;
}
.tl-qn-summary__row dd {
  margin: 0;
  font-size: var(--fs-small);
  font-weight: var(--weight-medium);
  color: var(--fg-1);
  line-height: 1.5;
}
@media (max-width: 640px) {
  .tl-qn-summary__grid { grid-template-columns: 1fr; }
}

/* --- Banners + skeleton ------------------------------------------ */
.tl-qn-banner {
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  font-size: var(--fs-small);
  line-height: 1.6;
}
.tl-qn-banner--warn {
  background: rgba(255, 165, 59, 0.10);
  border: 1px solid rgba(255, 165, 59, 0.35);
  color: var(--fg-1);
}
.tl-qn-banner--err {
  background: #FDECEC;
  border: 1px solid #F5C2C0;
  color: #A94442;
}
.tl-qn-banner strong { font-weight: var(--weight-semibold); }

.tl-qn-skel {
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface-quiet);
}
.tl-qn-skel + .tl-qn-skel { margin-top: var(--space-4); }
.tl-qn-skel--title { height: 20px; width: 40%; }

@media (max-width: 640px) {
  .tl-qn-card, .tl-qn-summary { padding: var(--space-5) var(--space-5); }
  .tl-qn-opts { flex-direction: column; align-items: stretch; }
}
