/* ==========================================================================
   PlanSig – Bewerbungsfunnel (Dialog)
   Links: „Streckenband“ mit Fortschritt als Stationen · Rechts: Fragen/Formular
   ========================================================================== */

.apply-dialog {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  margin: 0; padding: 0; border: 0; background: var(--white); color: var(--text);
}
.apply-dialog::backdrop { background: rgba(11, 22, 22, 0.72); }
.apply-dialog[open] { display: grid; animation: dlgIn 0.35s var(--ease); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(14px); } }
@media (min-width: 900px) {
  .apply-dialog { width: min(1100px, calc(100% - 3rem)); height: min(760px, calc(100% - 3rem)); margin: auto; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-pop); }
}
html.dialog-open { overflow: hidden; }

.apply { display: grid; grid-template-rows: auto 1fr; height: 100%; min-height: 0; }
@media (min-width: 900px) { .apply { grid-template-columns: 330px 1fr; grid-template-rows: 1fr; } }

/* ---- Seitenleiste ---- */
.apply__rail {
  position: relative; background: var(--ink); color: var(--white);
  padding: var(--space-4) var(--space-5); display: grid; gap: var(--space-3);
}
@media (min-width: 900px) { .apply__rail { padding: var(--space-6) var(--space-6); align-content: start; gap: var(--space-6); } }
.apply__rail-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.apply__kicker { font-size: var(--fs-sm); font-weight: 500; color: var(--brand-light); }
.apply__job { font-weight: 500; font-size: 1.1rem; line-height: 1.25; letter-spacing: -0.01em; margin-top: 0.2rem; }
@media (min-width: 900px) { .apply__job { font-size: 1.6rem; } }
.apply__job small { display: block; margin-top: 0.3rem; font-family: var(--font-body); font-size: 0.8rem; font-weight: 400; color: var(--muted-on-dark); }
.apply__close {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line-dark); border-radius: 50%; color: var(--white);
}
.apply__close:hover { background: var(--white); color: var(--ink); }
@media (min-width: 900px) { .apply__close--rail { display: none; } }
.apply__close--main { display: none; position: absolute; top: var(--space-5); right: var(--space-5); color: var(--text); border-color: var(--line-strong); z-index: 2; }
.apply__close--main:hover { background: var(--ink); color: var(--white); }
@media (min-width: 900px) { .apply__close--main { display: inline-grid; } }

/* Strecke (Fortschritt) – mobil horizontal, Desktop vertikal */
.route { list-style: none; padding: 0; display: flex; align-items: center; gap: 0; }
.route li { position: relative; flex: 1; height: 14px; }
.route li::before { /* Gleis */
  content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: #2f4545;
}
.route li.done::before, .route li.current::before { background: var(--brand); }
.route__dot {
  position: absolute; right: 0; top: 1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink); border: 2px solid #2f4545; transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.route li.done .route__dot { background: var(--brand); border-color: var(--brand); }
.route li.current .route__dot { background: var(--sig-green); border-color: var(--sig-green); box-shadow: 0 0 0 4px rgba(31,196,111,0.22), 0 0 12px rgba(31,196,111,0.8); }
.route__label { display: none; }
@media (min-width: 900px) {
  .route { flex-direction: column; align-items: stretch; }
  .route li { height: auto; flex: none; padding: 0 0 1.35rem 2rem; }
  .route li::before { left: 5px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .route li:last-child { padding-bottom: 0; }
  .route li:last-child::before { display: none; }
  .route__dot { left: 0; right: auto; top: 0.2rem; }
  .route__label { display: block; font-size: 0.88rem; color: var(--muted-on-dark); line-height: 1.35; transition: color 0.2s; }
  .route__label b { display: block; font-size: 0.78rem; font-weight: 400; color: #7e9494; }
  .route li.current .route__label, .route li.done .route__label { color: var(--white); }
}
.apply__note { display: none; font-size: 0.82rem; color: var(--muted-on-dark); line-height: 1.5; }
.apply__note .icon { color: var(--brand-light); margin-bottom: 0.4rem; }
@media (min-width: 900px) { .apply__note { display: block; margin-top: auto; } }

/* ---- Hauptbereich ---- */
.apply__main { position: relative; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.apply__body { flex: 1; padding: var(--space-6) var(--gutter) var(--space-5); width: 100%; max-width: 720px; }
@media (min-width: 900px) { .apply__body { padding: var(--space-8) var(--space-8) var(--space-5); } }
.apply__foot {
  position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--gutter); background: var(--white); border-top: 1px solid var(--line);
}
@media (min-width: 900px) { .apply__foot { padding: var(--space-4) var(--space-8); } }
.apply__foot .btn[hidden] { display: none; }
.apply__step-count { font-size: var(--fs-sm); font-weight: 500; color: var(--brand-strong); margin-bottom: var(--space-3); }
.apply__q { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 500; line-height: 1.15; }
.apply__sub { margin-top: var(--space-3); color: var(--muted); max-width: 56ch; }
.apply__step { animation: stepIn 0.4s var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateX(16px); } }
.apply__step.is-back { animation-name: stepBack; }
@keyframes stepBack { from { opacity: 0; transform: translateX(-16px); } }

/* Optionen */
.options { display: grid; gap: var(--space-2); margin-top: var(--space-6); list-style: none; padding: 0; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option label {
  display: grid; grid-template-columns: 2rem 1fr auto; gap: var(--space-3); align-items: center;
  min-height: 58px; padding: 0.7rem 1rem; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-weight: 400; line-height: 1.35; transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.option label:hover { border-color: var(--ink); }
.option__key {
  display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); font-size: 0.8rem; font-weight: 500; color: var(--muted);
  transition: all 0.15s;
}
.option__check { width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; transition: all 0.15s; }
.option--multi .option__check { border-radius: var(--radius-sm); }
.option__check .icon { width: 0.9rem; height: 0.9rem; stroke-width: 2.6; opacity: 0; }
.option input:checked + label { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.option input:checked + label .option__key { border-color: var(--brand); background: var(--brand); color: var(--white); }
.option input:checked + label .option__check { background: var(--brand); border-color: var(--brand); color: var(--white); }
.option input:checked + label .option__check .icon { opacity: 1; }
.option input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }

.apply__error { display: none; margin-top: var(--space-3); color: var(--sig-red); font-size: 0.9rem; font-weight: 500; }
.apply__error.is-visible { display: block; }

/* Hinweis / Vorschlag */
.hint {
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5); border: 1px solid var(--line-strong); border-left: 3px solid var(--brand); border-radius: var(--radius-sm); font-size: 0.95rem;
  animation: stepIn 0.3s var(--ease);
}
.hint .icon { color: var(--brand-strong); margin-top: 0.1rem; }
.hint a, .hint button { margin-top: var(--space-2); }

/* ---- Formular ---- */
.form-grid { display: grid; gap: var(--space-4); margin-top: var(--space-6); }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .field--full { grid-column: 1 / -1; } }
.field { display: grid; gap: 0.4rem; }
.field label, .field .field__label { font-size: 0.88rem; font-weight: 600; }
.field label .opt { font-weight: 400; color: var(--muted); }
.field label .req { color: var(--brand-strong); }
.input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 0.75rem 0.9rem; background: var(--white);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 110px; resize: vertical; }
.input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,138,137,0.25); }
.field.is-invalid .input, .field.is-invalid select { border-color: var(--sig-red); }
.field__error { display: none; font-size: 0.82rem; color: var(--sig-red); }
.field.is-invalid .field__error { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Upload */
.dropzone {
  position: relative; display: grid; justify-items: center; gap: 0.4rem; padding: var(--space-6) var(--space-4); text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--ink); }
.dropzone.is-drag { background: var(--ink); color: var(--white); }
.dropzone .icon { width: 1.8rem; height: 1.8rem; color: var(--brand-strong); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone small { color: var(--muted); font-size: 0.8rem; }
.dropzone.is-drag small { color: var(--muted-on-dark); }
.files { list-style: none; padding: 0; display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.files li { display: flex; align-items: center; gap: var(--space-3); padding: 0.55rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.9rem; }
.files li .icon { color: var(--brand-strong); }
.files li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li small { color: var(--muted); font-size: 0.8rem; }
.files button { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); }
.files button:hover { background: var(--ink); color: var(--white); }

.check { display: grid; grid-template-columns: 1.4rem 1fr; gap: var(--space-3); align-items: start; font-size: 0.9rem; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; accent-color: var(--brand-strong); }
.check a { text-decoration: underline; text-underline-offset: 2px; }

/* Antwort-Zusammenfassung */
.answers { margin-top: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius); }
.answers summary { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1rem; cursor: pointer; font-size: 0.9rem; font-weight: 600; list-style: none; }
.answers summary::-webkit-details-marker { display: none; }
.answers summary .mono { color: var(--brand-strong); font-size: 0.85rem; }
.answers dl { margin: 0; padding: 0 1rem 0.8rem; display: grid; gap: 0.6rem; font-size: 0.88rem; }
.answers dt { color: var(--muted); }
.answers dd { margin: 0; font-weight: 500; display: flex; justify-content: space-between; gap: 1rem; }
.answers dd button { font-size: 0.8rem; color: var(--brand-strong); font-weight: 600; flex: none; }
.answers dd button:hover { text-decoration: underline; }

.secure-note { display: flex; gap: 0.5rem; align-items: center; margin-top: var(--space-4); font-size: 0.8rem; color: var(--muted); }
.secure-note .icon { color: var(--brand-strong); }

/* Senden-Status */
.btn.is-loading { pointer-events: none; opacity: 0.85; }
.btn.is-loading .icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Erfolg ---- */
.success { text-align: left; }
.success__signal { display: flex; align-items: center; gap: var(--space-5); margin-bottom: var(--space-6); }
.big-signal { display: grid; gap: 8px; padding: 12px 10px; background: var(--ink); border-radius: 22px; }
.big-signal i { width: 22px; height: 22px; border-radius: 50%; background: #2c3d3d; }
.big-signal i.red { animation: sigRed 1.2s forwards; }
.big-signal i.green { animation: sigGreen 1.2s forwards; }
@keyframes sigRed { 0%, 45% { background: var(--sig-red); box-shadow: 0 0 14px var(--sig-red); } 55%, 100% { background: #2c3d3d; box-shadow: none; } }
@keyframes sigGreen { 0%, 50% { background: #2c3d3d; } 60%, 100% { background: var(--sig-green); box-shadow: 0 0 18px 2px rgba(31,196,111,0.85); } }
.success h2 { font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.5rem); }
.success p { margin-top: var(--space-3); color: var(--muted); max-width: 52ch; }

/* HR-Vorschau (nur Demo) */
.hr-preview { margin-top: var(--space-7); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.hr-preview__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: 0.75rem 1rem; background: var(--ink); color: var(--white); }
.hr-preview__head .mono { font-size: 0.8rem; color: var(--sig-yellow); }
.hr-preview__body { padding: var(--space-5); display: grid; gap: var(--space-5); }
.hr-row { display: grid; gap: var(--space-4); }
@media (min-width: 640px) { .hr-row { grid-template-columns: 1fr auto; align-items: center; } }
.hr-name { font-size: 1.35rem; font-weight: 500; line-height: 1.2; }
.hr-name small { display: block; font-family: var(--font-body); font-size: 0.82rem; font-weight: 400; color: var(--muted); margin-top: 0.2rem; }
.meter { min-width: 190px; }
.meter__top { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.82rem; font-weight: 600; }
.meter__top strong { font-size: 1.5rem; font-weight: 500; }
.meter__bar { height: 8px; margin-top: 0.35rem; background: var(--line); border-radius: 4px; overflow: hidden; }
.meter__bar span { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 4px; transition: width 1s var(--ease) 0.3s; }
.meter--high .meter__bar span { background: var(--sig-green); }
.meter--mid .meter__bar span { background: var(--brand); }
.meter--low .meter__bar span { background: var(--sig-yellow); }
.hr-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.hr-table th, .hr-table td { text-align: left; padding: 0.55rem 0; border-top: 1px solid var(--line); vertical-align: top; }
.hr-table th { width: 42%; font-weight: 500; color: var(--muted); padding-right: 1rem; }
.hr-table td { font-weight: 500; }
.hr-flags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.hr-flag { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.25rem 0.7rem; font-size: 0.85rem; font-weight: 500; border: 1px solid var(--sig-yellow); border-radius: var(--radius-sm); }
.hr-flag--ok { border-color: var(--sig-green); }
.apply__foot[hidden] { display: none; }
.answers summary .mono { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
