/* Formulare (Probetraining und Kontakt) – Community Fitness Blue Pit */
:root {
  /* Formular-Tokens */
  --pit-blue: #1b3d8d;      /* Markenfarbe */
  --deep-navy: #0a1b42;     /* dunkle Flächen */
  --signal-blue: #2f6bff;   /* Fokus, aktive Auswahl */
  --chalk: #f4f6fb;         /* helle Flächen */
  --rubber: #15171c;        /* Text auf hell */
  --steel: #5a6378;         /* Nebentext */
  --line: #d5dae6;
  --error: #c62828;
  --wa-green: #25d366;


  --r-field: 12px;
  --r-panel: 22px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Rechte Spalte: Formular als solide, helle Fläche */
.panel {
  background: #fff;
  border-radius: var(--r-panel);
  padding: clamp(24px, 3.4vw, 40px);
  box-shadow: 0 30px 80px -20px rgba(3, 7, 30, 0.6), 0 2px 6px rgba(3, 7, 30, 0.25);
  scroll-margin-top: 96px;
}

.form__title {
  margin: 0 0 22px;
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(1.9rem, 3vw, 2.4rem); line-height: 1; color: var(--pit-blue);
}
.form__notice { background: var(--chalk); padding: 12px 14px; border-radius: var(--r-field); }

.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.field label, .field legend {
  display: block; padding: 0; margin: 0 0 7px;
  font-weight: 650; font-size: 0.97rem; color: var(--rubber);
}
.opt { font-weight: 400; color: var(--steel); font-size: 0.88rem; margin-left: 4px; }
.field__hint { margin: 6px 0 0; font-size: 0.88rem; color: var(--steel); line-height: 1.4; }
.field__error { margin: 6px 0 0; font-size: 0.88rem; font-weight: 600; color: var(--error); min-height: 0; }
.field__error:empty { display: none; }

input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%;
  font: inherit; font-size: 1rem;  /* 16px verhindert Zoom auf dem iPhone */
  color: var(--rubber);
  background: var(--chalk);
  border: 1.5px solid transparent;
  border-radius: var(--r-field);
  padding: 13px 14px;
  min-height: 50px;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
input:hover, textarea:hover { border-color: var(--line); }
input:focus, textarea:focus {
  outline: none; background: #fff; border-color: var(--signal-blue);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.16);
}
.is-invalid input, .is-invalid textarea { border-color: var(--error); background: #fff7f7; }
.field--kid input { max-width: 120px; }

/* Auswahl-Chips (Radio-Buttons) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; margin: 0 !important; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 42px;
  padding: 9px 15px; border-radius: 999px;
  background: var(--chalk); border: 1.5px solid transparent;
  font-weight: 600; font-size: 0.95rem; color: var(--rubber);
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 100ms ease-out;
  -webkit-user-select: none; user-select: none;
}
.chips--small .chip span { min-height: 38px; padding: 7px 13px; font-size: 0.9rem; }
.chip:hover span { border-color: var(--line); }
.chip:active span { transform: scale(0.96); }
.chip input:checked + span { background: var(--pit-blue); color: #fff; border-color: var(--pit-blue); }
.chip input:focus-visible + span { outline: 3px solid var(--signal-blue); outline-offset: 2px; }
.is-invalid .chip span { border-color: rgba(198, 40, 40, 0.45); }

/* Einwilligung */
.consent {
  display: grid !important; grid-template-columns: 24px 1fr; gap: 12px; align-items: start;
  font-weight: 400 !important; font-size: 0.9rem !important; line-height: 1.45; color: var(--steel) !important;
  cursor: pointer;
}
.consent input {
  -webkit-appearance: none; appearance: none; margin: 0;
  width: 24px; height: 24px; border-radius: 7px;
  border: 1.5px solid #aab2c5; background: #fff; cursor: pointer;
  display: grid; place-items: center;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.consent input::after {
  content: ""; width: 11px; height: 6px; margin-top: -3px;
  border: 2.5px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) scale(0); transition: transform 140ms var(--ease-out);
}
.consent input:checked { background: var(--pit-blue); border-color: var(--pit-blue); }
.consent input:checked::after { transform: rotate(-45deg) scale(1); }
.consent a { color: var(--pit-blue); font-weight: 600; }
.is-invalid .consent input { border-color: var(--error); }

/* Honeypot: aus dem Bild, aber nicht display:none (manche Bots erkennen das) */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Absenden */
.submit {
  width: 100%; min-height: 58px; margin-top: 6px;
  border: 0; border-radius: 14px; cursor: pointer;
  background: var(--pit-blue); color: #fff;
  font: 400 1.35rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em;
  transition: background-color 160ms ease, transform 100ms ease-out;
  -webkit-tap-highlight-color: transparent;
}
.submit:hover { background: #2149ab; }
.submit:active { transform: scale(0.98); }
.submit[disabled] { cursor: progress; background: #4a64a8; }
.submit[disabled] .submit__label::after {
  content: ""; display: inline-block; width: 16px; height: 16px; margin-left: 10px; vertical-align: -2px;
  border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form__status { margin: 12px 0 0; font-weight: 600; color: var(--error); }
.form__status:empty { display: none; }
.form__note { margin: 14px 0 0; font-size: 0.86rem; line-height: 1.45; color: var(--steel); }
.form__note a { color: var(--pit-blue); font-weight: 600; }

/* Bestätigung */
.done { text-align: center; padding: 28px 8px 12px; outline: none; }
.done__mark { width: 72px; height: 72px; margin: 0 auto 18px; }
.done__mark circle { fill: var(--pit-blue); }
.done__mark path {
  fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40;
  animation: draw 420ms 120ms var(--ease-out) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.done:not([hidden]) { animation: appear 320ms var(--ease-out); }
@keyframes appear { from { opacity: 0; transform: scale(0.97); } }
.done__title {
  margin: 0 0 10px; font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: 2.2rem; line-height: 1; color: var(--pit-blue);
}
.done__text { margin: 0 auto 22px; max-width: 26rem; color: var(--steel); }
.done__link {
  display: inline-block; padding: 12px 20px; border-radius: 999px;
  background: var(--chalk); color: var(--pit-blue); font-weight: 650; text-decoration: none;
}

@media (max-width: 560px) { .panel { padding: 22px 18px 24px; border-radius: 18px; } }
@media (prefers-reduced-motion: reduce) { .done__mark path { stroke-dashoffset: 0; } }
@media (prefers-contrast: more) {
  input[type="text"], input[type="email"], input[type="tel"], textarea, .chip span { border-color: var(--steel); background: #fff; }
}
