/**
 * Guided-form wizard styles.
 * Base rules (no ".af-wizard" prefix) style the plain stacked fallback that
 * ships when apply-form.js never runs (old browser, JS disabled, or the
 * af_error=ko no-JS render) — it must stay fully usable on its own.
 * ".af-wizard …" rules only apply once JS confirmed the mustard check and
 * added the class to <html>; they turn the stack into a one-card flow.
 * No flexbox `gap` anywhere (iOS 11); spacing is done with margins.
 */

/* Plus Jakarta Sans — same self-hosted files as the modern LP1 layout
   (assets/fonts/plus-jakarta-sans, SIL OFL). latin-ext covers PL/HU/SK. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans/plus-jakarta-sans-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Page background like the applicant screens of the Interesse-Seite; the
   cards (.af-screen, .af-side) stay white. This file is only loaded by the
   form view and the builder preview, so the body rule is scoped by loading. */
body {
  background: #edf0f3;
}

.af-page {
  --af-brand: #e8551f;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  /* Hardcoded (not inherit): live LPs load Arial via lp1_style.css's body
   * rule, but the Builder-Vorschau iframe only loads this stylesheet —
   * "inherit" there falls back to the browser's serif default (Times). Both
   * contexts render identically from this one file (Plus Jakarta Sans, same
   * as the modern LP1 layout).
   *
   * font-size:16px is the ANCHOR, and every .af-* font-size below is in em
   * (not rem) on purpose — INFINA-Falle: lp_infina_style.css sets
   * `html { font-size: 62.5%; }` (root becomes 10px), so a form embedded on
   * an INFINA-styled LP would render every rem-sized element at 10px-basis
   * instead of 16px-basis if we used rem. em is relative to THIS element's
   * own font-size (16px, set right here), so the form keeps its own scale
   * regardless of what the surrounding page does to the root. lp1_style.css
   * does NOT touch the root font-size, so this only matters for INFINA LPs,
   * but the fix has to live here either way — .af-page can't know which
   * theme it's embedded in. */
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1c1c1c;
}

.af-error {
  background: #fdecea;
  border: 1px solid #f3b4ac;
  color: #7a2e22;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.95em;
}

#af-form {
  display: block;
}

/* Form controls don't inherit font-family by default. */
.af-page button,
.af-page input,
.af-page select,
.af-page textarea {
  font-family: inherit;
}

.af-hp {
  position: absolute;
  left: -9999px;
}

/* -- Base (fallback) screen styling: stacked, always visible -- */
.af-screen {
  display: block;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  padding: 20px 18px;
  margin-bottom: 16px;
}

/* display:block above beats the UA [hidden] rule — without this the no-JS form
   shows the KO and thank-you panels before anyone submits. The wizard shows a
   panel by removing the attribute. */
.af-screen[hidden] {
  display: none;
}

.af-step-of,
.af-followup-label,
.af-step-label {
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a8a8a;
  margin: 0 0 6px;
}

/* 27px (1.6875em of the 16px anchor) with 150% line-height. */
.af-question-label,
.af-contact-title {
  font-size: 1.6875em;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 14px;
}

/* Phones: 18px / 130% — at 27px long questions wrapped to 6+ lines on a
   360px screen and pushed the answers below the fold. */
@media (max-width: 767px) {
  .af-question-label,
  .af-contact-title {
    font-size: 1.125em;
    line-height: 1.3;
  }
}

.af-hint,
.af-static-hint {
  font-size: 0.9em;
  color: #6b6b6b;
  margin: 0 0 12px;
}

/* -- Option tiles: label wraps a visually-hidden native input; the input
   stays in the tab order and stays submittable. -- */
.af-option {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  border: 2px solid #e2e2e2;
  border-radius: 14px;
  padding: 10px 16px;
  margin: 0 0 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.af-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
}

.af-option-emoji {
  font-size: 1.5em;
  margin-right: 12px;
  line-height: 1;
}

.af-option-value {
  font-size: 1em;
  line-height: 1.3;
}

.af-option.af-picked {
  border-color: var(--af-brand, #e8551f);
  background-color: rgba(232, 85, 31, 0.06);
}

/* No-JS fallback: .af-picked is set by the wizard only, and the native input is
   visually hidden — mark the checked option via its text span instead. */
html:not(.af-wizard) .af-option input:checked ~ span:last-child {
  font-weight: 700;
  color: var(--af-brand, #e8551f);
}

html:not(.af-wizard) .af-option input:checked ~ span:last-child::before {
  content: "\2713\00a0";
}

/* The filled green CV "yes" tile keeps white text when checked (no-JS). */
html:not(.af-wizard) [data-af-type="cvask"] .af-option--yes input:checked ~ span:last-child {
  color: #fff;
}

/* Two separate, ungrouped rules on purpose: an old engine that doesn't
   recognize `:focus-visible` drops an entire *grouped* selector list
   (comma-separated) it can't fully parse, including the `:focus-within`
   part — which would leave the floor (Android 6 / iOS 11) with NO focus
   indicator at all. Split, an unsupported rule is dropped on its own. */
.af-option:focus-within {
  outline: 2px solid var(--af-brand, #e8551f);
  outline-offset: 2px;
}

.af-option input:focus-visible ~ .af-option-emoji {
  outline: 2px solid var(--af-brand, #e8551f);
  outline-offset: 2px;
}

.af-page textarea {
  width: 100%;
  min-height: 110px;
  border: 2px solid #e2e2e2;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  box-sizing: border-box;
  resize: vertical;
}

/* -- Contact screen: two fields per row (first/last name, country-code/phone),
   the standalone email field stays full-width. Flex + margin, no gap (iOS 11). -- */
.af-contact-row {
  display: flex;
}

.af-contact-row label {
  flex: 1 1 0;
  min-width: 0;
}

.af-contact-row label:first-child {
  margin-right: 12px;
}

.af-contact-row label,
.af-contact-title ~ label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.85em;
  color: #555;
}

.af-contact-row input,
.af-contact-row select,
.af-page label > input[type="email"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 12px 14px;
  border: 2px solid #e2e2e2;
  border-radius: 10px;
  /* px, not em: the wrapping label is 0.85em, so 1em would land at 13.6px —
     below 16px iOS zooms in on focus. */
  font-size: 16px;
}

/* -- CV upload -- */
.af-page input[type="file"] {
  display: block;
  margin: 8px 0;
}

.af-upload-status {
  font-size: 0.95em;
  color: var(--af-brand, #e8551f);
  font-weight: 600;
}

/* -- cvask thumb tiles: bigger touch targets (mockup: "Daumen" 96px) than
   the standard 52px option tile — cvask is the single 👍/👎 yes/no choice.
   cvwhy is a plain 4-item text list and stays at the standard 52px tile.
   Note: cv_yes/cv_no strings (apply_form_render.php) carry no emoji glyph
   today, so there is no .af-option-emoji to enlarge here yet — sizing-only
   parity for now; flagged in the fix-wave report as a possible render.php
   follow-up. -- */
[data-af-type="cvask"] .af-option {
  box-sizing: border-box; /* 88px incl. padding/border, like .ip-answer */
  min-height: 88px;
  align-items: center;
  padding: 16px 18px;
  border: 2px solid #c5ccd5;
  border-radius: 22px;
  font-size: 1.3125em; /* 21px */
  font-weight: 700;
  line-height: 1.2;
  background: #fff;
  color: #141922;
}

/* Yes/No tiles styled like the Interesse-Seite answers (interest-page.css
   .ip-btn-yes / .ip-btn-no): yes is always the filled green primary. */
.af-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-right: 16px;
  border-radius: 50%;
  background: #edf0f3;
  color: #141922;
}

[data-af-type="cvask"] .af-option--yes {
  border-color: #2e9726;
  background: #2e9726;
  color: #fff;
}

[data-af-type="cvask"] .af-option--yes .af-option-icon {
  background: #fff;
  color: #2e9726;
}

[data-af-type="cvask"] .af-option--yes.af-picked {
  border-color: #23731d;
  background: #23731d;
}

[data-af-type="cvask"] .af-option--no.af-picked {
  border-color: #141922;
  background: #fff;
}

.af-submit-error {
  color: #a4291b;
  font-size: 0.9em;
  margin-top: 12px;
}

/* -- Submit + nav -- */
.af-submit {
  display: block;
  width: 100%;
  background: var(--af-brand, #e8551f);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 1.05em;
  font-weight: 700;
  cursor: pointer;
}

.af-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

/* -- Progress bar (wizard mode only — meaningless on the stacked fallback) -- */
.af-progress {
  display: none;
}

/* -- Contact sidebar (views/form_apply.php → jobheld_apply_form_sidebar_html).
   Fallback (no JS): a card above the stacked questions. Wizard: sticky
   compact header on mobile, left-hand card on desktop (see below). -- */
.af-side {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.af-side-contact {
  display: flex;
  align-items: center;
}

.af-side-photo,
.af-side-initials {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  margin-right: 12px;
}

.af-side-photo {
  display: block;
  object-fit: cover;
}

.af-side-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--af-brand, #e8551f);
  color: #fff;
  font-weight: bold;
  font-size: 1.1em;
}

.af-side-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.af-side-role {
  font-size: 0.8em;
  color: #8a8a8a;
}

.af-side-name {
  font-weight: bold;
  font-size: 1.05em;
  overflow-wrap: anywhere;
}

.af-side-job {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eee;
}

.af-side-title {
  font-weight: bold;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.af-side-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9em;
  color: #555;
}

.af-side-fact {
  display: flex;
  align-items: flex-start;
}

.af-side-fact + .af-side-fact {
  margin-top: 8px;
}

.af-side-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 10px 0 0;
  color: var(--af-brand, #e8551f);
}

/* Wizard, mobile: compact sticky header — avatar + name + progress bar. */
.af-wizard .af-side {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 10px 14px;
  border-radius: 0 0 14px 14px;
  border-top: 0;
}

.af-wizard .af-side-photo,
.af-wizard .af-side-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 10px;
  font-size: 0.85em;
}

.af-wizard .af-side-job {
  display: none;
}

.af-wizard .af-side .af-progress {
  position: static;
  margin: 10px 0 0;
}

/* -- Nav bar (wizard mode only; on the fallback the native submit button
   and per-question "Weiter" affordances aren't needed — everything is
   visible at once and one native submit ends the form) -- */
.af-nav {
  display: none;
}

/* ======================================================================
   Wizard mode: JS confirmed the mustard check and took over.
   ====================================================================== */

.af-wizard .af-page {
  padding-bottom: 100px; /* room for the fixed nav bar */
}

.af-wizard .af-screen {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}

.af-wizard .af-screen.af-active {
  padding: 30px;
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
  min-height: 260px;
  justify-content: center;
}

/* Phones: 30px left only ~270px of text on a 360px screen. */
@media (max-width: 767px) {
  .af-wizard .af-screen.af-active {
    padding: 24px 20px;
  }
}

.af-wizard .af-progress {
  display: block;
  position: sticky;
  top: 0;
  height: 6px;
  background: #eee;
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
  z-index: 2;
}

.af-wizard .af-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--af-brand, #e8551f);
  transition: width 0.25s ease;
}

.af-wizard .af-nav {
  display: flex;
  align-items: center;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #e6e6e6;
  z-index: 3;
}

.af-wizard .af-nav .af-btn-back {
  margin-right: 12px;
}

.af-wizard .af-nav .af-btn-next,
.af-wizard .af-nav .af-submit {
  flex: 1 1 auto;
  margin: 0;
}

.af-btn {
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  background: #f2f2f2;
  color: #1c1c1c;
}

.af-btn-next {
  background: var(--af-brand, #e8551f);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .af-wizard .af-screen,
  .af-wizard .af-screen.af-active,
  .af-wizard .af-progress-bar,
  .af-option {
    transition: none;
  }
}

/* -- Desktop two-column split ≥768px -- */
@media (min-width: 768px) {
  .af-page {
    max-width: 960px;
    padding-top: 48px;
  }

  .af-wizard .af-page {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  /* .af-error is a sibling of .af-progress/#af-form inside .af-page (see
     views/form_apply.php) — without this it would become a third flex
     item squeezed into the sidebar/form row instead of spanning full width
     above both. */
  .af-wizard .af-error {
    order: -1;
    flex: 1 1 100%;
  }

  .af-wizard .af-progress {
    /* No explicit order: DOM order (progress inserted right before #af-form,
       see apply-form.js) plus the default order:0 on both places it as a
       left-hand sidebar, matching the margin-right below. */
    flex: 0 0 260px;
    position: sticky;
    top: 48px;
    margin-right: 40px;
    margin-bottom: 0;
    height: auto;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    padding: 20px;
  }

  .af-wizard .af-progress-bar {
    height: 6px;
    border-radius: 3px;
  }

  /* Contact sidebar: the left-hand card (replaces the bare progress card). */
  .af-wizard .af-side {
    flex: 0 0 260px;
    position: sticky;
    top: 48px;
    margin-right: 40px;
    margin-bottom: 0;
    padding: 20px;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
  }

  .af-wizard .af-side-photo,
  .af-wizard .af-side-initials {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    margin-right: 14px;
    font-size: 1.2em;
  }

  .af-wizard .af-side-job {
    display: block;
  }

  .af-wizard .af-side .af-progress {
    flex: none;
    position: static;
    margin: 16px 0 0;
    padding: 0;
    height: 6px;
    border: 0;
    border-radius: 3px;
    background: #eee;
  }

  #af-form {
    /* 1 1 0 (not "auto"): a long question label must not grow the form's
       flex-basis past the remaining space and wrap it under the sidebar. */
    flex: 1 1 0;
    min-width: 0;
  }

  .af-wizard .af-nav {
    position: static;
    border-top: none;
    padding: 20px 0 0;
    background: transparent;
  }
}

/* Small phones: cards run edge to edge, no side gutter on the page. */
@media (max-width: 499px) {
  .af-page {
    padding-left: 0;
    padding-right: 0;
  }

  /* Slimmer answer tiles; a bit more room between title and answers instead. */
  .af-option {
    min-height: 38px;
  }

  .af-question-label,
  .af-contact-title {
    margin-bottom: 20px;
  }
}

/* End panels (KO + Danke): same title scale as the questions, tight
   paragraphs (flex column: margins don't collapse), link in brand colour. */
.af-screen[data-af-type="koend"] h2,
.af-screen[data-af-type="thanks"] h2 {
  font-size: 1.6875em;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 14px;
}
.af-screen[data-af-type="koend"] p,
.af-screen[data-af-type="thanks"] p {
  margin: 0 0 12px;
}
.af-screen[data-af-type="koend"] p:last-child,
.af-screen[data-af-type="thanks"] p:last-child {
  margin-bottom: 0;
}
.af-screen[data-af-type="koend"] a {
  color: var(--af-brand, #e8551f);
  font-weight: 700;
}
@media (max-width: 767px) {
  .af-screen[data-af-type="koend"] h2,
  .af-screen[data-af-type="thanks"] h2 {
    font-size: 1.375em;
  }
}

/* Datenschutz-Karten (apply_form_privacy.php) */
.af-consent-text {
  margin: 0 0 1.25em;
  font-size: 1.05em;
  line-height: 1.5;
}
.af-consent-text a {
  color: inherit;
  text-decoration: underline;
}
.af-privacy-retry {
  margin-top: 1em;
  padding: 0.75em 1.25em;
  border: 0;
  border-radius: 10px;
  background: var(--af-brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
