/* ==========================================================================
   FBS Landingpage — Bruecke zwischen Contact Form 7 und dem LP-Design

   Contact Form 7 kapselt jedes Feld in <span class="wpcf7-form-control-wrap">
   und benutzt fuer Radios/Checkboxen eigene .wpcf7-list-item-Strukturen.
   Diese Datei bildet die Regeln aus css/style.css (.choice, .check, .error-msg)
   auf diese Markup-Struktur ab. style.css bleibt dadurch unveraendert und
   weiter mit der reinen HTML-Version der Landingpage austauschbar.
   ========================================================================== */

/* CF7-Wrapper transparent machen ---------------------------------------- */
.form-card .wpcf7 { margin: 0; }
.fbs-lp-form { margin: 0; }
.fbs-lp-form .wpcf7-form-control-wrap { display: block; position: static; }

/* Honeypot: fuer Menschen und Screenreader unsichtbar ------------------- */
.fbs-lp-form .fbs-lp-hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Textfelder, Selects, Textarea ----------------------------------------- */
/* .input kommt per class:input aus dem Formular-Template, hier nur noch
   die Zustaende, die CF7 selbst setzt. */
.fbs-lp-form .input { display: block; }
.fbs-lp-form .wpcf7-not-valid.input,
.fbs-lp-form .input.is-invalid {
  border-color: var(--red);
  background-color: #fff7f8;
}
.fbs-lp-form select.wpcf7-not-valid.input { background-color: #fff7f8; }
.fbs-lp-form .wpcf7-not-valid.input:focus {
  box-shadow: 0 0 0 4px rgba(207, 3, 35, .12);
}

/* Auswahlkacheln (Produktart) ------------------------------------------- */
/* Der Container traegt .choices bereits per class:choices am [radio]-Tag. */
.fbs-lp-form .choices { display: grid; }
.fbs-lp-form .choices .wpcf7-list-item {
  display: block;
  position: relative;
  margin: 0;
}
.fbs-lp-form .choices .wpcf7-list-item > label {
  display: block;
  height: 100%;
  margin: 0;
  font-weight: 400;
}
.fbs-lp-form .choices .wpcf7-list-item input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.fbs-lp-form .choices .wpcf7-list-item-label {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.3;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease),
              color .18s var(--ease), box-shadow .18s var(--ease);
}
.fbs-lp-form .choices .wpcf7-list-item-label::before {
  content: '';
  width: 16px; height: 16px;
  flex: 0 0 auto;
  border: 2px solid var(--border);
  border-radius: 50%;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.fbs-lp-form .choices .wpcf7-list-item-label:hover { border-color: #b8c9da; }
.fbs-lp-form .choices input:checked + .wpcf7-list-item-label {
  border-color: var(--blue);
  background: #f4f9ff;
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 74, 153, .10);
}
.fbs-lp-form .choices input:checked + .wpcf7-list-item-label::before {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 4px var(--blue);
}
.fbs-lp-form .choices input:focus-visible + .wpcf7-list-item-label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Datenschutz-Checkbox (acceptance) ------------------------------------- */
.fbs-lp-form .wpcf7-acceptance .wpcf7-list-item { display: block; margin: 0; }
.fbs-lp-form .wpcf7-acceptance .wpcf7-list-item > label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-2);
  cursor: pointer;
}
.fbs-lp-form .wpcf7-acceptance input[type="checkbox"] {
  width: 19px; height: 19px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: var(--blue);
  cursor: pointer;
}
.fbs-lp-form .wpcf7-acceptance a { text-decoration: underline; }
.fbs-lp-form #wrapDsgvo.has-error .wpcf7-acceptance .wpcf7-list-item > label {
  color: var(--red);
}

/* Optgroups im Material-Select (per JS aus " » " gebildet) -------------- */
.fbs-lp-form select.input optgroup {
  font-weight: 700;
  color: var(--blue);
  background: #f2f6fa;
}
.fbs-lp-form select.input optgroup option {
  font-weight: 400;
  color: var(--ink);
  background: #fff;
}

/* Fehlermeldungen ------------------------------------------------------- */
/* Eigene .error-msg-Texte und CF7-Tips sollen nie doppelt erscheinen:
   sobald CF7 einen Tip ausgibt, uebernimmt dieser. */
.fbs-lp-form .wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--red);
}
.fbs-lp-form .field:has(.wpcf7-not-valid-tip) > .error-msg,
.fbs-lp-form .fieldset:has(.wpcf7-not-valid-tip) > .error-msg { display: none; }

/* Sammelmeldung von CF7 unter dem Formular ------------------------------ */
.fbs-lp-form .wpcf7-response-output {
  margin: 22px 0 0;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: .875rem;
  line-height: 1.5;
}
.fbs-lp-form.invalid .wpcf7-response-output,
.fbs-lp-form.unaccepted .wpcf7-response-output,
.fbs-lp-form.spam .wpcf7-response-output,
.fbs-lp-form.failed .wpcf7-response-output,
.fbs-lp-form.aborted .wpcf7-response-output {
  border-color: var(--red);
  background: #fff7f8;
  color: var(--red-dark);
}
.fbs-lp-form.sent .wpcf7-response-output { display: none; }

/* Ladezustand waehrend des Absendens ------------------------------------ */
.fbs-lp-form.submitting #btnSubmit {
  opacity: .6;
  pointer-events: none;
}
.fbs-lp-form.submitting #btnSubmit::after {
  content: '';
  width: 15px; height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: fbsSpin .7s linear infinite;
}
@keyframes fbsSpin { to { transform: rotate(360deg); } }

/* reCAPTCHA-Badge nicht unter die mobile Sticky-Leiste rutschen ---------
   Google positioniert das Badge per Inline-Style, daher !important. */
@media (max-width: 760px) {
  .grecaptcha-badge { bottom: 66px !important; }
}

/* CF7-Screenreader-Ausgaben oberhalb des Formulars nicht mitlayouten --- */
.form-card .screen-reader-response { position: absolute; left: -9999px; }

/* Nach erfolgreichem Versand bleibt nur die eigene Erfolgsmeldung ------- */
.form-card.is-sent .wpcf7 { display: none; }

/* --- Premium-Empfehlung im Formular (Kundenfeedback 20.08.2026) ---------
   Steht statt des frueheren "bitte beraten Sie mich"-Hinweises unter dem
   Material-Select und traegt den USP direkt ins Formular. */
.fbs-lp-form .premium-hint {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding: 15px 17px;
  border: 1.5px solid var(--blue);
  border-radius: 8px;
  background: #f4f9ff;
}
.fbs-lp-form .premium-hint > .ico {
  width: 22px; height: 22px;
  flex: 0 0 auto;
  fill: var(--blue);
  margin-top: 1px;
}
.fbs-lp-form .premium-hint p {
  margin: 0;
  font-size: .8125rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.fbs-lp-form .premium-hint b { color: var(--blue); font-weight: 700; }

.fbs-lp-form .premium-hint__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 11px !important;
}
.fbs-lp-form .premium-hint__btn {
  padding: 8px 15px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s var(--ease);
}
.fbs-lp-form .premium-hint__btn:hover { background: var(--blue-dark); }
.fbs-lp-form .premium-hint__actions a {
  font-size: .75rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: underline;
}

/* --- Bedingte Felder ----------------------------------------------------
   Felder mit data-show-if erscheinen erst, wenn die passende Option gewaehlt
   ist. Versteckt werden sie ueber das hidden-Attribut (siehe main.js); hier
   kommt nur die Gestaltung dazu. Der Akzentstrich links macht sichtbar, dass
   es sich um eine Rueckfrage zur Auswahl darueber handelt. */
.fbs-lp-form .is-conditional {
  padding-left: 15px;
  border-left: 3px solid var(--accent);
  animation: fbsFieldIn .28s var(--ease);
}
.fbs-lp-form .is-conditional.has-error { border-left-color: var(--red); }

@keyframes fbsFieldIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fbs-lp-form .is-conditional { animation: none; }
}
