/* Kool Collective sollicitatieformulier — styling
   Volgt het Kool Collective Design System (tokens.json en components/bundle.css).
   Het formulier staat op een ink-vlak (bg-inverse); daarom gebruikt het de inverse varianten
   van de componenten: sf-btn--secondary sf-btn--arrow, sf-seg--inverse, sf-alert, sf-bar.

   Alles is gescoped onder .kc-apply. Aanpassen? Verander alleen de variabelen hieronder,
   of overschrijf ze in Webflow:  <style>.kc-apply { --kc-bg: transparent; }</style>
*/

/* ================= Fonts uit het design system =================
   Geserveerd vanaf de Worker (public/fonts/). De browser laadt alleen de snedes die echt gebruikt worden. */

@font-face {
  font-family: "ABC Whyte";
  src: url("fonts/ABCWhyteEdu-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ABC Whyte";
  src: url("fonts/ABCWhyteEdu-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ABC Whyte";
  src: url("fonts/ABCWhyteEdu-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ABC Whyte Inktrap";
  src: url("fonts/ABCWhyteInktrap-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ABC Whyte Inktrap";
  src: url("fonts/ABCWhyteInktrap-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Alleen de Light-snede bestaat; de cursief wordt door de browser geschuind (zie design system). */
@font-face {
  font-family: "Ivy Presto Display";
  src: url("fonts/IvyPrestoDisplay-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

.kc-apply {
  /* ---- Kleur: ruwe tokens uit het design system ---- */
  --kc-ink: #1a191f;
  --kc-graphite: #383543;
  --kc-slate: #5f5c6b;
  --kc-mist: #afabbe;
  --kc-ghost: #f7f7ff;
  --kc-white: #ffffff;
  --kc-periwinkle: #9093ff;
  --kc-periwinkle-deep: #5458d9;
  --kc-periwinkle-ink: #3a3eb8;
  --kc-periwinkle-tint: #e8e9ff;
  --kc-critical: #d93a3a;
  --kc-critical-tint: #fbe0e0;
  --kc-critical-ink: #a11f1f;

  /* ---- Kleur: aanvullingen voor ink (nog niet in het design system) ---- */
  --kc-ink-raised: #24232b;          /* veldvlak op ink */
  --kc-line-inverse: #7a768e;        /* veldrand: 4.0:1 op ink (graphite haalt 1.5:1) */
  --kc-critical-on-inverse: #ff9494; /* fouttekst op ink: 8.2:1 (critical haalt 3.8:1) */

  /* ---- Kleur: semantisch (design system: bg-inverse, text-inverse, text-inverse-muted, border-inverse) ---- */
  --kc-bg: var(--kc-ink);
  --kc-field-bg: var(--kc-ink-raised);
  --kc-text: var(--kc-ghost);
  --kc-text-muted: var(--kc-mist);
  --kc-border: var(--kc-line-inverse);
  --kc-border-quiet: var(--kc-graphite);
  --kc-border-hover: var(--kc-mist);
  --kc-accent: var(--kc-periwinkle);   /* periwinkle: accent en tekst op ink */
  --kc-focus: var(--kc-periwinkle);    /* focus-ring; op ink de lichte periwinkle (6.5:1) */
  --kc-error: var(--kc-critical-on-inverse);
  --kc-link: var(--kc-periwinkle);

  /* ---- Typografie ----
     De fonts van het design system (zie @font-face hierboven). Als terugval de namen waaronder
     koolcollective.nl dezelfde letters laadt, daarna Arial / Georgia. */
  --kc-font-sans: "ABC Whyte", Whyte, Arial, sans-serif;
  --kc-font-display: "ABC Whyte Inktrap", "Whyte Inktrap", Arial, sans-serif;
  --kc-font-accent: "Ivy Presto Display", ivypresto-display, Georgia, serif;

  /* ---- Ruimte (4-px basis), vorm en maat ---- */
  --kc-space-1: 4px;
  --kc-space-2: 8px;
  --kc-space-3: 12px;
  --kc-space-4: 16px;
  --kc-space-6: 24px;
  --kc-space-8: 32px;
  --kc-space-10: 40px;
  --kc-radius-xs: 4px;
  --kc-radius-sm: 8px;
  --kc-radius-md: 16px;
  --kc-radius-pill: 999px;
  --kc-control-sm: 32px;
  --kc-control-md: 44px;
  --kc-control-lg: 48px;
  --kc-max-width: 720px;
  --kc-padding: clamp(16px, 4vw, 40px);
}

/* ================= Basis ================= */

.kc-apply,
.kc-apply *,
.kc-apply *::before,
.kc-apply *::after {
  box-sizing: border-box;
}

/* body: ABC Whyte 300, 15/23 */
.kc-apply {
  background: var(--kc-bg);
  color: var(--kc-text);
  font-family: var(--kc-font-sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 23px;
  padding: var(--kc-padding);
  border-radius: var(--kc-radius-md);
  -webkit-font-smoothing: antialiased;
}

.kc-apply p { margin: 0; }

.kc-apply a {
  color: var(--kc-link);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* focus-ring: 2px met 2px tussenruimte, op elk interactief element */
.kc-apply :focus-visible {
  outline: 2px solid var(--kc-focus);
  outline-offset: 2px;
}

.kc-form,
.kc-success {
  max-width: var(--kc-max-width);
  margin: 0 auto;
}

.kc-form {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-8);
}

/* small: 13/19, 400 */
.kc-intro {
  font-size: 13px;
  line-height: 19px;
  font-weight: 400;
  color: var(--kc-text-muted);
}

/* ================= Voortgang (sf-bar--sm op ink) ================= */

.kc-progress {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-3);
}

/* caption: 12/16, 400 */
.kc-progress__label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: var(--kc-text-muted);
}

.kc-progress__bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--kc-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.kc-progress__item { margin: 0; }

.kc-progress__seg {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-2);
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--kc-radius-xs);
  background: none;
  color: var(--kc-text-muted);
  font: 400 12px / 16px var(--kc-font-sans);
  text-align: left;
  cursor: default;
}

.kc-progress__seg::before {
  content: "";
  display: block;
  height: 6px;
  border-radius: var(--kc-radius-pill);
  background: var(--kc-graphite);
}

.kc-progress__item[data-state="done"] .kc-progress__seg::before { background: var(--kc-ghost); }
.kc-progress__item[data-state="current"] .kc-progress__seg::before { background: var(--kc-periwinkle); }
.kc-progress__item[data-state="current"] .kc-progress__seg { color: var(--kc-text); font-weight: 500; }
.kc-progress__item[data-state="done"] .kc-progress__seg { cursor: pointer; }
.kc-progress__item[data-state="done"] .kc-progress__seg:hover { color: var(--kc-text); }
.kc-progress__seg:disabled { opacity: 1; }

/* Op een smal scherm, of bij veel stappen: alleen de balk; de stapnaam staat in de titel eronder */
@media (max-width: 560px) {
  .kc-progress__name { display: none; }
  .kc-progress__seg { min-height: 24px; justify-content: center; }
}

/* ================= Eén vraag per scherm =================
   De vraag zelf is de kop: heading-1 (Whyte Inktrap 400, 36/40, -1px); op een smal scherm heading-2. */

.kc-step--question .kc-field { gap: var(--kc-space-3); }

.kc-step--question .kc-label {
  font-family: var(--kc-font-display);
  font-weight: 400;
  font-size: 36px;
  line-height: 40px;
  letter-spacing: -1px;
  margin-bottom: var(--kc-space-1);
}

/* een legend telt niet mee in de flex-gap van de fieldset */
.kc-step--question legend.kc-label { margin-bottom: var(--kc-space-4); }

.kc-step--question .kc-label .kc-optional {
  font-family: var(--kc-font-sans);
  font-size: 15px;
  letter-spacing: 0;
  white-space: nowrap;
}

.kc-step--question .kc-hint,
.kc-step--question .kc-file-info,
.kc-step--question .kc-error {
  font-size: 15px;
  line-height: 23px;
}

.kc-step--question .kc-hint { margin-top: calc(-1 * var(--kc-space-2)); }

.kc-step--question .kc-textarea { min-height: 200px; }

@media (max-width: 560px) {
  .kc-step--question .kc-label {
    font-size: 22px;
    line-height: 28px;
    letter-spacing: -0.5px;
  }
}

/* ================= Stappen ================= */

.kc-step {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-6);
  animation: kc-step-in 0.25s ease;
}

.kc-step[hidden] { display: none; }

@keyframes kc-step-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.kc-step__header {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-2);
  margin-bottom: var(--kc-space-2);
}

/* heading-1: Whyte Inktrap 400, 36/40, -1px */
.kc-step__title {
  margin: 0;
  font-family: var(--kc-font-display);
  font-weight: 400;
  font-size: 36px;
  line-height: 40px;
  letter-spacing: -1px;
  color: var(--kc-text);
}

.kc-step__title:focus { outline: none; }

.kc-step__intro { color: var(--kc-text-muted); }

/* ================= Velden (sf-field + sf-input) ================= */

.kc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.kc-fieldset {
  border: 0;
  padding: 0;
}

/* sf-field: 500 13/1.3 */
.kc-label {
  padding: 0;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.3;
  color: var(--kc-text);
}

.kc-optional {
  font-weight: 400;
  color: var(--kc-text-muted);
}

/* sf-field__hint en sf-field__error: 400, zelfde maat als het label */
.kc-hint,
.kc-file-info,
.kc-error {
  font-weight: 400;
  font-size: 13px;
  line-height: 1.3;
  color: var(--kc-text-muted);
}

.kc-error { color: var(--kc-error); }
.kc-error[hidden],
.kc-file-info:empty { display: none; }

/* sf-input: control-md, radius-sm, 0 14px, 300.
   Afwijking: 16px in plaats van 15px, omdat iOS bij kleinere invoer inzoomt. */
.kc-input {
  width: 100%;
  min-height: var(--kc-control-md);
  padding: 9px 14px;
  background: var(--kc-field-bg);
  color: var(--kc-text);
  border: 1px solid var(--kc-border);
  border-radius: var(--kc-radius-sm);
  font: 300 16px / 24px var(--kc-font-sans);
  -webkit-appearance: none;
  appearance: none;
}

.kc-input:hover { border-color: var(--kc-border-hover); }

/* focus: 2px rand in focus-ring, padding 1px kleiner zodat niets verspringt */
.kc-input:focus,
.kc-input:focus-visible {
  outline: none;
  border: 2px solid var(--kc-focus);
  padding: 8px 13px;
}

.kc-textarea {
  min-height: 152px;
  resize: vertical;
}

/* fout: aria-invalid geeft een critical-rand */
.kc-input[aria-invalid="true"],
.kc-file[aria-invalid="true"] {
  border-color: var(--kc-error);
}

.kc-input[aria-invalid="true"]:focus { border-color: var(--kc-focus); }

/* ================= Plek kiezen (sf-seg--inverse, verticaal) ================= */

.kc-choices {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-2);
  margin-top: 2px;
}

.kc-choice {
  display: flex;
  align-items: center;
  gap: var(--kc-space-3);
  min-height: var(--kc-control-md);
  padding: 0 var(--kc-space-4);
  border: 1px solid var(--kc-border);
  border-radius: var(--kc-radius-pill);
  background: transparent;
  color: var(--kc-text);
  font: 400 15px / 1.3 var(--kc-font-sans);
  cursor: pointer;
}

.kc-choice:hover { border-color: var(--kc-border-hover); }

/* geselecteerd: zoals sf-seg--inverse button[aria-pressed="true"] */
.kc-choice:has(input:checked) {
  background: var(--kc-ghost);
  border-color: var(--kc-ghost);
  color: var(--kc-ink);
  font-weight: 500;
}

.kc-field--invalid .kc-choice { border-color: var(--kc-error); }

.kc-choice input,
.kc-check input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  margin: 0;
  border: 1.5px solid var(--kc-mist);
  background: transparent;
  cursor: pointer;
}

.kc-choice input {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.kc-choice input:checked {
  border-color: var(--kc-ink);
  background: radial-gradient(circle, var(--kc-ink) 0 4px, transparent 4.5px);
}

/* ================= Vinkjes ================= */

.kc-check {
  display: flex;
  gap: var(--kc-space-3);
  align-items: flex-start;
}

.kc-check label {
  cursor: pointer;
  font-weight: 300;
}

/* aanvinkvlak: periwinkle met ink-vinkje (zoals sf-btn--confirm) */
.kc-check input {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: var(--kc-radius-xs);
}

.kc-check input:checked {
  border-color: var(--kc-periwinkle);
  background: var(--kc-periwinkle)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A191F' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 16px no-repeat;
}

.kc-field--invalid .kc-check input { border-color: var(--kc-error); }

.kc-field--consent .kc-hint,
.kc-field--consent .kc-error {
  padding-left: calc(22px + var(--kc-space-3));
}

/* ================= Bestand ================= */

.kc-file {
  width: 100%;
  min-height: 60px;
  padding: var(--kc-space-3);
  border: 1px dashed var(--kc-border);
  border-radius: var(--kc-radius-sm);
  background: var(--kc-field-bg);
  color: var(--kc-text-muted);
  font: 400 13px var(--kc-font-sans);
  cursor: pointer;
}

.kc-file:hover { border-color: var(--kc-border-hover); }

/* sf-btn--on-inverse, compact */
.kc-file::file-selector-button {
  height: 36px;
  margin-right: var(--kc-space-3);
  padding: 0 18px;
  border: 0;
  border-radius: var(--kc-radius-pill);
  background: var(--kc-ghost);
  color: var(--kc-ink);
  font: 500 14px var(--kc-font-sans);
  cursor: pointer;
}

/* ================= Honeypot ================= */

.kc-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.kc-turnstile:empty { display: none; }

/* ================= Meldingen (sf-alert) ================= */

.kc-alert {
  display: flex;
  gap: var(--kc-space-4);
  align-items: center;
  padding: var(--kc-space-4) 18px;
  border-radius: var(--kc-radius-md);
}

.kc-alert[hidden] { display: none; }

.kc-alert__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.kc-alert__icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kc-alert__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kc-alert__title {
  font: 500 15px / 1.35 var(--kc-font-sans);
  color: var(--kc-ink);
}

.kc-alert__text {
  font: 400 13px / 1.45 var(--kc-font-sans);
}

.kc-alert__text:empty { display: none; }

.kc-alert--critical { background: var(--kc-critical-tint); }
.kc-alert--critical .kc-alert__icon { background: var(--kc-critical); color: var(--kc-white); }
.kc-alert--critical .kc-alert__text { color: var(--kc-critical-ink); }

.kc-alert--info { background: var(--kc-periwinkle-tint); }
.kc-alert--info .kc-alert__icon { background: var(--kc-periwinkle-deep); color: var(--kc-white); }
.kc-alert--info .kc-alert__text { color: var(--kc-periwinkle-ink); }

/* ================= Knoppen (sf-btn) ================= */

.kc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--kc-space-2);
  flex-wrap: wrap;
}

/* Primaire actie op ink: sf-btn--secondary sf-btn--arrow (ghost-pil, ink-cirkel met ↗) */
.kc-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--kc-space-3);
  height: var(--kc-control-lg);
  margin-left: auto;
  padding: 0 6px 0 22px;
  border: 1px solid var(--kc-ghost);
  border-radius: var(--kc-radius-pill);
  background: var(--kc-ghost);
  color: var(--kc-ink);
  font: 400 15px / 1 var(--kc-font-sans);
  white-space: nowrap;
  cursor: pointer;
}

.kc-btn__circle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--kc-ink);
  color: var(--kc-ghost);
}

.kc-btn__circle svg,
.kc-btn-ghost svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kc-btn:hover .kc-btn__circle { background: var(--kc-graphite); }

/* Vorige: outline-knop op ink (rand border-inverse, ghost-tekst) */
.kc-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--kc-space-2);
  height: var(--kc-control-md);
  padding: 0 20px 0 14px;
  border: 1px solid var(--kc-border-quiet);
  border-radius: var(--kc-radius-pill);
  background: transparent;
  color: var(--kc-text);
  font: 400 14px / 1 var(--kc-font-sans);
  white-space: nowrap;
  cursor: pointer;
}

.kc-btn-ghost[hidden] { display: none; }
.kc-btn-ghost:hover { border-color: var(--kc-mist); }
.kc-btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* Laden */
.kc-spinner {
  display: none;
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(247, 247, 255, 0.3);
  border-top-color: var(--kc-ghost);
  border-radius: 50%;
  animation: kc-spin 0.8s linear infinite;
}

.kc-btn--loading { cursor: progress; }
.kc-btn--loading .kc-btn__circle svg { display: none; }
.kc-btn--loading .kc-spinner { display: block; }

@keyframes kc-spin { to { transform: rotate(360deg); } }

/* ================= Gelukt ================= */

.kc-success {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-4);
  padding: var(--kc-space-8) 0;
}

/* zoals sf-avatar--accent: periwinkle vlak, ink-icoon */
.kc-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--kc-periwinkle);
  color: var(--kc-ink);
}

.kc-success__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* display: Whyte Inktrap 400, 48/48, -1.8px; op een smal scherm heading-1 */
.kc-success__title {
  margin: 0;
  font-family: var(--kc-font-display);
  font-weight: 400;
  font-size: 48px;
  line-height: 48px;
  letter-spacing: -1.8px;
  color: var(--kc-text);
}

.kc-success__title:focus { outline: none; }

/* accent: Ivy Presto Display Light, cursief, -0.5px. Eén woord per kop. */
.kc-accent {
  font-family: var(--kc-font-accent);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.5px;
}

.kc-success__text {
  max-width: 52ch;
  color: var(--kc-text-muted);
}

.kc-success__text strong {
  color: var(--kc-text);
  font-weight: 500;
}

@media (max-width: 560px) {
  .kc-success__title {
    font-size: 36px;
    line-height: 40px;
    letter-spacing: -1px;
  }
}

/* ================= Toegankelijkheid ================= */

@media (prefers-reduced-motion: reduce) {
  .kc-apply *,
  .kc-apply *::before,
  .kc-apply *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .kc-choice input:checked,
  .kc-check input:checked { background: Highlight; }
}
