/* =====================================================================
   /kontakt/: Anfrage in fünf Schritten im Funnel-Stil (tn-funnel-building 2b)
   Links die Anfrage als Karte, rechts auf Desktop die Vertrauensspalte als
   dunkle Verlaufskarte mit Logo-Icon. Klassen der Formularlogik (step-panel,
   opt-card, is-checked, input-error …) kommen aus der alten Seite, weil
   assets/js/anfrage.js sie 1:1 nutzt.
   ===================================================================== */

/* ---------- Brotkrumen ---------- */
.brotkrumen { margin-bottom: clamp(20px, 3vw, 32px); font-size: 14px; }
.brotkrumen ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.brotkrumen li { display: flex; align-items: center; gap: 6px; color: var(--ink-3); }
.brotkrumen li + li::before { content: ""; width: 6px; height: 6px; border-top: 1.5px solid var(--line-mid); border-right: 1.5px solid var(--line-mid); transform: rotate(45deg); margin-right: 4px; }
.brotkrumen a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-mid); text-underline-offset: 3px; position: relative; }
.brotkrumen a::after { content: ""; position: absolute; inset: -11px -4px; }
.brotkrumen a:hover { color: var(--accent-btn); text-decoration-color: currentColor; }
.brotkrumen [aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- Seitenkopf ---------- */
.anf { padding: clamp(24px, 3.5vw, 40px) 0 var(--section); }
.anf-kopf { position: relative; width: fit-content; max-width: 720px; margin-bottom: clamp(28px, 4vw, 44px); }
.anf-kopf h1 { font-size: clamp(36px, 5vw, 58px); }
.anf-lead { max-width: 34em; margin-top: 16px; font-size: 17px; }
.anf-notiz { position: absolute; left: 100%; top: -26px; margin-left: 34px; }

/* ---------- Raster: Anfrage + Vertrauensspalte ---------- */
.anf-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 1024px) {
  .anf-raster { grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(28px, 3vw, 40px); }
  .anf-seite { position: sticky; top: 96px; }
}

/* ---------- Karte im Preiskarten-Aufbau: Rahmen außen, Fläche innen ---------- */
.anf-karte { padding: 8px; border: 1px solid var(--line-mid); border-radius: 22px; background: var(--paper); box-shadow: 0 30px 60px -40px rgba(0, 17, 63, .28); }
.anf-flaeche {
  padding: clamp(20px, 3.4vw, 40px);
  border-radius: 16px;
  background:
    radial-gradient(ellipse 70% 50% at 100% 0%, color-mix(in srgb, var(--accent) 10%, transparent) 0, transparent 70%),
    linear-gradient(180deg, var(--tint-weak) 0%, #fff 220px);
}

/* Kopfleiste der Karte: Zurück links, Zähler rechts, darunter der Balken */
.anf-leiste { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.anf-zurueck {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px 0 4px; margin-left: -4px;
  border: 0; border-radius: var(--r-btn); background: none; cursor: pointer;
  font: 600 14px/1 var(--text); color: var(--ink-2);
}
.anf-zurueck:hover { background: var(--tint); color: var(--ink); }
.anf-zurueck .ic { width: 18px; height: 18px; }
.anf-zurueck:disabled { visibility: hidden; }
.anf-zaehler { font: 600 13px/1 var(--text); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.anf-balken { height: 6px; margin: 12px 0 clamp(26px, 3.4vw, 36px); border-radius: 999px; background: var(--tint); overflow: hidden; }
.anf-balken-fuellung { width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-btn), var(--accent)); transition: width .5s var(--ease); }

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

.anf-schritt-kopf { margin-bottom: 28px; }
.anf-schritt-kopf .kicker { margin-bottom: 12px; }
.anf-titel { font-size: clamp(28px, 3.4vw, 40px); outline: none; }
.anf-sub { max-width: 36em; margin-top: 12px; font-size: 16px; }
.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; }

.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 ---------- */
/* Spalten nach der Breite der Karte, nicht des Fensters (neben der Vertrauensspalte wird sie schmal) */
.anf-flaeche { container-type: inline-size; }
.options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container (min-width: 540px) { .options--2, .options--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 620px) { .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: #fff; 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: 40px; height: 40px; border-radius: 10px; background: var(--tint); color: var(--accent-btn); transition: background-color .15s var(--ease), 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; }
.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); }
.opt-desc { font-size: 14px; line-height: 1.4; color: var(--ink-3); }

.opt-indicator { flex: none; width: 22px; height: 22px; border: 2px solid var(--line-mid); border-radius: 50%; background: #fff 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: #fff; 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:focus, .textarea:focus { outline: none; border-color: var(--accent-btn); box-shadow: 0 0 0 3px rgba(11, 128, 255, .18); }
.input.has-error, .textarea.has-error { border-color: #c2362f; box-shadow: 0 0 0 3px rgba(194, 54, 47, .12); }

.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; }

/* Fehler inline, direkt unter dem Feld */
.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: #fff; }
.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(--ink); 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: #fff; border: 2px solid var(--accent-btn); box-shadow: 0 4px 10px -2px rgba(0, 17, 63, .25); }
.range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--accent-btn); box-shadow: 0 4px 10px -2px rgba(0, 17, 63, .25); }
.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: das ganze Label ist klickbar ---------- */
.field-group--consent { margin-top: 6px; }
.consent { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line-mid); border-radius: var(--r-card); background: #fff; cursor: pointer; }
.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: 22px; height: 22px; margin-top: 1px; border: 2px solid var(--line-mid); border-radius: 6px; background: #fff center / 14px no-repeat; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.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); 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: Beruhigung links, Weiter rechts ---------- */
.anf-fuss { display: flex; align-items: center; gap: 16px 20px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.anf-vorher { display: none; }
.anf-beruhigung { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 14px; line-height: 1.45; color: var(--ink-3); }
.anf-beruhigung .ic { width: 16px; height: 16px; color: var(--accent-btn); }
.anf-weiter { min-width: 200px; 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); } }

/* ---------- Vertrauensspalte: die laute Fläche mit Logo-Icon ---------- */
.anf-seite { padding: 28px 26px 26px; }
.anf-marke { position: absolute; z-index: -1; right: -90px; bottom: -70px; width: 300px; height: 366px; opacity: .07; pointer-events: none; --rp-ring: #fff; --rp-punkt: #fff; }

.anf-person { display: flex; align-items: center; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.anf-foto { position: relative; flex: none; width: 64px; height: 64px; }
.anf-foto-bild { display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 50%; background: #dfe6ff; }
.anf-foto-bild img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; transform: scale(1.55); transform-origin: 50% 30%; }
.anf-foto .strom { inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg); }
.anf-foto .strom-bahn { stroke: rgba(255, 255, 255, .24); }
.anf-person-text { display: flex; flex-direction: column; gap: 4px; }
.anf-person-notiz { font: 600 26px/1.05 var(--hand); color: var(--accent-soft); transform: rotate(-3deg); transform-origin: left center; }
.anf-person-zeile { font-size: 14px; line-height: 1.45; color: var(--on-dark-2); }

.steps-list { padding: 22px 0 6px; }
.steps-list ol { display: grid; }
.step-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding-bottom: 18px; }
.step-item:not(:last-child)::after { content: ""; position: absolute; left: 13.5px; top: 32px; bottom: 4px; width: 1px; background: rgba(255, 255, 255, .16); }
.step-item.is-done:not(:last-child)::after { background: var(--accent-soft); }
.step-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .28); font: 700 13px/1 var(--text); color: var(--on-dark-2); transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease); }
.step-text { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.step-name { font: 600 15px/1.35 var(--text); color: #fff; opacity: .7; }
.step-desc { font-size: 13px; line-height: 1.45; color: var(--on-dark-2); opacity: .75; }
.step-item.is-active .step-dot { background: #fff; border-color: #fff; color: var(--ink); box-shadow: 0 0 0 5px rgba(156, 201, 255, .18); }
.step-item.is-active .step-name, .step-item.is-active .step-desc { opacity: 1; }
.step-item.is-done .step-dot { background: var(--accent); border-color: var(--accent); color: transparent; 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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); background-size: 14px; background-position: center; background-repeat: no-repeat; }
.step-item.is-done .step-name { opacity: .9; }

.anf-seite-fuss { padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); }
.anf-dauer { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #e3e9f6; }
.anf-dauer strong { color: #fff; }
.anf-dauer .ic { width: 18px; height: 18px; color: var(--accent-soft); }
.anf-direkt-titel { margin: 18px 0 10px; font-size: 14px; color: var(--on-dark-2); }
.anf-direkt { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.anf-direkt .glas { min-height: 44px; padding: 0 12px; font-size: 14px; }
.anf-direkt .glas .ic { width: 16px; height: 16px; }

/* ---------- Tablet und Handy ---------- */
@media (max-width: 1023px) {
  .anf-notiz { position: static; display: inline-block; margin: 14px 0 0 4px; }
  .anf-notiz svg { display: none; }
  /* Unter der Karte nur Person, Dauer und direkte Wege; der Fortschritt steht schon in der Karte */
  .steps-list { display: none; }
  .anf-person { padding-bottom: 20px; }
  .anf-seite-fuss { padding-top: 18px; }
  .anf-direkt { max-width: 420px; }
}

@media (max-width: 760px) {
  .anf > .wrap { padding: 0 12px; }
  .brotkrumen, .anf-kopf { padding: 0 4px; }
  .anf-kopf h1 { font-size: 36px; }
  .anf-lead { font-size: 16px; }
  .anf-karte { border-radius: 20px; padding: 6px; }
  .anf-flaeche { padding: 18px 16px 20px; border-radius: 15px; }
  .anf-balken { margin-bottom: 24px; }
  .anf-titel { font-size: 28px; }
  .anf-fast { display: block; margin: 8px 0 0; font-size: 22px; transform: rotate(-3deg); transform-origin: left; }
  .anf-sub { font-size: 15.5px; }
  .opt-card { padding: 14px; }
  .opt-row { gap: 12px; }
  .anf-fuss { flex-direction: column-reverse; align-items: stretch; margin-top: 26px; padding-top: 20px; }
  .anf-weiter { width: 100%; min-width: 0; }
  .anf-beruhigung { justify-content: center; text-align: left; font-size: 13px; }
  .anf-seite { padding: 24px 18px 20px; border-radius: 20px; }
  .anf-direkt { max-width: none; }
}

@media (max-width: 430px) {
  .anf-kopf h1 { font-size: 33px; }
}
