
.wpcf7 {
  background: var(--white);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  max-width: 700px;           /* можно сузить/расширить по месту */
  margin: 0 auto 40px;
}
.wpcf7::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-blue), #0051D5);
}

/* Прячем служебные поля CF7 */
.wpcf7 .hidden-fields-container { display: none; }

/* Базовая типографика */
.wpcf7 h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--dark-text);
}
.wpcf7 > .wpcf7-form > p { margin-bottom: 14px; }
.wpcf7 label {
  display: block;
  font-size: 14px;
  color: var(--gray-text);
  margin-bottom: 8px;
}

/* Текстовые поля, email, телефон, textarea, select */
.wpcf7 .wpcf7-form-control.wpcf7-text,
.wpcf7 .wpcf7-form-control.wpcf7-email,
.wpcf7 .wpcf7-form-control.wpcf7-tel,
.wpcf7 .wpcf7-form-control.wpcf7-url,
.wpcf7 .wpcf7-form-control.wpcf7-number,
.wpcf7 .wpcf7-form-control.wpcf7-date,
.wpcf7 .wpcf7-form-control.wpcf7-textarea,
.wpcf7 .wpcf7-form-control.wpcf7-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #E5E5E7;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--light-gray);
  color: var(--dark-text);
  outline: none;
  box-shadow: none;
}

.wpcf7 .wpcf7-form-control.wpcf7-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Плейсхолдеры */
.wpcf7 .wpcf7-form-control::placeholder { color: #999; }

/* Фокус */
.wpcf7 .wpcf7-form-control:focus {
  border-color: var(--primary-blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

/* Select — системная стрелка, стилизуем */
.wpcf7 .wpcf7-form-control.wpcf7-select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230071E3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Чекбоксы / радиокнопки — «пилюли» с видимым состоянием */
.wpcf7 .wpcf7-checkbox .wpcf7-list-item,
.wpcf7 .wpcf7-radio .wpcf7-list-item {
  display: inline-flex;
  align-items: center;
  margin: 6px 8px 6px 0;
  position: relative;
}

/* Инпут перекрывает всю пилюлю: кликается в любой точке */
.wpcf7 .wpcf7-checkbox input[type="checkbox"],
.wpcf7 .wpcf7-radio    input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;          /* прозрачный, но кликабельный */
  margin: 0;
  z-index: 2;
  cursor: pointer;
  appearance: none;
}

/* Внешний вид «пилюли» */
.wpcf7 .wpcf7-list-item-label {
  display: inline-block;
  padding: 10px 18px;
  background: rgba(0, 113, 227, 0.08);
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-blue);
  border: 2px solid rgba(0, 113, 227, 0.15);
  transition: all 0.2s ease;
  cursor: pointer;
}

/* Hover (визуальная обратная связь) */
.wpcf7 .wpcf7-list-item-label:hover {
  color: #fff;
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,113,227,0.2);
}

/* Активное состояние: через соседство и через :has() (кросс-браузерно) */
.wpcf7 .wpcf7-checkbox input[type="checkbox"]:checked + .wpcf7-list-item-label,
.wpcf7 .wpcf7-radio    input[type="radio"]:checked    + .wpcf7-list-item-label,
.wpcf7 .wpcf7-checkbox .wpcf7-list-item:has(input:checked) .wpcf7-list-item-label,
.wpcf7 .wpcf7-radio    .wpcf7-list-item:has(input:checked) .wpcf7-list-item-label {
  color: #fff;
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  box-shadow: 0 6px 20px rgba(0,113,227,0.3);
}

/* Фокус клавиатурой */
.wpcf7 .wpcf7-checkbox input[type="checkbox"]:focus-visible + .wpcf7-list-item-label,
.wpcf7 .wpcf7-radio    input[type="radio"]:focus-visible    + .wpcf7-list-item-label,
.wpcf7 .wpcf7-checkbox .wpcf7-list-item:has(input:focus-visible) .wpcf7-list-item-label,
.wpcf7 .wpcf7-radio    .wpcf7-list-item:has(input:focus-visible) .wpcf7-list-item-label {
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.2);
}

/* Кнопка отправки — как .form-submit */
.wpcf7 input[type="submit"].wpcf7-form-control,
.wpcf7 .wpcf7-submit {
  width: 100%;
  padding: 14px 20px;
  background: var(--primary-blue);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 6px;
}
.wpcf7 .wpcf7-submit:hover {
  background: #0051D5;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.3);
}
.wpcf7 .wpcf7-submit:active { transform: translateY(0); }

/* Спиннер CF7 рядом с кнопкой */
.wpcf7 .wpcf7-spinner {
  margin-left: 10px;
  transform: translateY(2px);
}

/* Сообщения валидации (в стиле .form-alert) */
.wpcf7 .wpcf7-not-valid { border-color: #f5c2c2 !important; background: #fdecea !important; }
.wpcf7 .wpcf7-not-valid:focus { box-shadow: 0 0 0 4px rgba(255, 77, 64, 0.15) !important; }

.wpcf7 .wpcf7-not-valid-tip {
  margin-top: 6px;
  display: block;
  font-size: 13px;
  color: #8a1f11;
}

.wpcf7 form .wpcf7-response-output {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid transparent;
}

/* Статусные цвета (CF7 >= 5.6 — берём data-status) */
.wpcf7 form[data-status="sent"]       .wpcf7-response-output { background:#e8f7ed; color:#0a6735; border-color:#bde5c8; }
.wpcf7 form[data-status="invalid"]    .wpcf7-response-output,
.wpcf7 form[data-status="validation_failed"] .wpcf7-response-output,
.wpcf7 form[data-status="spam"]       .wpcf7-response-output,
.wpcf7 form[data-status="aborted"]    .wpcf7-response-output,
.wpcf7 form[data-status="mail_failed"] .wpcf7-response-output { background:#fdecea; color:#8a1f11; border-color:#f5c2c2; }

/* Отступы между элементами, как в геро-форме */
.wpcf7 .wpcf7-form-control-wrap { display: block; }
.wpcf7 p { margin: 0 0 12px; }

/* Мобильные правки */
@media (max-width: 767px) {
  .wpcf7 { padding: 24px; border-radius: 16px; }
  .wpcf7 .wpcf7-list-item-label { padding: 9px 16px; font-size: 13px; }
}

/* Доступность: видимый фокус для ярлыков-пилюль при табе */
.wpcf7 .wpcf7-checkbox input[type="checkbox"]:focus + .wpcf7-list-item-label,
.wpcf7 .wpcf7-radio    input[type="radio"]:focus + .wpcf7-list-item-label {
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.2);
}


/* ===== File input (красиво) ===== */
.wpcf7 .wpcf7-form-control.wpcf7-file{
  display:block;
  width:100%;
  padding:12px 16px;
  border:1px solid #E5E5E7;
  border-radius:12px;
  background:var(--light-gray);
  color:var(--dark-text);
  font-size:15px;
  line-height:1.3;
  cursor:pointer;
  transition:box-shadow .2s, border-color .2s, background .2s;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.wpcf7 .wpcf7-form-control.wpcf7-file:focus{
  outline:none;
  border-color:var(--primary-blue);
  background:#fff;
  box-shadow:0 0 0 4px rgba(0,113,227,.10);
}

/* Кнопка выбора файла (современные браузеры) */
.wpcf7 .wpcf7-file::file-selector-button{
  background:var(--primary-blue);
  color:#fff;
  border:none;
  border-radius:10px;
  padding:10px 16px;
  margin-right:12px;
  font-weight:600;
  cursor:pointer;
  transition:transform .2s, box-shadow .2s, background .2s;
}
.wpcf7 .wpcf7-file:hover::file-selector-button{
  background:#0051D5;
  transform:translateY(-1px);
  box-shadow:0 4px 12px rgba(0,113,227,.25);
}
.wpcf7 .wpcf7-file:active::file-selector-button{
  transform:translateY(0);
  box-shadow:none;
}

/* Фоллбек для WebKit */
.wpcf7 .wpcf7-file::-webkit-file-upload-button{
  background:var(--primary-blue);
  color:#fff;
  border:none;
  border-radius:10px;
  padding:10px 16px;
  margin-right:12px;
  font-weight:600;
  cursor:pointer;
  transition:transform .2s, box-shadow .2s, background .2s;
}
.wpcf7 .wpcf7-file:hover::-webkit-file-upload-button{
  background:#0051D5;
  transform:translateY(-1px);
  box-shadow:0 4px 12px rgba(0,113,227,.25);
}
.wpcf7 .wpcf7-file:active::-webkit-file-upload-button{
  transform:translateY(0);
  box-shadow:none;
}

/* ===== Acceptance (скрываем дефолтный чекбокс и делаем «пилюлю») ===== */
.wpcf7 .wpcf7-acceptance .wpcf7-list-item > label{
  display:inline-flex;
  align-items:center;
  gap:10px;
  position:relative;
}

/* Скрытый, но доступный инпут — НЕ перекрываем ссылку внутри лейбла */
.wpcf7 .wpcf7-acceptance input[type="checkbox"]{
  position:absolute;
  opacity:0;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
  white-space:nowrap;
  margin:0;
}

/* Внешний вид «пилюли» текста согласия */
.wpcf7 .wpcf7-acceptance .wpcf7-list-item-label{
  display:inline-block;
  padding:10px 18px;
  background:rgba(0,113,227,.08);
  border:2px solid rgba(0,113,227,.15);
  border-radius:50px;
  font-size:14px;
  font-weight:600;
  color:var(--primary-blue);
  transition:all .2s ease;
}
.wpcf7 .wpcf7-acceptance .wpcf7-list-item-label a{
  color:inherit;
  text-decoration:underline;
}

/* Hover/Focus */
.wpcf7 .wpcf7-acceptance .wpcf7-list-item-label:hover{
  background:var(--primary-blue);
  color:#fff;
  border-color:var(--primary-blue);
  transform:translateY(-2px);
  box-shadow:0 6px 20px rgba(0,113,227,.2);
}
.wpcf7 .wpcf7-acceptance input[type="checkbox"]:focus-visible + .wpcf7-list-item-label{
  box-shadow:0 0 0 4px rgba(0,113,227,.2);
}

/* Checked состояние */
.wpcf7 .wpcf7-acceptance input[type="checkbox"]:checked + .wpcf7-list-item-label{
  background:var(--primary-blue);
  color:#fff;
  border-color:var(--primary-blue);
  box-shadow:0 6px 20px rgba(0,113,227,.3);
}

/* Текст ошибок рядом с acceptance */
.wpcf7 .wpcf7-acceptance .wpcf7-not-valid-tip{
  display:block;
  margin-top:8px;
  font-size:13px;
  color:#8a1f11;
}

/* Центровка кнопки (если нужен контейнер .center-button) */
.center-button{text-align:center;}
.center-button .wpcf7-submit{max-width:420px}
