/* =====================================================================
   WeVo - Bewerbungs-Wizard (additiv zu dynamic-jobs.css)
   ===================================================================== */

.apply-section { padding: 2.5rem 0 4rem; background: #fff; }
.apply-grid {
    display: grid; gap: 2.5rem;
    grid-template-columns: 1fr;
    align-items: start;
}
@media (min-width: 920px) {
    .apply-grid { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
}

/* ---- Sidebar mit Job-Summary ---- */
.apply-summary { background: var(--wv-sand, #f2eee5); border-radius: var(--wv-radius, 12px); padding: 1.5rem; position: sticky; top: 1rem; }
.apply-summary .kicker { text-transform: uppercase; letter-spacing: .1em; color: var(--wv-green, #00733b); font-weight: 600; margin: 0 0 .3rem; font-size: .8rem; }
.apply-summary__title { margin: 0 0 1rem; font-size: 1.3rem; line-height: 1.25; }
.apply-summary__title small { color: var(--wv-muted, #5d6770); font-weight: 400; }
.apply-summary__back { display: inline-block; margin-top: 1rem; color: var(--wv-green-d, #005c2f); font-weight: 600; }

.apply-hint { margin-top: 1.5rem; background: #fff; border: 1px solid var(--wv-border, #e1e5e8); border-radius: 10px; padding: 1rem 1.25rem; }
.apply-hint h3 { font-size: .92rem; margin: 0 0 .5rem; color: var(--wv-green-d); text-transform: uppercase; letter-spacing: .04em; }
.apply-hint ol { padding-left: 1.2rem; margin: 0; font-size: .92rem; }
.apply-hint .muted { color: var(--wv-muted); font-size: .86rem; margin-top: .75rem; }

/* ---- Stepper ---- */
.wizard-steps {
    list-style: none; padding: 0; margin: 0 0 1.5rem;
    display: flex; gap: 0;
    counter-reset: step;
    border: 1px solid var(--wv-border, #e1e5e8); border-radius: 12px; overflow: hidden;
    background: #fafbfc;
}
.wizard-step {
    flex: 1; padding: .85rem 1rem; font-weight: 600; color: var(--wv-muted, #5d6770);
    display: flex; align-items: center; gap: .65rem;
    position: relative;
}
.wizard-step + .wizard-step::before { content: '›'; color: var(--wv-muted); margin-right: .25rem; }
.wizard-step span {
    display: inline-grid; place-items: center; width: 26px; height: 26px;
    border-radius: 50%; background: #fff; color: var(--wv-muted); border: 1px solid var(--wv-border);
    font-size: .85rem;
}
.wizard-step.is-active { color: var(--wv-green-d, #005c2f); background: #fff; }
.wizard-step.is-active span { background: var(--wv-green, #00733b); color: #fff; border-color: var(--wv-green); }
.wizard-step.is-done span { background: #d0e8d8; color: var(--wv-green-d); border-color: #b6d9c4; }

/* ---- Panes ---- */
.apply-form { background: transparent; }
.wizard-pane {
    background: #fff; border: 1px solid var(--wv-border, #e1e5e8);
    border-radius: 12px; padding: 1.75rem;
    margin: 0; box-shadow: 0 2px 8px rgba(20,30,40,.04);
}
/* Konsistenter vertikaler Abstand zwischen allen direkten Kindern
   (Field, Grid, Wizard-Actions ...) - das vermeidet Margin-Spruenge,
   ohne flex auf <fieldset> einsetzen zu muessen (was Legend bricht). */
.wizard-pane > * + * { margin-top: 1.1rem; }
.wizard-pane[hidden] { display: none !important; }
.wizard-pane legend {
    padding: 0 .35rem; color: var(--wv-green-d, #005c2f); text-transform: uppercase;
    letter-spacing: .06em; font-weight: 700; font-size: .82rem;
    margin-bottom: .25rem;
}

/* ---- Form-Felder ----
   Wichtig: KEIN globales `margin: 0` auf .field, sonst killt es das
   `.wizard-pane > * + * { margin-top: 1.1rem }`-Pattern fuer direkt
   eingebettete .field-Elemente (Anrede, Strasse, Geburtsdatum). */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field__label { font-weight: 600; font-size: .9rem; color: var(--wv-text); line-height: 1.3; }
.field__hint  { color: var(--wv-muted); font-size: .8rem; line-height: 1.4; margin-top: .1rem; }
.field__error { color: #b3261e; font-size: .82rem; margin-top: .1rem; }
.field__input {
    font: inherit;
    padding: 0 .9rem;       /* Vertikales Spacing kommt aus height + line-height,
                               damit Inputs/Selects/Date-Inputs garantiert gleich gross sind. */
    height: 2.75rem;        /* Feste Hoehe statt min-height (browserkonsistent) */
    line-height: 2.75rem;   /* Vertikale Mitte ohne Padding-Tricks */
    border: 1px solid var(--wv-border, #e1e5e8);
    border-radius: 8px;
    background: #fff;
    color: var(--wv-text);
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}
.field__input:focus { outline: 2px solid var(--wv-green, #00733b); outline-offset: 1px; border-color: var(--wv-green); }
.field--error .field__input { border-color: #b3261e; }

/* Textarea: keine feste Hoehe, line-height fuer Lesbarkeit. */
textarea.field__input { height: auto; line-height: 1.5; padding: .65rem .9rem; min-height: 5rem; resize: vertical; }

/* File-Input: native Button-Optik beibehalten, leicht eingerueckt. */
input[type=file].field__input { height: auto; line-height: 1.5; padding: .55rem .85rem; }

/* Select bekommt eigenen Caret-Pfeil (sonst sehen sie in Firefox/Safari anders aus als Inputs) */
select.field__input {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2300733b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right .85rem center;
    background-size: 14px;
    padding-right: 2.5rem;
}

/* Date-Input: konsistente Ziffernbreite, damit der Datepicker-Wert nicht zappelt. */
input[type=date].field__input,
input[type=datetime-local].field__input { font-variant-numeric: tabular-nums; }

.field--checkbox { flex-direction: row; align-items: flex-start; gap: .65rem; }
.field--checkbox input { margin-top: .35rem; flex-shrink: 0; }
.field--checkbox span { line-height: 1.45; }

/* ---- Grid (mehrspaltige Reihen) ---- */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
/* Innerhalb einer Grid-Reihe haben Fields keinen eigenen Margin - der Spacing
   zwischen Reihen kommt vom Wizard-Pane-Gap. */
.grid .field { margin: 0 !important; }

/* "Halbes" Standalone-Feld (z.B. Anrede): Eingabefeld wird auf etwa
   halbe Breite begrenzt, ohne Grid-Hack mit leerem Span. */
@media (min-width: 600px) {
    .field--half .field__input { max-width: calc(50% - .5rem); }
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    font: inherit; font-weight: 600; padding: .65rem 1.25rem;
    border: 1px solid transparent; border-radius: 8px; cursor: pointer;
    text-decoration: none;
}
.btn:hover { filter: brightness(.96); }
.btn--primary { background: var(--wv-green, #00733b); color: #fff; }
.btn--ghost   { background: transparent; color: var(--wv-text); border-color: var(--wv-border); }
.btn--lg      { padding: .85rem 1.5rem; font-size: 1.05rem; }

.wizard-actions {
    display: flex; gap: .75rem; justify-content: space-between;
    /* Wizard-Pane-Gap kuemmert sich um vertikalen Abstand zu vorherigem Feld;
       hier nur die optische Trennung durch Linie + extra Abstand nach oben. */
    margin-top: .5rem; padding-top: 1.25rem; border-top: 1px solid var(--wv-border);
}
.wizard-actions [data-next] { margin-left: auto; }

/* ---- Honeypot ---- */
.hp { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; overflow: hidden; }

/* ---- Alerts ---- */
.alert { padding: .85rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert--error { background: #fdecea; color: #7a1d1d; border-color: #f4c4c0; }

/* ---- Review-Block in Step 3 ---- */
.review-block { background: var(--wv-sand, #f2eee5); border-radius: 10px; padding: 1.25rem; margin-bottom: 1.25rem; }
.review-block h3 { margin: 0 0 .75rem; color: var(--wv-green-d); }
.review-list {
    display: grid; grid-template-columns: 180px 1fr;
    gap: .25rem 1rem; margin: 0; font-size: .95rem;
}
.review-list dt { color: var(--wv-muted); }
.review-list dd { margin: 0; word-break: break-word; }
.review-list__sep { grid-column: 1 / -1; margin-top: .75rem; font-weight: 700; color: var(--wv-green-d); text-transform: uppercase; letter-spacing: .05em; font-size: .82rem; }

.consent-box { padding: 1rem 1.25rem; background: #fafbfc; border: 1px solid var(--wv-border); border-radius: 10px; margin-bottom: 1rem; }
.consent-box a { color: var(--wv-green-d); }

/* ---- Thanks Page ---- */
.apply-thanks { padding: 3rem 0; background: #fff; }
.apply-thanks__card {
    max-width: 700px; margin: 0 auto;
    background: var(--wv-sand, #f2eee5); border-radius: 14px; padding: 2.5rem; text-align: center;
}
.apply-thanks__icon {
    width: 64px; height: 64px; margin: 0 auto 1rem;
    display: grid; place-items: center; border-radius: 50%;
    background: var(--wv-green, #00733b); color: #fff; font-size: 2rem;
}
.apply-thanks__reference {
    font-family: ui-monospace, Consolas, monospace; font-size: 1.5rem; letter-spacing: .05em;
    background: #fff; border: 1px solid var(--wv-border); border-radius: 8px;
    padding: .8rem 1.2rem; display: inline-block; margin: 1rem 0;
}

/* =====================================================================
   Mobile-Anpassungen (alles <= 760px)
   ===================================================================== */
@media (max-width: 760px) {

    /* Generelles Spacing zurueckdrehen, damit der Wizard nicht "klotzt" */
    .apply-section { padding: 1.25rem 0 2rem; }
    .apply-grid    { gap: 1.25rem; }
    .jobs-container { padding: 0 .9rem; }

    /* Sidebar mit Job-Info: NICHT sticky auf Mobile (in Single-Column nutzlos) */
    .apply-summary {
        position: static;
        padding: 1.1rem 1.2rem;
    }
    .apply-summary__title { font-size: 1.15rem; }
    .apply-hint { padding: .9rem 1rem; }
    .apply-hint h3 { font-size: .85rem; }

    /* Wizard-Pane: weniger Padding, damit die Inputs nicht eingeschnuert wirken */
    .wizard-pane { padding: 1.1rem 1rem; border-radius: 10px; }

    /* Wizard-Steps: nur Zahlen + kuerzere Labels, kein Wrap */
    .wizard-steps { font-size: .82rem; }
    .wizard-step  { padding: .65rem .6rem; gap: .4rem; min-width: 0; }
    .wizard-step span { width: 22px; height: 22px; font-size: .78rem; flex-shrink: 0; }
    .wizard-step + .wizard-step::before { display: none; } /* Pfeil weg */

    /* Field-Half wieder volle Breite (war ja nur Desktop) */
    .field--half .field__input { max-width: 100%; }

    /* Inputs etwas grosszuegiger fuer Touch-Bedienung */
    .field__input { height: 2.85rem; line-height: 2.85rem; font-size: 16px; }
    textarea.field__input, input[type=file].field__input { height: auto; line-height: 1.5; font-size: 16px; }

    /* Review-Liste: Schluessel/Wert vertikal stapeln statt 2 Spalten */
    .review-list { grid-template-columns: 1fr; gap: .1rem; }
    .review-list dt { color: var(--wv-muted); font-size: .82rem; margin-top: .5rem; }
    .review-list dt:first-child { margin-top: 0; }
    .review-list__sep { margin-top: 1rem; }

    /* Wizard-Action-Buttons untereinander */
    .wizard-actions { flex-direction: column-reverse; align-items: stretch; gap: .6rem; }
    .wizard-actions .btn { width: 100%; }
    .wizard-actions [data-next] { margin-left: 0; }

    /* Thanks-Seite ebenfalls etwas kompakter */
    .apply-thanks { padding: 1.5rem 0; }
    .apply-thanks__card { padding: 1.5rem 1.2rem; border-radius: 12px; }
    .apply-thanks__reference { font-size: 1.2rem; padding: .65rem .9rem; }
}
