/* ==========================================================================
   anfrage.css — das Erstgespräch-Formular auf der Startseite
   --------------------------------------------------------------------------
   Farben, Radien und Schriften kommen aus den Tokens der Startseite
   (--ground, --surface, --ink, --line, --green, --r-xs …). Diese Datei
   kennt keine eigenen Farben — Hell- und Dunkelmodus laufen automatisch mit.

   Die Regeln, nach denen das Formular gebaut ist:
     · Ein Feld ist eine Fläche, in die man schreibt — nicht ein Loch.
     · Zustände ändern den RAHMEN, nicht die Fläche: Überfahren dunkelt die
       Linie, Fokus macht sie grün, Fehler rot. Nichts flutet.
     · Die Zustimmung ist der eine Kasten, der bleibt: rechtlich das
       Gewichtigste auf der Karte, deshalb mit eigenem Rahmen.
     · Fehler stehen AM Feld, nicht irgendwo in einem Sammelkasten.
   ========================================================================== */

/* ---- Feldreihen --------------------------------------------------------- */
/* Nur ein waagerechter Abstand im Raster — senkrecht trennt allein der
   margin-bottom der Felder. So ist der Abstand zwischen zwei Feldern überall
   gleich, auch wenn das Raster auf dem Handy einspaltig wird.            */
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
@media (max-width:560px){ .field-row{ grid-template-columns:1fr; } }

.field{ display:grid; gap:7px; margin-bottom:18px; align-content:start; }
.field label{ display:flex; align-items:baseline; gap:7px;
  font-size:.86rem; font-weight:500; color:var(--ink-2); letter-spacing:-.005em; }
.field label .req{ color:var(--red); font-weight:600; }
.field label .opt{ font-size:.78rem; font-weight:400; color:var(--ink-3); }

/* ---- Eingabefelder ------------------------------------------------------ */
.field input,.field select,.field textarea{
  font-family:var(--body); font-size:1rem; font-weight:400; line-height:1.4;
  color:var(--ink); background:var(--ground);
  border:1px solid var(--line); border-radius:var(--r-xs);
  min-height:52px; padding:13px 15px; width:100%;
  transition:border-color .14s ease-in-out, background-color .14s ease-in-out,
             box-shadow .14s ease-in-out; }
.field textarea{ min-height:118px; resize:vertical; line-height:1.55; }
.field input::placeholder,.field textarea::placeholder{ color:var(--ink-3); opacity:.7; }

.field input:hover,.field select:hover,.field textarea:hover{
  border-color:color-mix(in srgb, var(--ink-3) 70%, var(--line)); }
.field input:focus,.field select:focus,.field textarea:focus{
  outline:none; border-color:var(--green-600); background:var(--surface);
  box-shadow:0 0 0 3.5px color-mix(in srgb, var(--green) 24%, transparent); }

/* Das Auswahlfeld bekommt einen eigenen Pfeil — der Browser-Pfeil passt
   in kein Design. Nur die Farbe ändern, sonst verschwindet der Pfeil beim
   Überfahren.                                                            */
.field select{ appearance:none; -webkit-appearance:none; cursor:pointer; padding-right:38px;
  text-overflow:ellipsis; white-space:nowrap; overflow:hidden;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%237C857A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center; background-size:12px 8px; }
.field select:focus{ background-color:var(--surface); }
.field select option{ background:var(--surface); color:var(--ink); }

/* ---- Hilfszeile unter einem Feld ---------------------------------------- */
.field__help{ margin:-1px 0 0; font-size:.8rem; line-height:1.45; color:var(--ink-3);
  font-variant-numeric:tabular-nums; transition:color .14s ease-in-out; }

/* ---- Telefon: Vorwahl + Nummer in EINER Fläche ---------------------------
   Zwei Bedienelemente, ein Feld. Der Rahmen liegt auf dem Umschlag, nicht
   auf den Teilen — Überfahren, Fokus und Fehler färben deshalb die ganze
   Fläche, so wie bei jedem anderen Feld auch. Eine Haarlinie trennt die
   Vorwahl von der Nummer.                                                 */
.f-tel{ display:flex; align-items:stretch; min-height:52px;
  background:var(--ground); border:1px solid var(--line); border-radius:var(--r-xs);
  overflow:hidden;
  transition:border-color .14s ease-in-out, background-color .14s ease-in-out,
             box-shadow .14s ease-in-out; }
.f-tel:hover{ border-color:color-mix(in srgb, var(--ink-3) 70%, var(--line)); }
.f-tel:focus-within{ border-color:var(--green-600); background:var(--surface);
  box-shadow:0 0 0 3.5px color-mix(in srgb, var(--green) 24%, transparent); }

/* Die Teile verlieren ihren eigenen Rahmen — der Umschlag hat ihn. */
/* background-COLOR, nicht background: das Kurzschreib-background würde auch
   den Pfeil (ein background-image) der Auswahl löschen.                  */
.field .f-tel select,
.field .f-tel input{
  min-height:0; border:0; border-radius:0; background-color:transparent; box-shadow:none; }
.field .f-tel select:hover, .field .f-tel input:hover,
.field .f-tel select:focus, .field .f-tel input:focus{
  border-color:transparent; background-color:transparent; box-shadow:none; outline:none; }

.field .f-tel select{ flex:0 0 auto; width:auto; padding:0 26px 0 12px; font-size:.95rem;
  font-variant-numeric:tabular-nums; letter-spacing:0; font-weight:500;
  border-right:1px solid var(--line); border-radius:0;
  background-position:right 9px center; background-size:11px 7px; }
.f-tel:focus-within select{ border-right-color:color-mix(in srgb, var(--green) 45%, var(--line)); }
.field .f-tel input{ flex:1 1 auto; min-width:0; width:1%; padding:13px 12px 13px 13px;
  font-variant-numeric:tabular-nums; letter-spacing:.01em; }

/* Fehler: der Umschlag wird rot, nicht die Teile. */
.is-invalid .f-tel{ border-color:color-mix(in srgb, var(--red) 60%, var(--line)); }
.is-invalid .f-tel:focus-within{ border-color:var(--red);
  box-shadow:0 0 0 3.5px color-mix(in srgb, var(--red) 18%, transparent); }
.is-invalid .f-tel select, .is-invalid .f-tel input{ border-color:transparent; }
.is-invalid .f-tel select{ border-right-color:color-mix(in srgb, var(--red) 40%, var(--line)); }

/* ---- Automatisch ausgefüllte Felder -------------------------------------
   Safari und Chrome legen beim Autofill eine eigene Fläche über das Feld.
   Abschalten lässt sie sich nicht — aber ein Übergang von 100000s blendet
   sie praktisch nie ein. Sichtbar bleibt unsere eigene Fläche.           */
.field input:-webkit-autofill, .field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus, .field textarea:-webkit-autofill{
  -webkit-text-fill-color:var(--ink); caret-color:var(--ink);
  transition:background-color 100000s ease-in-out 0s, border-color .14s ease-in-out; }
.field input:autofill, .field textarea:autofill{
  -webkit-text-fill-color:var(--ink); caret-color:var(--ink);
  transition:background-color 100000s ease-in-out 0s, border-color .14s ease-in-out; }

/* ---- Zustimmung: der eine Kasten, der bleibt ---------------------------- */
.consent{ position:relative; display:flex; flex-wrap:wrap; align-items:flex-start; gap:13px; cursor:pointer;
  margin:4px 0 22px; padding:15px 17px;
  background:transparent; border:1px solid var(--line); border-radius:var(--r-xs);
  font-size:.88rem; line-height:1.5; color:var(--ink-2);
  transition:border-color .14s ease-in-out, background-color .14s ease-in-out; }
.consent:hover{ border-color:color-mix(in srgb, var(--ink-3) 70%, var(--line)); }
.consent input{ position:absolute; opacity:0; width:1px; height:1px; margin:0; }
.consent__mark{ flex:none; width:20px; height:20px; margin-top:1px;
  display:grid; place-items:center;
  border:1.5px solid color-mix(in srgb, var(--ink-3) 70%, var(--line)); border-radius:6px;
  background:var(--ground);
  transition:border-color .14s ease-in-out, background-color .14s ease-in-out; }
.consent__mark svg{ width:12px; height:12px; opacity:0; transition:opacity .14s ease-in-out; }
.consent__mark svg path{ stroke:#16240A; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; fill:none; }
.consent input:checked + .consent__mark{ background:var(--green); border-color:var(--green); }
.consent input:checked + .consent__mark svg{ opacity:1; }
.consent:has(input:checked){ border-color:var(--green-600); background:var(--green-tint); }
.consent input:focus-visible + .consent__mark{ outline:2px solid var(--green-600); outline-offset:3px; }
.consent__txt{ flex:1 1 0; min-width:0; text-wrap:pretty; }
.consent__txt a{ color:var(--green-ink); text-decoration:underline; text-underline-offset:2px; }

/* ---- Fehler — färbt den Rahmen, flutet nicht die Fläche ----------------- */
.f-err{ display:flex; align-items:flex-start; gap:7px; margin:0;
  font-size:.84rem; line-height:1.4; color:var(--red); }
.f-err svg{ flex:none; width:14px; height:14px; margin-top:2px; }
.f-err svg circle{ stroke:currentColor; stroke-width:1.6; fill:none; }
.f-err svg path{ stroke:currentColor; stroke-width:1.8; stroke-linecap:round; fill:none; }
.is-invalid input,.is-invalid select,.is-invalid textarea{
  border-color:color-mix(in srgb, var(--red) 60%, var(--line)); }
.is-invalid input:focus,.is-invalid select:focus,.is-invalid textarea:focus{
  border-color:var(--red); box-shadow:0 0 0 3.5px color-mix(in srgb, var(--red) 18%, transparent); }
.consent.is-invalid{ border-color:color-mix(in srgb, var(--red) 60%, var(--line)); }
.consent.is-invalid .consent__mark{ border-color:var(--red); }
.consent.is-invalid .f-err{ flex:1 0 100%; margin-top:2px; }

.f-step__err{ margin:0 0 16px; padding:13px 15px; border-radius:var(--r-xs);
  border:1px solid color-mix(in srgb, var(--red) 45%, transparent);
  background:color-mix(in srgb, var(--red) 7%, transparent);
  color:var(--red); font-size:.9rem; line-height:1.5; }
.f-step__err[hidden]{ display:none; }

/* ---- Knopf -------------------------------------------------------------- */
.form-card .btn{ width:100%; min-height:56px; }
.form-card .btn:disabled{ opacity:.6; cursor:not-allowed; transform:none; box-shadow:none; }
.btn__spin{ width:17px; height:17px; border-radius:50%; flex:none;
  border:2px solid rgba(22,36,10,.25); border-top-color:#16240A;
  animation:f-spin .7s linear infinite; }
@keyframes f-spin{ to{ transform:rotate(360deg); } }

.form-legal{ font-size:.79rem; color:var(--ink-3); line-height:1.55; margin-top:18px; }
.form-legal a{ color:var(--green-ink); }

/* ---- Lockfeld für Bots ---------------------------------------------------
   Bewusst NICHT display:none — das erkennen viele Bots und lassen das Feld
   dann leer. Aus dem Bild geschoben wirkt es für ein Skript wie ein ganz
   normales Pflichtfeld.                                                   */
.f-hp{ position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }

/* Nur für Screenreader */
.vh{ position:absolute; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

/* ---- Ohne JavaScript ---------------------------------------------------- */
.f-nojs{ margin-bottom:18px; padding:15px 17px; border-radius:var(--r-xs);
  border:1px solid var(--line); background:var(--ground);
  font-size:.9rem; line-height:1.55; color:var(--ink-2); }
.f-nojs a{ color:var(--green-ink); }

/* ---- Danke-Zustand ------------------------------------------------------ */
.f-done{ display:flex; flex-direction:column; align-items:flex-start; gap:18px;
  padding-block:6px; outline:none; }
.f-done__ic{ width:56px; height:56px; border-radius:50%; display:grid; place-items:center;
  background:var(--green-tint); border:1px solid color-mix(in srgb, var(--green) 45%, transparent); }
.f-done__ic svg{ width:24px; height:24px; }
.f-done__ic svg path{ stroke:var(--green-ink); stroke-width:2.4; fill:none;
  stroke-linecap:round; stroke-linejoin:round;
  animation:f-draw .7s cubic-bezier(.16,1,.3,1) .12s both; }
/* Anfang UND Ende stehen in den Keyframes. Wird die Animation unterdrückt,
   ist der Haken trotzdem gezeichnet — er ist dann nur sofort da.        */
@keyframes f-draw{
  from{ stroke-dasharray:30; stroke-dashoffset:30; }
  to  { stroke-dasharray:30; stroke-dashoffset:0; }
}
@media (prefers-reduced-motion:reduce){ .f-done__ic svg path{ animation:none; } }
.f-done h3{ margin:0; }
.f-done__lead{ font-size:1rem; line-height:1.6; color:var(--ink-2); max-width:46ch; margin-top:-6px; }
.f-done__pts{ display:grid; gap:10px; margin:0; padding:0; list-style:none; }
.f-done__pts li{ display:flex; align-items:flex-start; gap:11px;
  font-size:.94rem; line-height:1.5; color:var(--ink-2); }
.f-done__pts svg{ flex:none; width:14px; height:14px; margin-top:4px; }
.f-done__pts svg path{ stroke:var(--green-600); stroke-width:2.6; fill:none;
  stroke-linecap:round; stroke-linejoin:round; }
