/* ==========================================================================
   Jobriver v2 – Status- und Systemseiten (Vorlage includes/v2-status.php)
   Baut auf auth-v2.css auf (Mesh-Bühne, Glas-Karte, Felder, Hinweise).
   Zustände: ok · info · warn · fehler – immer Icon + Text, nie nur Farbe.
   ========================================================================== */

:root {
    --st2-ok: #0f7a55;
    --st2-info: var(--brand-700);
    --st2-warn: #9a5b00;
    --st2-fehler: #c2255c;
    --st2-danger-bg: #c2255c;
    --st2-danger-bg-hover: #a51d4d;
    --st2-danger-fg: #fff;
}
:root[data-theme="dark"] {
    --st2-ok: #4ade9f;
    --st2-warn: #fbbf24;
    --st2-fehler: #ff7aa8;
    --st2-danger-bg: #ff7aa8;
    --st2-danger-bg-hover: #ff9dbe;
    --st2-danger-fg: #2a0a17;
}

.st2 { --st2-c: var(--st2-info); }
.st2--ok { --st2-c: var(--st2-ok); }
.st2--warn { --st2-c: var(--st2-warn); }
.st2--fehler { --st2-c: var(--st2-fehler); }

/* Bühne: etwas kompakter als die Registrierung, Karte bleibt im ersten Bildschirm */
.st2-hero { min-height: calc(100vh - 72px); padding: clamp(40px, 6vw, 80px) 0 clamp(56px, 7vw, 96px); }
.st2-title { max-width: 18ch; margin-bottom: clamp(24px, 3.4vw, 36px); font-size: clamp(2.1rem, 1.3rem + 3vw, 3.6rem); line-height: 1.04; letter-spacing: -.04em; text-wrap: balance; }
.st2-hero .kicker { margin-bottom: 12px; }

/* Fehlercode (404/410 …) groß über der Überschrift */
.st2-code { display: inline-block; padding: .04em .1em .06em .04em; margin-bottom: 4px; font-size: clamp(5rem, 3rem + 9vw, 9.5rem); line-height: .9; font-weight: 700; letter-spacing: -.06em; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, var(--brand), var(--brand-200)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Karte */
.st2-card { max-width: 560px; text-align: center; }
.st2-card--wide { max-width: 720px; }

/* Zustand: Icon-Kreis + Text-Label */
.st2-state { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 14px; }
.st2-state__ico { position: relative; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: color-mix(in oklab, var(--st2-c) 13%, transparent); color: var(--st2-c); }
.st2-state__ico svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; animation: st2Pop .7s var(--ease) both; }
.st2--ok .st2-state__ico::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: st2Ping 2.4s ease-out .5s 2; }
.st2-state__label { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid color-mix(in oklab, var(--st2-c) 30%, transparent); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--st2-c); }
@keyframes st2Pop { from { opacity: 0; transform: scale(.6); } }
@keyframes st2Ping { 0% { opacity: .45; transform: scale(1); } 100% { opacity: 0; transform: scale(1.55); } }

.st2-text { font-size: 1.0625rem; line-height: 1.6; color: var(--ink-2); }
.st2-text strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.st2-text + .st2-text { margin-top: 10px; }
.st2-text a { color: var(--brand-700); font-weight: 550; }

/* Inhalt im Slot ist linksbündig (Formulare, Listen) */
.st2-slot { text-align: left; }
.st2-slot > * { margin-top: 18px; }
.st2-slot > form > :first-child { margin-top: 0; }
.st2-slot > form > * + * { margin-top: 18px; }

/* Schlüssel/Wert-Liste (E-Mail, Suchbegriffe, Status) */
.st2-meta { display: grid; gap: 0; margin-inline: 0; margin-bottom: 0; padding: 4px 16px; border-radius: 16px; background: var(--tint); border: 1px solid var(--line); }
.st2-meta > div { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 11px 0; }
.st2-meta > div + div { border-top: 1px solid var(--line); }
.st2-meta dt { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.st2-meta dd { margin: 0; font-size: .9375rem; font-weight: 550; color: var(--ink); overflow-wrap: anywhere; }
.st2-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 600; color: var(--st2-ok); background: color-mix(in oklab, var(--st2-ok) 12%, transparent); }
.st2-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Zwei Spalten „Das sehen … / Das bleibt verborgen“ */
.st2-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.st2-facts section { padding: 16px; border-radius: 16px; background: var(--tint); border: 1px solid var(--line); }
.st2-facts h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.st2-facts h2 svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--brand-700); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st2-facts ul { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.st2-facts li { position: relative; padding-left: 18px; font-size: .875rem; line-height: 1.5; color: var(--ink-2); }
.st2-facts li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-200); }

/* Zitierte Nachricht (Bewerberpool-Anfrage) */
.st2-quote { margin-inline: 0; margin-bottom: 0; padding: 16px 18px; border-radius: 16px; border-left: 3px solid var(--brand); background: var(--brand-50); font-size: .9375rem; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }

.st2-note { font-size: .875rem; line-height: 1.55; color: var(--muted); }
.st2-note a { color: var(--brand-700); font-weight: 550; }

/* Aktionen: eine = volle Breite, zwei = nebeneinander (Handy gestapelt) */
.st2-acts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 24px; }
.st2-acts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st2-acts .btn { width: 100%; min-height: 52px; padding: 8px 18px; line-height: 1.25; white-space: normal; text-align: center; }
.st2-slot > .st2-acts, .st2-slot > form > .st2-acts { margin-top: 24px; }
.st2-slot > form { margin-top: 0; }
.st2-btn--danger { background: var(--st2-danger-bg); color: var(--st2-danger-fg); }
.st2-btn--danger:hover { background: var(--st2-danger-bg-hover); }
.st2-acts .btn[disabled] { opacity: .6; pointer-events: none; }

.st2-foot { margin-top: 20px; text-align: center; font-size: .9375rem; color: var(--muted); }
.st2-foot a { color: var(--brand-700); font-weight: 600; }

/* Auswahl-Chips (Newsletter-Einstellungen): echte Inputs, Zustand über :has() */
.st2-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.st2-fieldset legend { margin-bottom: 10px; padding: 0; font-size: .875rem; font-weight: 600; color: var(--ink); }
.st2-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.st2-opt { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: .9375rem; font-weight: 550; color: var(--ink-2); cursor: pointer; transition: border-color .2s, background-color .2s, color .2s; }
.st2-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.st2-opt__mark { display: grid; place-items: center; flex: none; width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 6px; background: var(--surface); transition: background-color .2s, border-color .2s; }
.st2-opt--radio .st2-opt__mark { border-radius: 50%; }
.st2-opt__mark svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transform: scale(0); transition: transform .2s var(--ease); }
.st2-opt--radio .st2-opt__mark svg { display: none; }
.st2-opt--radio .st2-opt__mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .2s var(--ease); }
.st2-opt:hover { border-color: var(--brand-200); color: var(--ink); }
.st2-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); color: var(--ink); }
.st2-opt:has(input:checked) .st2-opt__mark { background: var(--brand); border-color: var(--brand); }
.st2-opt:has(input:checked) .st2-opt__mark svg, .st2-opt--radio:has(input:checked) .st2-opt__mark::after { transform: scale(1); }
.st2-opt:has(input:focus-visible) { outline: 2.5px solid var(--brand); outline-offset: 3px; }

/* Fehlerseite: Jobsuche + ähnliche Stellen */
.st2-search { display: flex; gap: 8px; padding: 6px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.st2-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 6px rgba(114, 79, 255, .14); }
.st2-search input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 0; background: transparent; font: inherit; color: var(--ink); outline: none; }
.st2-search input::placeholder { color: #8d86a0; }
.st2-search .btn { min-height: 44px; padding: 0 20px; }
.st2-h2 { font-size: .9375rem; font-weight: 600; color: var(--ink); }
.st2-similar[hidden] { display: none; }
.st2-gone > * + * { margin-top: 12px; }
.st2-gone__cat { text-align: center; }
.st2-jobs > li { min-width: 0; }
.st2-jobs { list-style: none; display: grid; gap: 8px; margin: 10px 0 0; padding: 0; }
.st2-job { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.st2-job:hover { border-color: var(--brand-200); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.st2-job__logo { display: grid; place-items: center; flex: none; width: 40px; height: 40px; overflow: hidden; border-radius: 11px; border: 1px solid var(--line); background: #fff; font-weight: 700; color: #4b2cc9; }
.st2-job__logo img { max-width: 32px; max-height: 32px; object-fit: contain; }
.st2-job__txt { display: flex; flex-direction: column; min-width: 0; }
.st2-job__txt strong { font-weight: 550; font-size: .9375rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st2-job__txt small { font-size: .8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st2-more { margin-top: 12px; text-align: center; font-size: .9375rem; }
.st2-more a { color: var(--brand-700); font-weight: 600; }

/* Bewerberpool-Chat (pool-chat.js erzeugt die Nachrichten-Klassen) */
.st2 .pc-chat { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); text-align: left; }
.st2 .pc-messages { display: flex; flex-direction: column; gap: 10px; height: 420px; padding: 16px; overflow-y: auto; background: var(--tint); }
.st2 .pc-msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: .9375rem; line-height: 1.5; }
.st2 .pc-msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.st2 .pc-msg-own { align-self: flex-end; border-bottom-right-radius: 6px; background: var(--brand); color: #fff; }
.st2 .pc-msg-other { align-self: flex-start; border-bottom-left-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.st2 .pc-msg-time { margin-top: 4px; font-size: .6875rem; opacity: .75; }
.st2 .pc-msg-own .pc-msg-time { text-align: right; }
.st2 .pc-msg-system { align-self: center; max-width: 90%; padding: 6px 14px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-size: .8125rem; text-align: center; }
.st2 .pc-composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.st2 .pc-composer textarea { flex: 1 1 auto; min-width: 0; min-height: 48px; max-height: 160px; padding: 12px 14px; resize: vertical; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); font: inherit; line-height: 1.5; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.st2 .pc-composer textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(114, 79, 255, .15); }
.st2 .pc-composer .btn { flex: none; min-height: 48px; }
.st2 .pc-hint { min-height: 18px; margin: 0; padding: 0 16px 12px; font-size: .8125rem; color: var(--muted); }
.st2 .pc-hint:empty { padding-bottom: 0; min-height: 0; }

@media (max-width: 560px) {
    .st2-hero { min-height: 0; }
    .st2-acts--2 { grid-template-columns: minmax(0, 1fr); }
    .st2-facts { grid-template-columns: minmax(0, 1fr); }
    .st2-meta > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .st2-search { flex-direction: column; border-radius: 20px; }
    .st2-search .btn { width: 100%; }
    .st2 .pc-messages { height: 60vh; }
    .st2 .pc-msg { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) {
    .st2-state__ico svg, .st2--ok .st2-state__ico::after { animation: none; }
    .st2-job, .st2-opt__mark svg, .st2-opt--radio .st2-opt__mark::after { transition: none; }
}
