/* ============================================================
   Anfrage-Funnel · Autozentrum Kozak
   Icon-Kacheln, Auto-Advance, Fortschritt, Validierung
   ============================================================ */

.funnel {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 3vw, 36px); position: relative;
  box-shadow: var(--shadow-2, 0 20px 50px rgba(0,0,0,0.35));
}
.fn-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Fortschritt */
.fn-head { margin-bottom: 26px; }
.fn-progress { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fn-progress li {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-dim); font-weight: 500;
  transition: color 0.25s var(--ease);
}
.fn-progress li span {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Michroma', sans-serif; font-size: 0.68rem;
  background: rgba(244,244,245,0.06); border: 1px solid var(--line); color: var(--text-dim);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.fn-progress li.is-active { color: var(--text); }
.fn-progress li.is-active span { background: var(--accent); color: #17110A; border-color: var(--accent); box-shadow: 0 0 16px rgba(249,154,64,0.45); }
.fn-progress li.is-done span { background: rgba(249,154,64,0.16); color: var(--accent); border-color: rgba(249,154,64,0.4); }
.fn-bar { height: 3px; border-radius: 99px; background: rgba(244,244,245,0.08); margin-top: 14px; overflow: hidden; }
.fn-bar i { display: block; height: 100%; width: 100%; border-radius: inherit; transform-origin: left; transform: scaleX(0.25); background: linear-gradient(90deg, var(--accent), #E8420A); box-shadow: 0 0 12px rgba(249,154,64,0.5); transition: transform 0.4s var(--ease); }
@media (max-width: 640px) {
  .fn-progress li { font-size: 0; gap: 0; justify-content: center; }
  .fn-progress li span { font-size: 0.68rem; }
}

/* Schritte */
.fn-step { display: none; }
.fn-step.is-active { display: block; animation: fn-in 0.35s var(--ease); }
@keyframes fn-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fn-step.is-active { animation: none; } }
.fn-step h3 { font-size: 1.3rem; margin-bottom: 6px; }
.fn-hint { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 20px; }
.fn-step fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.fn-step legend { font-size: 0.9rem; font-weight: 600; margin-bottom: 10px; padding: 0; }
.req { color: var(--accent); }

/* Kacheln */
.fn-tiles { display: grid; gap: 12px; }
.fn-tiles-2 { grid-template-columns: repeat(2, 1fr); }
.fn-tiles-3 { grid-template-columns: repeat(3, 1fr); }
.fn-tiles-4 { grid-template-columns: repeat(4, 1fr); }
.fn-tile { position: relative; display: block; cursor: pointer; }
.fn-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.fn-tile-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; min-height: 118px; padding: 18px 12px;
  background: var(--bg); border: 1px solid rgba(244,244,245,0.14); border-radius: var(--radius);
  color: var(--text-muted);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.fn-tile-box .ic { width: 28px; height: 28px; color: var(--accent); transition: transform 0.2s var(--ease); }
.fn-tile-box strong { font-size: 0.92rem; color: var(--text); line-height: 1.3; }
.fn-tile-box small { font-size: 0.78rem; color: var(--text-dim); line-height: 1.35; }
.fn-tiles-sm .fn-tile-box { min-height: 88px; padding: 14px 10px; }
.fn-tiles-sm .fn-tile-box .ic { width: 22px; height: 22px; }
.fn-tiles-sm .fn-tile-box strong { font-size: 0.85rem; }
@media (hover: hover) {
  .fn-tile:hover .fn-tile-box { border-color: rgba(249,154,64,0.5); transform: translateY(-2px); }
  .fn-tile:hover .fn-tile-box .ic { transform: scale(1.08); }
}
.fn-tile input:checked + .fn-tile-box {
  background: rgba(249,154,64,0.10); border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 0 22px rgba(249,154,64,0.28);
}
.fn-tile input:checked + .fn-tile-box::after {
  content: ""; position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Ccircle cx='128' cy='128' r='128'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Ccircle cx='128' cy='128' r='128'/%3E%3C/svg%3E") center/contain no-repeat;
}
.fn-tile input:checked + .fn-tile-box::before {
  content: ""; position: absolute; top: 14px; right: 14px; width: 10px; height: 10px; z-index: 1;
  background: #17110A;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z' fill='%23000'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z' fill='%23000'/%3E%3C/svg%3E") center/contain no-repeat;
}
.fn-tile input:focus-visible + .fn-tile-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.fn-tile-box { position: relative; }
@media (max-width: 860px) { .fn-tiles-3, .fn-tiles-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .fn-tiles-3, .fn-tiles-4 { grid-template-columns: 1fr 1fr; } .fn-tile-box { min-height: 104px; padding: 14px 8px; } .fn-tile-box small { display: none; } }

/* Details-Container */
.fn-detail { display: none; }
.fn-detail.is-active { display: block; }

/* Felder (Basis-Styles kommen aus style.css .field) */
.fn-consent { display: flex; gap: 12px; align-items: flex-start; font-size: 0.86rem; color: var(--text-muted); cursor: pointer; margin-top: 6px; }
.fn-consent input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.fn-consent a { color: var(--accent); }

/* Navigation */
.fn-nav { display: flex; gap: 12px; justify-content: space-between; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.fn-nav .fn-back .ic { transform: rotate(180deg); }
.fn-nav .fn-next, .fn-nav .fn-submit { margin-left: auto; }
.fn-nav .btn[disabled] { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 560px) {
  .fn-nav { flex-direction: column-reverse; }
  .fn-nav .btn { width: 100%; margin: 0; }
}

/* Fehler / Status */
.fn-error { color: #FF8A5C; font-size: 0.86rem; margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.fn-error[hidden] { display: none; }
.fn-status { min-height: 1.4em; margin-top: 14px; font-size: 0.9rem; }
.fn-status.is-ok { color: #8BE39A; }
.fn-status.is-err { color: #FF8A5C; }
.funnel.is-sending .fn-nav .btn { pointer-events: none; opacity: 0.7; }

/* Erfolgsansicht (inline, wenn kein Redirect gewünscht) */
.fn-success { text-align: center; padding: 30px 10px; }
.fn-success .ic { width: 52px; height: 52px; color: var(--accent); margin-bottom: 14px; }
.fn-success h3 { margin-bottom: 8px; }
.fn-success p { color: var(--text-muted); margin: 0 auto; }

/* Fix: [hidden] muss gegen .btn-Display gewinnen */
.fn-nav .btn[hidden], .fn-error[hidden], .fn-detail[hidden] { display: none !important; }
/* 7 Anliegen-Kacheln: letzte Kachel mittig statt links verwaist */
.fn-step[data-step="1"] .fn-tiles-3 > .fn-tile:nth-child(7):last-child { grid-column: 2; }
@media (max-width: 860px) { .fn-step[data-step="1"] .fn-tiles-3 > .fn-tile:nth-child(7):last-child { grid-column: 1 / -1; } }
