/* ==========================================================================
   Krieg Karriereportal – Basis (Tokens, Typografie, Buttons, Formulare)
   Markenfarben angelehnt an krieg.de
   ========================================================================== */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin.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;
}

:root {
  --navy: #333162;
  --navy-600: #3d3b74;
  --navy-700: #2a2952;
  --navy-800: #232247;
  --navy-900: #1b1a37;
  --yellow: #f7c600;
  --yellow-600: #e0b400;
  --yellow-100: #fff6cc;
  --petrol: #023b4a;
  --petrol-600: #0a5266;
  --leaf: #6ab023;

  --ink: #1b1a2e;
  --text: #3a3a4c;
  --muted: #6c6c80;
  --line: #e2e3eb;
  --line-strong: #cfd0dc;
  --bg: #ffffff;
  --bg-soft: #f4f5f9;
  --bg-muted: #eceef4;

  --success: #1f8a4c;
  --success-bg: #e7f6ed;
  --danger: #c62f3b;
  --danger-bg: #fdecee;
  --warning: #9a6b00;
  --warning-bg: #fff6d6;
  --info: #2b5fb8;
  --info-bg: #e8f0fd;

  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius-sm: 3px;
  --radius: 5px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(27, 26, 55, .06);
  --shadow: 0 2px 4px rgba(27, 26, 55, .04), 0 8px 24px rgba(27, 26, 55, .07);
  --shadow-lg: 0 4px 8px rgba(27, 26, 55, .05), 0 24px 48px rgba(27, 26, 55, .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --focus: 0 0 0 3px rgba(247, 198, 0, .55);
  --stripes: repeating-linear-gradient(-45deg, var(--yellow) 0 5px, transparent 5px 12px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy-600); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
::selection { background: var(--yellow); color: var(--navy-900); }
[hidden] { display: none !important; }

h1, h2, h3, h4 { color: var(--ink); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.25rem; letter-spacing: -.01em; }
h4 { font-size: 1.05rem; letter-spacing: 0; }
p { margin: 0 0 1em; }
small { font-size: .85em; }

.icon { width: 1.15em; height: 1.15em; flex: none; }
.icon.filled { fill: currentColor; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Kicker (gelber Balken + Versal-Label wie krieg.de) ---------- */
.kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy); margin-bottom: 14px;
}
.kicker::before { content: ""; width: 32px; height: 3px; background: var(--yellow); }
.on-dark .kicker, .kicker.on-dark { color: var(--yellow); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--navy); --btn-fg: #fff; --btn-bd: var(--btn-bg);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  font-weight: 600; font-size: .98rem; letter-spacing: .01em; line-height: 1.1; text-decoration: none; white-space: nowrap;
  color: var(--btn-fg); background: var(--btn-bg); border: 2px solid var(--btn-bd); border-radius: var(--radius);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { color: var(--btn-fg); background: var(--navy-600); border-color: var(--navy-600); }
.btn:active { transform: translateY(1px); }
.btn .icon { transition: transform .25s var(--ease); }
.btn:hover .icon-arrow, .btn:hover .icon:last-child:not(:first-child) { transform: translateX(3px); }
.btn-yellow { --btn-bg: var(--yellow); --btn-fg: var(--navy-900); }
.btn-yellow:hover { background: var(--yellow-600); border-color: var(--yellow-600); color: var(--navy-900); }
.btn-outline { --btn-bg: transparent; --btn-fg: var(--navy); --btn-bd: var(--line-strong); }
.btn-outline:hover { background: var(--bg-soft); border-color: var(--navy); color: var(--navy); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--navy); --btn-bd: transparent; }
.btn-ghost:hover { background: var(--bg-soft); border-color: transparent; color: var(--navy); }
.btn-light { --btn-bg: #fff; --btn-fg: var(--navy); --btn-bd: #fff; }
.btn-light:hover { background: var(--yellow); border-color: var(--yellow); color: var(--navy-900); }
.btn-outline-light { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255,255,255,.45); }
.btn-outline-light:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }
.btn-danger { --btn-bg: var(--danger); --btn-bd: var(--danger); }
.btn-danger:hover { background: #a92530; border-color: #a92530; }
.btn-danger-ghost { --btn-bg: transparent; --btn-fg: var(--danger); --btn-bd: transparent; }
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .9rem; gap: 8px; }
.btn-xs { min-height: 30px; padding: 0 10px; font-size: .82rem; gap: 6px; border-width: 1px; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; }
.btn-icon.btn-sm { width: 38px; min-height: 38px; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy); text-decoration: none;
}
.link-arrow .icon { transition: transform .25s var(--ease); }
.link-arrow:hover .icon { transform: translateX(4px); }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; min-width: 0; }
.field > label, .label {
  font-weight: 600; font-size: .92rem; color: var(--ink);
}
.label .opt, .field > label .opt { font-weight: 400; color: var(--muted); font-size: .85em; }
.label .req, .field > label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  font-size: 1rem; line-height: 1.4; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.textarea { min-height: 120px; resize: vertical; }
.select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333162' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: #9a9aae; }
.input-sm, .select-sm { min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: .92rem; }
.is-invalid .input, .is-invalid .select, .is-invalid .textarea, .input.is-invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .86rem; font-weight: 500; display: flex; gap: 6px; align-items: center; }
.field-hint { color: var(--muted); font-size: .86rem; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 44px; }

.check {
  position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  font-size: .95rem; line-height: 1.5; padding: 2px 0;
}
.check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.check .box {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; display: grid; place-items: center; transition: all .15s;
}
.check input[type="radio"] + .box { border-radius: 50%; }
.check .box::after {
  content: ""; width: 11px; height: 6px; border: 2.5px solid var(--navy-900); border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .15s var(--ease);
}
.check input[type="radio"] + .box::after { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--navy-900); transform: scale(0); }
.check input:checked + .box { background: var(--yellow); border-color: var(--yellow); }
.check input:checked + .box::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input[type="radio"]:checked + .box::after { transform: scale(1); }
.check input:focus-visible + .box { box-shadow: var(--focus); }
.is-invalid .check .box { border-color: var(--danger); }

/* Umschalter */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; flex: none; width: 44px; height: 24px; border-radius: 12px; background: var(--line-strong); transition: background .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--ease);
}
.switch input:checked + .track { background: var(--navy); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }

/* Cloudflare Turnstile (erscheint nur, wenn eine Prüfung nötig ist) */
.turnstile { margin: 4px 0 6px; }
.turnstile:empty { margin: 0; }
.turnstile-hint { margin: 4px 0 14px; font-size: .78rem; line-height: 1.4; color: var(--muted); }
.turnstile-hint a { color: inherit; }
.alert-band .turnstile-hint { color: inherit; opacity: .75; }

/* ---------- Badges / Chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: var(--bg-muted); color: var(--navy);
}
.badge-yellow { background: var(--yellow); color: var(--navy-900); }
.badge-navy { background: var(--navy); color: #fff; }
.badge-outline { background: transparent; border: 1px solid var(--line-strong); color: var(--text); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-blue   { background: #e7efff; color: #2457b5; }
.badge-violet { background: #efeafd; color: #5b3cc4; }
.badge-amber  { background: #fff3d1; color: #8a5d00; }
.badge-teal   { background: #def4f4; color: #0b6b6f; }
.badge-green  { background: var(--success-bg); color: var(--success); }
.badge-red    { background: var(--danger-bg); color: var(--danger); }
.badge-gray   { background: var(--bg-muted); color: var(--muted); }

/* ---------- Hinweise ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius); border-left: 4px solid;
  font-size: .95rem; margin-bottom: 18px;
}
.alert .icon { margin-top: 3px; }
.alert-success { background: var(--success-bg); border-color: var(--success); color: #165c35; }
.alert-error { background: var(--danger-bg); border-color: var(--danger); color: #8c1f29; }
.alert-info { background: var(--info-bg); border-color: var(--info); color: #1d4386; }
.alert-warning { background: var(--warning-bg); border-color: var(--yellow-600); color: #6d4c00; }
.alert p:last-child { margin: 0; }

/* Toasts */
.toasts { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
  background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); font-size: .95rem;
  animation: toast-in .35s var(--ease);
}
.toast .icon { color: var(--yellow); margin-top: 2px; }
.toast-error .icon { color: #ff8a93; }
.toast button { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.7); padding: 0; }
.toast.is-leaving { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }

/* ---------- Rich Text ---------- */
.prose { color: var(--text); font-size: 1.04rem; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.45rem; margin: 1.6em 0 .6em; }
.prose h3 { font-size: 1.2rem; margin: 1.4em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .35em; }
.prose ul li::marker { color: var(--yellow-600); }
.prose a { font-weight: 600; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--yellow); color: var(--ink); font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }

/* ---------- Hilfsklassen ---------- */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.ml-auto { margin-left: auto; }
.stripes { background: var(--stripes); }
