/**
 * Contact Form 7 – cfs__ Design Integration
 *
 * The form is wrapped in <div class="cfs__form"> in the PHP template.
 * This file bridges CF7's wpcf7__ elements to the existing cfs__ design tokens.
 *
 * @package Ortorodzina
 * @since 1.0.0
 */

/* ── 1. Reset CF7 wrappers so cfs__form outer div styles don't double ────── */

.cfs__form .wpcf7,
.cfs__form .wpcf7-form {
  padding: 0;
  margin: 0;
  background: none;
  border: none;
}

/* ── 2. Make wpcf7-form-control-wrap span block so it fills cfs__form-group ─ */

.cfs__form .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

/* ── 3. Submit button — CF7 generates <input type="submit">, ensure full width */

.cfs__form input.cfs__submit {
  width: 100%;
  font-size: 16px;
  padding: 14px 24px;
  cursor: pointer;
  font-family: var(--font-body);
  line-height: 1.5;
}

/* spinner that appears next to submit while sending */
.cfs__form .wpcf7-spinner {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

/* ── 4. Acceptance (RODO consent checkbox) ──────────────────────────────── */

.cfs__consent .wpcf7-acceptance {
  display: block;
}

.cfs__consent .wpcf7-acceptance label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  cursor: pointer;
}

.cfs__consent .wpcf7-acceptance input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.cfs__consent .wpcf7-acceptance .wpcf7-list-item-label {
  font-size: 13px;
  color: var(--color-text-soft);
  line-height: 1.55;
}

/* ── 5. Validation: highlight invalid fields ────────────────────────────── */

.cfs__form .wpcf7-not-valid {
  border-color: #e53e3e !important;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.08) !important;
}

/* ── 6. Inline validation error message ────────────────────────────────── */

.cfs__form .wpcf7-not-valid-tip {
  display: block;
  font-size: 12px;
  color: #e53e3e;
  margin-top: 4px;
  line-height: 1.4;
}

/* ── 7. Form-level response output (success / error banner) ─────────────── */

.cfs__form .wpcf7-response-output {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid;
}

.cfs__form .wpcf7-form.sent .wpcf7-response-output {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.cfs__form .wpcf7-form.failed .wpcf7-response-output,
.cfs__form .wpcf7-form.spam .wpcf7-response-output,
.cfs__form .wpcf7-form.invalid .wpcf7-response-output,
.cfs__form .wpcf7-form.aborted .wpcf7-response-output {
  background: #fff1f0;
  border-color: #fca5a5;
  color: #991b1b;
}

/* ── 8. Select placeholder style (blank first option via include_blank) ──── */

.cfs__form select.cfs__select option[value=""] {
  color: var(--color-text-soft);
}
