/* =========================================================
   Erstgespräch-Popup der Programmseiten (programm-formular.js)
   Nach dem Stylesheet der Seite geladen: Farben und Buttons kommen aus
   deren Tokens (--bg-2, --text, --accent-2 …), so trägt das Popup auf
   jeder Seite deren Farben.
   ========================================================= */

html:has(.pf-dialog[open]){ overflow: hidden; }

.pf-dialog{
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 40px 40px 36px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(160deg, var(--bg-3) 0%, var(--bg-2) 55%, var(--bg) 100%);
  color: var(--text);
  box-shadow: 0 40px 120px -20px rgba(0,0,0,0.65);
  overflow: auto;
}
.pf-dialog::backdrop{ background: rgba(5,6,8,0.72); backdrop-filter: blur(4px); }
.pf-dialog[open]{ animation: pf-ein .35s var(--ease); }
@keyframes pf-ein{ from{ opacity: 0; transform: translateY(16px) scale(.98); } to{ opacity: 1; transform: none; } }

.pf-zu{
  position: absolute; top: 10px; right: 10px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--text-dim);
  cursor: pointer;
}
.pf-zu svg{ width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pf-zu:hover{ color: var(--text); background: var(--line); }
.pf-zu:focus-visible{ outline: 2px solid var(--accent-2); outline-offset: 2px; }

.pf-eyebrow{
  display: block; margin-bottom: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--accent-2);
}
.pf-titel{ font-size: clamp(24px, 3vw, 30px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 8px; color: var(--text); }
.pf-titel:focus{ outline: none; }
.pf-intro{ font-size: 15px; line-height: 1.6; color: var(--text-dim); margin-bottom: 24px; }

.pf-reihe{ display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pf-feld{ margin-bottom: 14px; }
.pf-feld label{ display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.pf-feld input, .pf-tel select{
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: rgba(0,0,0,0.25); color: var(--text);
  font: inherit; font-size: 16px;               /* 16 px: iOS zoomt sonst beim Antippen */
}
.pf-feld input:focus, .pf-tel select:focus{ outline: 2px solid var(--accent-2); outline-offset: 1px; border-color: transparent; }
.pf-feld input[aria-invalid="true"]{ border-color: #E0705F; }
.pf-tel{ display: grid; grid-template-columns: 112px 1fr; gap: 8px; }
.pf-tel select{ padding: 0 8px; cursor: pointer; }
.pf-tel select option{ color: #111; }

.pf-falle{ position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.pf-einwilligung{ display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; margin: 6px 0 4px; }
.pf-einwilligung input{ width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent-2); cursor: pointer; }
.pf-einwilligung label{ font-size: 13px; line-height: 1.55; color: var(--text-dim); cursor: pointer; }
.pf-einwilligung a{ color: var(--text); text-decoration: underline; }

.pf-fehler{ margin-top: 6px; font-size: 13px; line-height: 1.45; color: #F08A7E; }
.pf-fehler--senden{ margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: rgba(224,112,95,0.12); }

.pf-senden{ width: 100%; justify-content: center; margin-top: 18px; }
.pf-senden[disabled]{ opacity: .6; cursor: progress; }

.pf-danke{ text-align: center; padding: 8px 0 4px; }
.pf-haken{
  display: grid; place-items: center;
  width: 72px; height: 72px; margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--accent-soft); border: 1px solid var(--accent-2);
  animation: pf-haken .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.pf-haken svg{ width: 34px; height: 34px; fill: none; stroke: var(--accent-2); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes pf-haken{ from{ transform: scale(.4); opacity: 0; } to{ transform: none; opacity: 1; } }
.pf-danke .pf-intro{ max-width: 400px; margin: 0 auto 24px; }
.pf-fertig{ justify-content: center; }

@media (max-width:520px){
  .pf-dialog{ padding: 32px 20px 24px; }
  .pf-reihe{ grid-template-columns: 1fr; gap: 0; }
  .pf-tel{ grid-template-columns: 100px 1fr; }
}
@media (prefers-reduced-motion: reduce){
  .pf-dialog[open], .pf-haken{ animation: none; }
}
