/* =====================================================================
   /kontakt/: Anfrage in fünf Schritten, Aufbau wie der Erstgespräch-Funnel
   auf tobiasnase.de, Farben aus der Recruiting-Partner-CI.
   Eigene Hülle: schlanker Kopf mit Fortschritt, links die Begleitspalte,
   rechts die Karte mit den Fragen. Kein Hauptmenü, der Funnel hat ein Ziel.
   Klassen und IDs der Formularlogik bleiben unangetastet (.step-panel,
   .step-item, .opt-card, .anf-titel, #mpFill, #mpCount, #anf-karte …),
   assets/js/anfrage.js nutzt sie 1:1.
   ===================================================================== */

.fseite { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--paper-2); }

/* ---------- Kopf: Logo und Fortschritt, kein Menü ---------- */
.fkopf {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.fkopf-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1360px; height: 64px; margin: 0 auto; padding: 0 var(--gutter); }
.fkopf-marke { display: inline-flex; align-items: center; min-height: 44px; }
.fkopf-marke img { width: auto; height: 26px; }
.mp-count {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  font: 700 13px/1 var(--text); letter-spacing: .02em; font-variant-numeric: tabular-nums;
  color: var(--accent-deep); background: var(--tint); border-radius: 999px;
}
.mp-bahn { position: relative; height: 5px; overflow-x: clip; overflow-y: visible; }
.mp-bahn::before { content: ""; position: absolute; inset: 0; background: var(--line); }
.mp-fill {
  position: relative; height: 100%; width: 20%;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  transition: width .5s var(--ease);
}
/* heller Streifen, der über das Gefüllte läuft */
.mp-fill::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  background: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, .85) 50%, transparent 100%) no-repeat;
  background-size: 60px 100%; background-position: -60px 0;
  animation: mp-strom 2.6s linear infinite;
}
/* Funke an der Spitze, Türkis aus der CI */
.mp-fill::after {
  content: ""; position: absolute; right: -4px; top: 50%; width: 10px; height: 10px; margin-top: -5px;
  border-radius: 50%; background: #7de2eb;
  box-shadow: 0 0 0 2px #fff, 0 0 10px 2px rgba(125, 226, 235, .95);
  animation: mp-funke 1.6s ease-in-out infinite;
}
@keyframes mp-strom { to { background-position: calc(100% + 60px) 0; } }
@keyframes mp-funke { 50% { box-shadow: 0 0 0 2px #fff, 0 0 4px 1px rgba(125, 226, 235, .5); } }

/* ---------- Seite ---------- */
.fpage { flex: 1; width: 100%; padding-bottom: clamp(32px, 5vw, 56px); }
.shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 1360px; margin: 0 auto; padding: clamp(18px, 3vw, 36px) var(--gutter) 0; align-items: stretch; }

/* ---------- Begleitspalte ---------- */
.sidebar { display: flex; flex-direction: column; padding: 22px 20px; background: var(--paper); border: 1px solid var(--line-mid); border-radius: var(--r-big); }
.sb-person { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.sb-foto { position: relative; flex: none; width: 58px; height: 58px; }
.sb-foto-bild { display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 50%; background: var(--tint); }
.sb-foto-bild img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; transform: scale(1.55); transform-origin: 50% 30%; }
.sb-foto .strom { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); overflow: visible; transform: rotate(-90deg); pointer-events: none; }
.sb-foto .strom-bahn { stroke: rgba(11, 128, 255, .18); }
.sb-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sb-notiz { font: 600 24px/1.05 var(--hand); color: var(--accent); transform: rotate(-3deg); transform-origin: left center; }
.sb-zeile { font-size: 13.5px; line-height: 1.45; color: var(--ink-3); }

.steps-list { display: block; }
.steps-list ol { display: block; }
.step-item { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; align-items: start; padding: 2px 0; }
.step-item:not(:last-child)::after {
  content: ""; position: absolute; left: 14px; top: 34px; bottom: -2px; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--line-mid) 0 4px, transparent 4px 8px);
}
.step-item.is-done:not(:last-child)::after { background: var(--accent-soft); }
.step-dot {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font: 600 13px/1 var(--head); font-variant-numeric: tabular-nums;
  color: var(--ink-3); background: var(--paper); border: 1.5px dashed var(--line-mid);
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.step-item.is-active .step-dot { color: #fff; background: var(--accent-btn); border: 1.5px solid var(--accent-btn); box-shadow: 0 0 0 4px var(--tint); }
.step-item.is-done .step-dot { color: var(--accent-btn); background: var(--tint); border: 1.5px solid var(--accent-soft); }
.step-text { display: block; min-width: 0; padding: 4px 0 18px; }
.step-name { display: block; font: 600 15px/1.3 var(--text); color: var(--ink); }
.step-item.is-pending .step-name { color: var(--ink-3); font-weight: 500; }
.step-desc { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--ink-3); }

.sidebar-foot { margin-top: auto; padding: 14px 16px; border-radius: var(--r-card); background: var(--tint-weak); border: 1px solid var(--line); }
.sf-dauer { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.sf-dauer strong { color: var(--ink); }
.sf-dauer .ic { width: 16px; height: 16px; color: var(--accent-btn); }
.sf-titel { margin: 14px 0 8px; font-size: 13px; color: var(--ink-3); }
.sf-direkt { display: grid; gap: 8px; }
.sf-direkt a {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 12px;
  font: 600 14px/1 var(--text); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-mid); border-radius: var(--r-btn);
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.sf-direkt a:hover { border-color: var(--accent-soft); color: var(--accent-btn); }
.sf-direkt .ic { width: 16px; height: 16px; }

/* ---------- Karte mit den Fragen ---------- */
.main { container-type: inline-size; min-width: 0; padding: 20px var(--gutter) 28px; background: var(--paper); border: 1px solid var(--line-mid); border-radius: var(--r-big); box-shadow: 0 40px 80px -60px rgba(0, 17, 63, .4); }
.main-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 10px; }
.btn-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px 0 4px; margin-left: -4px;
  font: 600 14.5px/1 var(--text); color: var(--ink-2); border: 0; background: none; border-radius: var(--r-btn); cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.btn-back .ic { width: 18px; height: 18px; }
.btn-back:hover { color: var(--accent-btn); background: var(--tint-weak); }
.btn-back:disabled { visibility: hidden; }
.main-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-3); }
.main-meta .ic { width: 15px; height: 15px; color: var(--accent-btn); }

.main-head { margin-bottom: 4px; }
.step-counter { display: block; margin-bottom: 10px; font: 700 12.5px/1.4 var(--text); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-btn); }
.step-title { font-size: clamp(28px, 7.4vw, 40px); line-height: 1.08; margin-bottom: 10px; outline: none; }
.step-sub { max-width: 40em; font-size: 16px; line-height: 1.55; color: var(--ink-3); margin-bottom: 18px; }
.head-divider { height: 1px; margin: 0 0 22px; background: var(--line); }
.anf-fast { display: inline-block; margin-left: 8px; font: 600 clamp(22px, 2.2vw, 26px)/1 var(--hand); letter-spacing: 0; color: var(--accent); transform: rotate(-5deg); vertical-align: .2em; white-space: nowrap; }

.step-panel { display: none; }
.step-panel.is-active { display: block; animation: anf-rein .24s var(--ease) both; }
@keyframes anf-rein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Felder ---------- */
.field-group { margin-bottom: 28px; }
.field-group:last-child { margin-bottom: 0; }
.field-label { display: block; margin-bottom: 6px; font: 700 16px/1.4 var(--text); color: var(--ink); }
.field-help { margin: -2px 0 12px; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.field-label + .options, .field-label + .input, .field-label + .range-wrap { margin-top: 10px; }
.req { color: var(--accent-btn); }
.anf-nobr { white-space: nowrap; }
.optional { font-weight: 400; color: var(--ink-3); }

/* ---------- Kacheln: große Tap-Flächen ---------- */
.options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container (min-width: 500px) { .options--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Drei Kacheln springen von einer Spalte direkt auf drei: zwei plus Waise sieht schief aus */
@container (min-width: 600px) { .options--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.opt-card {
  position: relative; display: block; cursor: pointer; user-select: none;
  min-height: 64px; padding: 14px 16px;
  border: 1px solid var(--line-mid); border-radius: var(--r-card);
  background: var(--paper); box-shadow: 0 1px 2px rgba(0, 17, 63, .05);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease);
}
.opt-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .opt-card:hover { border-color: var(--accent-soft); } }
.opt-card:active { transform: scale(.985); }
.opt-card:has(input:focus-visible) { outline: 2px solid var(--accent-btn); outline-offset: 2px; }
.opt-card.is-checked, .opt-card:has(input:checked) { border-color: var(--accent-btn); background: var(--tint-weak); box-shadow: inset 0 0 0 1px var(--accent-btn); }

.opt-row { display: flex; align-items: center; gap: 14px; height: 100%; }
.opt-icon {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 11px;
  background: var(--tint); color: var(--accent-btn); border: 1px solid color-mix(in srgb, var(--accent) 16%, #fff);
  transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.opt-icon .ic { width: 20px; height: 20px; }
.opt-card.is-checked .opt-icon, .opt-card:has(input:checked) .opt-icon { background: var(--accent-btn); color: #fff; border-color: var(--accent-btn); }
.opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.opt-title { font: 700 16.5px/1.3 var(--text); color: var(--ink); text-wrap: balance; }
.opt-desc { font-size: 14px; line-height: 1.4; color: var(--ink-3); text-wrap: balance; }

.opt-indicator { flex: none; width: 22px; height: 22px; border: 2px solid var(--line-mid); border-radius: 50%; background: var(--paper) center / 14px no-repeat; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.opt-indicator--check { border-radius: 6px; }
.opt-card.is-checked .opt-indicator, .opt-card:has(input:checked) .opt-indicator {
  border-color: var(--accent-btn); background-color: var(--accent-btn);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

/* ---------- Eingabefelder: Label darüber, mind. 16 px (kein iOS-Zoom) ---------- */
.input, .textarea {
  display: block; width: 100%; min-height: 54px; padding: 14px 16px;
  font: 500 16px/1.4 var(--text); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-mid); border-radius: 10px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 120px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #8a93a8; }
.input:hover, .textarea:hover { border-color: var(--accent-soft); }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent-btn); box-shadow: 0 0 0 4px rgba(11, 128, 255, .16); }
.input.has-error, .textarea.has-error { border-color: #c2362f; box-shadow: 0 0 0 4px rgba(194, 54, 47, .1); }

.input-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@container (min-width: 480px) { .input-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.input-row .field-group { margin-bottom: 22px; }
.step-panel[data-panel="5"] > .field-group { margin-bottom: 22px; }

.input-error { display: none; align-items: flex-start; gap: 8px; margin-top: 8px; font: 600 14px/1.4 var(--text); color: #b42318; }
.input-error::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 1px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b42318' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.input-error.is-visible { display: flex; }

/* ---------- Gehalt: Schieberegler ---------- */
.range-wrap { padding: 18px 18px 14px; border: 1px solid var(--line-mid); border-radius: var(--r-card); background: var(--paper); }
.range-display { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 14px; }
.range-value { font: 500 clamp(28px, 3vw, 34px)/1 var(--head); letter-spacing: -.03em; color: var(--accent-btn); font-variant-numeric: tabular-nums; }
.range-unit { font-size: 14px; color: var(--ink-3); }
.range {
  --fuellung: 21%;
  display: block; width: 100%; height: 32px; margin: 0; background: none; cursor: pointer;
  -webkit-appearance: none; appearance: none; touch-action: manipulation;
}
.range:focus { outline: none; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--accent-btn) 0 var(--fuellung), var(--tint) var(--fuellung) 100%); }
.range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--tint); }
.range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent-btn); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--accent-btn); border: 4px solid #fff; box-shadow: 0 0 0 1px var(--accent-btn), 0 4px 12px rgba(0, 17, 63, .28); }
.range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-btn); border: 4px solid #fff; box-shadow: 0 0 0 1px var(--accent-btn), 0 4px 12px rgba(0, 17, 63, .28); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(11, 128, 255, .25); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(11, 128, 255, .25); }
.range-skala { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--ink-3); }

/* ---------- Einwilligung ---------- */
.field-group--consent { margin-top: 6px; }
.consent { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--tint-weak); cursor: pointer; transition: border-color .18s var(--ease); }
.consent:hover { border-color: var(--accent-soft); }
.consent input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.consent:has(input:focus-visible) { outline: 2px solid var(--accent-btn); outline-offset: 2px; }
.consent-check { flex: none; width: 24px; height: 24px; margin-top: 1px; border: 2px solid var(--line-mid); border-radius: 6px; background: var(--paper) center / 15px no-repeat; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.consent.is-checked, .consent:has(input:checked) { border-color: var(--accent-soft); }
.consent.is-checked .consent-check, .consent:has(input:checked) .consent-check {
  border-color: var(--accent-btn); background-color: var(--accent-btn);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.consent-text { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.consent-text a { color: var(--accent-btn); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.submit-error { display: none; margin-top: 20px; padding: 14px 16px; border: 1px solid #f3c1bd; border-radius: var(--r-card); background: #fff4f3; font-size: 14px; line-height: 1.55; color: #8f1d15; }
.submit-error.is-visible { display: block; }
.submit-error a { color: inherit; font-weight: 700; text-decoration: underline; }

/* ---------- Fuß der Karte ---------- */
.main-foot { display: flex; flex-direction: column-reverse; gap: 12px; margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--line); }
.anf-vorher { display: none; }
.anf-beruhigung { display: flex; align-items: center; gap: 8px; font-size: 13.5px; line-height: 1.45; color: var(--ink-3); }
.anf-beruhigung .ic { width: 16px; height: 16px; flex: none; color: var(--accent-btn); }
.main-foot .anf-weiter { width: 100%; touch-action: manipulation; }
.anf-weiter:disabled { cursor: progress; opacity: .85; }
.btn-loading { display: none; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: anf-drehen .7s linear infinite; }
.anf-weiter.is-loading .ic { display: none; }
.anf-weiter.is-loading .btn-loading { display: inline-block; }
@keyframes anf-drehen { to { transform: rotate(360deg); } }

/* ---------- Fuß der Seite: nur Rechtliches ---------- */
.ffuss { border-top: 1px solid var(--line); background: var(--paper); padding-bottom: env(safe-area-inset-bottom); }
.ffuss-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px; max-width: 1360px; margin: 0 auto; padding: 10px var(--gutter); font-size: 13.5px; color: var(--ink-3); }
.ffuss nav { display: flex; flex-wrap: wrap; gap: 0 4px; margin-left: -10px; }
.ffuss nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font: 600 13.5px/1 var(--text); color: var(--ink-2); border-radius: var(--r-btn); transition: color .2s var(--ease); }
.ffuss nav a:hover { color: var(--accent-btn); }
.ffuss-copy { order: 2; }

/* ---------- ab 600 px ---------- */
@media (min-width: 600px) {
  .main-foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .main-foot .anf-weiter { width: auto; min-width: 200px; margin-left: auto; }
  .anf-beruhigung { flex: 1; }
  .ffuss-copy { order: 0; }
}

/* ---------- ab 1024 px: Begleitspalte plus Karte ---------- */
@media (min-width: 1024px) {
  .fkopf-in { height: 70px; }
  .fkopf-marke img { height: 30px; }
  .shell { grid-template-columns: 320px minmax(0, 1fr); gap: 32px; padding-top: 36px; }
  .main { padding: 24px clamp(32px, 3.2vw, 48px) 32px; }
  .main-top { margin-bottom: 14px; }
  .step-title { font-size: clamp(34px, 3.2vw, 44px); }
  .step-sub { font-size: 17px; }
}

/* ---------- Tablet und Handy ---------- */
@media (max-width: 1023px) {
  /* Der Fortschritt steht schon im Kopf; unten bleiben Person, Dauer und direkte Wege */
  .sidebar { order: 2; }
  .steps-list { display: none; }
  .sb-person { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
  .sidebar-foot { margin-top: 18px; }
  .sf-direkt { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 420px; }
}

@media (max-width: 600px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .main { padding: 18px 16px 24px; border-radius: 18px; }
  .sidebar { padding: 18px 16px; border-radius: 18px; }
  .opt-card { padding: 14px; }
  .opt-row { gap: 12px; }
  .opt-icon { width: 38px; height: 38px; }
  .anf-fast { display: block; margin: 8px 0 0; font-size: 22px; transform: rotate(-3deg); transform-origin: left; }
  .sf-direkt { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .step-panel.is-active { animation: none; }
}
