/* =====================================================================
   Kontaktformular praxis-jana.at (Nora, 2026-12-01). Nur auf der Kontaktseite geladen (partials/head.php),
   nach main.css und kontrast.css. Ergänzt die Regeln „.tpl-contact …“ aus main.css, Design bleibt praxis-jana.at.
   Bewegung nach dem Vorbild Hulka (Verhalten, nicht Optik), Skript: kontakt.js.

   Regel für alle Animationen: Der Ruhezustand ist der Endzustand, Keyframes setzen nur „from“. Die globalen Regeln
   (main.css: prefers-reduced-motion, a11y.css: „Animationen anhalten“) zeigen dann sofort das fertige Bild.
   Kontraste (WCAG AA, gerechnet): Platzhalter #41627A auf #CFE4F1 4,93:1 · Schrittnummer #5F7584 auf Weiß 4,81:1 ·
   Legende #5A5A5A auf Weiß 6,90:1 · Fehler #B42318 auf Weiß 6,57:1 · Text #3C3C3C auf #FDF2F1 10,06:1 ·
   Karte: Titel #0B6196 auf #E4F3FC 5,85:1, Text #3C3C3C 9,73:1 · Knopf Weiß auf #0E77B7 4,84:1 (Hover #0C6AA3 5,82:1).
   ===================================================================== */
:root{
  --kf-ease-aus:cubic-bezier(.23,1,.32,1);      /* Eintritt, Rückmeldung */
  --kf-ease-wandel:cubic-bezier(.77,0,.175,1);  /* Bewegung auf der Fläche */
  --kf-ink:#0B6196;                             /* Text-Blau auf hellen Flächen (wie kontrast.css) */
  --kf-fehler:#B42318;
  --kf-zeichen:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm0 1.6a6.9 6.9 0 1 1 0 13.8 6.9 6.9 0 0 1 0-13.8ZM9.1 5.6h1.8l-.25 5.9h-1.3l-.25-5.9Zm.9 7.4a1.1 1.1 0 1 1 0 2.2 1.1 1.1 0 0 1 0-2.2Z'/%3E%3C/svg%3E");
}

/* ---------- Ohne Skript: alle Schritte untereinander, keine Weiter/Zurück, keine Punkte ---------- */
html:not(.kf-js) .kf-steps,
html:not(.kf-js) .kf-form [data-next],
html:not(.kf-js) .kf-form [data-back]{display:none;}
html:not(.kf-js) .kf-form .wizard-panel + .wizard-panel{margin-top:12px;}
html:not(.kf-js) .kf-form{padding-top:32px;}   /* Abstand zur Einleitung, den sonst die Punkte geben */
/* Mit Skript, bevor es läuft: nur den Startschritt zeigen (kein Aufblitzen aller Schritte) */
html.kf-js .kf-form:not(.is-bereit) .wizard-panel:not(.is-start){display:none;}

.kf{position:relative;}
.kf.is-wechsel{overflow:hidden;}
.kf-form{position:relative;}

/* ---------- Schritt-Überschrift (bisher nur für Vorleseprogramme, jetzt sichtbar) ---------- */
.tpl-contact .kf-legend{
  display:block;float:none;width:100%;padding:0;margin:0 0 14px;
  font-size:.95rem;line-height:1.4;font-weight:400;color:var(--c-text-soft);letter-spacing:normal;
}

/* ---------- Fortschritt ---------- */
.tpl-contact .kf-steps .wstep .dot{
  position:relative;color:#5F7584;border-color:var(--c-blue-300);
  transition:background-color .22s ease,border-color .22s ease,color .22s ease,box-shadow .3s var(--kf-ease-aus);
}
.tpl-contact .kf-steps .wstep[data-state="active"] .dot{border-color:var(--c-primary);color:var(--c-primary);box-shadow:0 0 0 5px rgba(14,119,183,.12);}
.tpl-contact .kf-steps .wstep[data-state="done"] .dot{background:var(--c-blue-700);border-color:var(--c-blue-700);color:#fff;box-shadow:none;}
.kf-steps .dot__nr{display:block;transition:opacity .15s ease-out,filter .15s ease-out,transform .15s ease-out;}
.kf-steps .dot__haken{position:absolute;inset:0;margin:auto;width:20px;height:20px;opacity:0;transition:opacity .15s ease-out;}
.kf-steps .dot__haken path{fill:none;stroke:#fff;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset .32s var(--kf-ease-aus) .08s;}
.kf-steps .wstep[data-state="done"] .dot__nr{opacity:0;filter:blur(2px);transform:scale(.8);}
.kf-steps .wstep[data-state="done"] .dot__haken{opacity:1;}
.kf-steps .wstep[data-state="done"] .dot__haken path{stroke-dashoffset:0;}
/* Linie zwischen den Punkten füllt sich von links */
.tpl-contact .kf-steps .wstep .bar,
.tpl-contact .kf-steps .wstep[data-state="done"] .bar{height:2px;border-radius:1px;background:var(--c-blue-150);overflow:hidden;}
.kf-steps .bar__fill{display:block;height:100%;background:var(--c-blue-700);transform:scaleX(0);transform-origin:left center;transition:transform .42s var(--kf-ease-aus);}
.kf-steps .wstep[data-state="done"] .bar__fill{transform:scaleX(1);}

/* ---------- Schrittwechsel (kontakt.js): Hülle trägt kurz die Höhe, alte Stufe blendet über der neuen aus ---------- */
.kf-panels{position:relative;padding:6px;margin:-6px;}   /* 6 px Luft, damit Fokusringe beim Beschneiden sichtbar bleiben */
.kf-panels.is-wechsel{overflow:hidden;}
@supports (overflow:clip){.kf-panels.is-wechsel{overflow:visible;overflow-y:clip;}}  /* nur senkrecht beschneiden, Seitwärtsbewegung bleibt sichtbar */
.kf-form .wizard-panel.is-raus{position:absolute;top:6px;left:6px;right:6px;pointer-events:none;}

/* ---------- Felder ---------- */
.tpl-contact .kf-form .input::placeholder,
.tpl-contact .kf-form .textarea::placeholder{color:#41627A;opacity:1;}
.tpl-contact .kf-form .input,
.tpl-contact .kf-form .textarea{transition:box-shadow .15s ease,background-color .15s ease;}
.tpl-contact .kf-form .textarea{resize:vertical;field-sizing:content;min-height:120px;max-height:min(60vh,420px);}
/* Fokus: bisher ohne sichtbaren Ring. Umriss durchsichtig (Windows-Kontrastmodus färbt ihn), Ring per Schatten */
.tpl-contact .kf-form .input:focus,
.tpl-contact .kf-form .textarea:focus{outline:2px solid transparent;outline-offset:2px;box-shadow:0 0 0 2px var(--kf-ink),0 0 0 6px rgba(14,119,183,.16);}
.tpl-contact .kf-form .input[aria-invalid="true"],
.tpl-contact .kf-form .textarea[aria-invalid="true"]{box-shadow:0 0 0 2px var(--kf-fehler);}
.tpl-contact .kf-form .input[aria-invalid="true"]:focus,
.tpl-contact .kf-form .textarea[aria-invalid="true"]:focus{box-shadow:0 0 0 2px var(--kf-fehler),0 0 0 6px rgba(180,35,24,.14);}

/* Fehler am Feld: Zeichen + Text, kommt kurz von oben */
.tpl-contact .kf-form .field-error{
  display:flex;align-items:flex-start;gap:8px;margin-top:8px;padding-left:16px;
  color:var(--kf-fehler);font-size:15px;line-height:22px;font-weight:400;
  animation:kf-meldung .2s var(--kf-ease-aus) both;
}
.tpl-contact .kf-form .field-error::before,
.kf-status.is-fehler::before,.kf-status.is-pruefen::before{
  content:"";flex:none;width:18px;height:18px;margin-top:2px;background:currentColor;
  -webkit-mask:var(--kf-zeichen) center/contain no-repeat;mask:var(--kf-zeichen) center/contain no-repeat;
}
@keyframes kf-meldung{from{opacity:0;transform:translateY(-4px);}}

/* Auswahl und Einwilligung: Trefferfläche mind. 44 px hoch, Kästchen größer */
.tpl-contact .kf-form .radio-opt{min-height:44px;cursor:pointer;}
.tpl-contact .kf-form .radio-opt input{width:20px;height:20px;flex:none;}
.tpl-contact .kf-form .field.hat-fehler .radio-opt input,
.tpl-contact .kf-form input[type="checkbox"][aria-invalid="true"]{outline:2px solid var(--kf-fehler);outline-offset:2px;}
.tpl-contact .kf-form .field.hat-fehler .field-error{padding-left:0;}
.tpl-contact .kf-form .field:has(.radio-group) .field-error,
.tpl-contact .kf-form .field:has(.consent) .field-error{padding-left:0;}
.tpl-contact .kf-form .consent{min-height:44px;padding:8px 0;cursor:pointer;}
.tpl-contact .kf-form .consent input{width:20px;height:20px;margin-top:.15em;}
.tpl-contact .kf-form .consent a{text-decoration:underline;text-underline-offset:3px;}
.tpl-contact .kf-form :is(.radio-opt,.consent) input:focus-visible{outline:2px solid var(--kf-ink);outline-offset:3px;}

/* ---------- Knöpfe: Druck-Rückmeldung, sichtbarer Tastaturfokus ---------- */
.tpl-contact .kf-form .btn{transition:background-color .2s ease,color .2s ease,box-shadow .2s ease,transform .12s ease-out;}
.tpl-contact .kf-form .btn:active{transform:scale(.97);}
.tpl-contact .kf-form .btn:focus-visible{outline:2px solid var(--kf-ink);outline-offset:3px;}
.tpl-contact .kf-form .btn--outline:focus-visible{outline-offset:3px;}

/* Senden: zwei Lagen in derselben Zelle, der Knopf ändert seine Breite nicht */
.tpl-contact .kf-form .kf-senden{display:inline-grid;place-items:center;}
.kf-senden > span{grid-area:1/1;display:inline-flex;align-items:center;gap:8px;white-space:nowrap;transition:opacity .15s ease-out,filter .15s ease-out,transform .15s ease-out;}
.kf-senden__laeuft{opacity:0;filter:blur(2px);transform:translateY(4px);}
.kf-spinner{width:16px;height:16px;flex:none;animation:kf-drehen .8s linear infinite;}
.kf-spinner circle{fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-dasharray:.62 1;}
.kf-spinner .kf-spinner__spur{stroke-dasharray:none;opacity:.3;}
@keyframes kf-drehen{to{transform:rotate(360deg);}}
.kf-form.is-sendet .kf-senden{cursor:progress;}
.tpl-contact .kf-form.is-sendet .kf-senden:active{transform:none;}
.kf-form.is-sendet .kf-senden__text{opacity:0;filter:blur(2px);transform:translateY(-4px);}
.kf-form.is-sendet .kf-senden__laeuft{opacity:1;filter:none;transform:none;transition-duration:.2s;transition-delay:.06s;transition-timing-function:var(--kf-ease-aus);}
.kf-form .field{transition:opacity .2s ease;}
.kf-form.is-sendet .field{opacity:.55;}

/* ---------- Sammelhinweis ---------- */
.kf-status{margin:0 0 24px;font-size:1rem;line-height:24px;font-weight:400;color:var(--c-text);}
/* leer nur optisch weg: mit display:none fiele die Live-Region aus dem Barrierefreiheitsbaum */
.kf-status:empty{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
.kf-status:focus{outline:2px solid transparent;}
.kf-status.is-fehler{
  display:flex;gap:12px;padding:14px 18px;border-radius:14px;
  background:#FDF2F1;border:1px solid #F1C9C4;color:var(--c-text);
  animation:kf-meldung .22s var(--kf-ease-aus) both;
}
.kf-status.is-fehler::before{color:var(--kf-fehler);width:20px;height:20px;}
.kf-status.is-pruefen{display:flex;gap:8px;color:var(--kf-fehler);font-size:15px;line-height:22px;animation:kf-meldung .2s var(--kf-ease-aus) both;}
.kf-status.is-info{padding:14px 18px;border-radius:14px;background:var(--c-blue-100);animation:kf-meldung .22s var(--kf-ease-aus) both;}
.kf-status:focus-visible{box-shadow:0 0 0 3px rgba(14,119,183,.3);}

/* ---------- Danke-Karte ---------- */
.kf-danke{
  padding:40px 44px 36px;background:var(--c-blue-100);border-radius:var(--radius-card);
  scroll-margin-top:calc(var(--header-h) + 24px);
  animation:kf-karte .45s var(--kf-ease-aus) .18s both;
}
.kf-danke:focus{outline:2px solid transparent;outline-offset:2px;}
.kf-danke:focus-visible{box-shadow:0 0 0 2px var(--c-blue-300),0 0 0 6px rgba(14,119,183,.12);}
.kf-danke__haken{display:block;width:56px;height:56px;margin:0 0 20px;overflow:visible;}
.kf-danke__kreis,.kf-danke__strich{fill:none;stroke:var(--c-primary);stroke-dasharray:1;stroke-dashoffset:0;}
.kf-danke__kreis{stroke-width:2;transform:rotate(-90deg);transform-origin:28px 28px;animation:kf-zeichnen .6s cubic-bezier(.65,0,.35,1) .3s both;}
.kf-danke__strich{stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;animation:kf-zeichnen .32s var(--kf-ease-aus) .78s both;}
.kf-danke__titel{
  margin:0 0 10px;font-family:var(--font-body);font-size:1.43rem;line-height:1.25;font-weight:500;
  letter-spacing:normal;text-transform:none;color:var(--kf-ink);text-wrap:balance;
}
.kf-danke__text{margin:0;max-width:34rem;font-size:1.1rem;line-height:1.6;font-weight:300;color:var(--c-text);}
.kf-danke__hinweis{
  margin:24px 0 0;padding-top:16px;max-width:34rem;border-top:1px solid rgba(14,119,183,.22);
  font-size:.95rem;line-height:1.55;font-weight:300;color:var(--c-text);
}
.kf-danke__hinweis a{color:var(--kf-ink);font-weight:500;text-decoration:underline;text-underline-offset:3px;}
.kf-danke__titel,.kf-danke__text,.kf-danke__hinweis{animation:kf-zeile .36s var(--kf-ease-aus) both;}
.kf-danke__titel{animation-delay:.36s;}
.kf-danke__text{animation-delay:.42s;}
.kf-danke__hinweis{animation-delay:.48s;}
@keyframes kf-karte{from{opacity:0;transform:translateY(12px);}}
@keyframes kf-zeile{from{opacity:0;transform:translateY(8px);}}
@keyframes kf-zeichnen{from{stroke-dashoffset:1;}}

/* ---------- Ruhige Variante: keine Bewegung (main.css und a11y.css setzen Dauern auf 0) ---------- */
@media (prefers-reduced-motion:reduce){ .kf-spinner{display:none;} }
html.a11y-motion .kf-spinner{display:none;}

/* ---------- Handy ---------- */
@media (max-width:767px){
  .kf-danke{padding:28px 22px 24px;}
  .kf-danke__haken{width:48px;height:48px;margin-bottom:16px;}
  .kf-danke__titel{font-size:1.25rem;}
  .tpl-contact .kf-legend{margin-bottom:12px;}
  /* „Wird gesendet …“ passt auch bei 320 px einzeilig in den Knopf */
  .tpl-contact .kf-form .wizard-actions .btn{padding-inline:20px;}
  .tpl-contact .kf-form .wizard-actions .kf-senden{padding-inline:12px;}
}

/* Tablet 768–1024 (Vera M3): main.css setzt die Kontaktspalte dort randlos (padding-inline:0). Die Hülle der
   Schritte (6 px Luft für Fokusringe) stand dadurch 6 px über, Fokusringe und der Hof des aktiven Punkts wurden am
   Fensterrand abgeschnitten. Die Spalte bekommt hier den normalen Seitenrand der Seite (--gutter, 28 px). */
@media (min-width:768px) and (max-width:1024px){
  .tpl-contact main > .section .container--content{padding-inline:var(--gutter);}
}

/* Windows-Kontrastmodus: Schatten entfallen, Umrisse übernehmen */
@media (forced-colors:active){
  .tpl-contact .kf-form .input:focus,.tpl-contact .kf-form .textarea:focus{outline-color:Highlight;}
  .kf-danke:focus-visible,.kf-status:focus-visible{outline:2px solid Highlight;}
  .kf-steps .dot__haken path{stroke:CanvasText;}
}
