/* ═════════ Форма «Оставить отзыв» (Strong Testimonials) ═════════
   Подключается только на странице формы. Все правила — внутри .strong-view. */

/* Вступление над формой (необязательно, см. инструкцию) */
.cpo-form-intro { max-width: 760px; margin: 8px auto 28px; text-align: center; }
.cpo-form-intro h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -.01em;
  text-transform: none; color: #1c2530;
}
.cpo-form-intro p { margin: 0 auto; max-width: 52ch; font-size: 17px; line-height: 1.55; color: #5b6978; }

body .strong-view {
  --f-accent: #02778b;
  --f-accent-dark: #025f6f;
  --f-ink: #1c2530;
  --f-muted: #5b6978;
  --f-line: #d5dde5;
  --f-error: #b3261e;
  max-width: 760px;
  margin: 8px auto 56px;
  color: var(--f-ink);
}

/* Карточка: оборачивает весь блок, включая «Обязательное поле» */
body .strong-view:has(form) {
  box-sizing: border-box;
  padding: clamp(26px, 4.5vw, 44px);
  background: #fff linear-gradient(90deg, #02778b, #a9c624) top / 100% 5px no-repeat;
  border: 1px solid var(--f-line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 50px -30px rgba(28, 37, 48, .4);
}
body .strong-view form { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
/* Старые браузеры без :has — карточка вокруг самой формы */
@supports not selector(:has(*)) {
  body .strong-view form {
    padding: clamp(26px, 4.5vw, 44px); background: #fff;
    border: 1px solid var(--f-line); border-radius: 22px;
    box-shadow: 0 24px 50px -30px rgba(28, 37, 48, .4);
  }
}

/* «Обязательное поле» */
body .strong-view .required-notice {
  margin: 0 0 26px;
  padding-bottom: 18px;
  font-size: 14px; color: var(--f-muted);
  border-bottom: 1px solid #edf1f5;
}
body .strong-view .required.symbol::after,
body .strong-view .required-notice .required::after { content: "*"; margin-left: 3px; color: var(--f-error); }

/* Поле */
body .strong-view .form-field { margin: 0 0 24px; }
body .strong-view .form-field.submit,
body .strong-view .form-field:last-child { margin-bottom: 0; }

body .strong-view label {
  display: inline-block;
  margin: 0 0 8px;
  font-size: 15px; font-weight: 600; line-height: 1.3;
  letter-spacing: normal; text-transform: none;
  color: var(--f-ink);
}

/* Подсказка под полем */
body .strong-view .after {
  display: block;
  margin: 8px 0 26px;
  font-size: 14px; line-height: 1.5; color: var(--f-muted);
}

/* Поля ввода */
body .strong-view input[type="text"],
body .strong-view input[type="email"],
body .strong-view input[type="url"],
body .strong-view input[type="tel"],
body .strong-view select,
body .strong-view textarea {
  display: block;
  box-sizing: border-box;
  width: 100%; max-width: 100%;
  padding: 14px 16px;
  font: inherit; font-size: 16px; line-height: 1.5;
  color: var(--f-ink);
  background: #fff;
  border: 1px solid var(--f-line);
  border-radius: 12px;
  box-shadow: none;
  transition: border-color .2s, box-shadow .2s;
}
body .strong-view textarea { min-height: 180px; line-height: 1.65; resize: vertical; }
body .strong-view input[type="text"]:hover,
body .strong-view input[type="email"]:hover,
body .strong-view textarea:hover { border-color: #aebcc9; }
body .strong-view input[type="text"]:focus,
body .strong-view input[type="email"]:focus,
body .strong-view input[type="url"]:focus,
body .strong-view input[type="tel"]:focus,
body .strong-view select:focus,
body .strong-view textarea:focus {
  outline: none;
  border-color: var(--f-accent);
  box-shadow: 0 0 0 4px rgba(2, 119, 139, .16);
}

/* Загрузка фото */
body .strong-view input[type="file"] {
  display: block; box-sizing: border-box;
  width: 100%; max-width: 100%;
  padding: 14px 16px;
  font: inherit; font-size: 15px; color: var(--f-muted);
  background: #f6fafc;
  border: 2px dashed #b9c8d4;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
body .strong-view input[type="file"]:hover { border-color: var(--f-accent); background: #eef7f9; }
body .strong-view input[type="file"]::file-selector-button {
  margin-right: 14px; padding: 10px 20px;
  font: inherit; font-weight: 600; color: #fff;
  background: var(--f-accent);
  border: 0; border-radius: 999px; cursor: pointer;
  transition: background .2s;
}
body .strong-view input[type="file"]::file-selector-button:hover { background: var(--f-accent-dark); }

/* Ошибки проверки полей */
body .strong-view input.error,
body .strong-view textarea.error,
body .strong-view select.error { border-color: var(--f-error); background: #fff8f7; }
body .strong-view label.error,
body .strong-view span.error,
body .strong-view .field-error {
  display: block; margin: 8px 0 0;
  font-size: 14px; font-weight: 500; color: var(--f-error);
}

/* Кнопка отправки (тема раздувает её отступами — перебиваем) */
body .strong-view input[type="submit"],
body .strong-view button[type="submit"] {
  display: inline-flex !important; align-items: center; justify-content: center;
  box-sizing: border-box;
  height: auto !important; min-height: 0 !important;
  margin: 4px 0 0 !important;
  padding: 15px 36px !important;
  font: inherit; font-size: 16px !important; font-weight: 600; line-height: 1.2 !important;
  letter-spacing: normal !important; text-transform: none !important;
  color: #fff; background: var(--f-accent);
  border: 0; border-radius: 999px !important;
  box-shadow: 0 8px 20px -10px rgba(2, 119, 139, .7);
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
}
body .strong-view input[type="submit"]:hover,
body .strong-view button[type="submit"]:hover {
  background: var(--f-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -10px rgba(2, 119, 139, .8);
}
body .strong-view input[type="submit"]:focus-visible,
body .strong-view button[type="submit"]:focus-visible { outline: 3px solid #a9c624; outline-offset: 3px; }

/* Сообщение «Спасибо, отзыв отправлен» */
body .strong-view .testimonial-success,
body .strong-view .wpmtst-success {
  padding: 24px 28px;
  font-size: 17px; line-height: 1.6; color: var(--f-ink);
  background: #eef7e4;
  border: 1px solid #cfe5a8;
  border-radius: 18px;
}

@media (max-width: 600px) {
  body .strong-view:has(form) { border-radius: 18px; }
  body .strong-view input[type="submit"],
  body .strong-view button[type="submit"] { width: 100%; }
  body .strong-view input[type="file"]::file-selector-button { display: block; margin: 0 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  body .strong-view * { transition: none !important; }
  body .strong-view input[type="submit"]:hover { transform: none; }
}

/* ═════════ Кнопка отправки: усиленная версия ═════════
   Тема принудительно раздувает кнопку. Идентификатор #content в селекторе
   даёт этим правилам больший вес, чем у большинства правил темы. */
html body #content .strong-view input[type="submit"],
html body #content .strong-view button[type="submit"] {
  display: inline-flex !important;
  align-items: center !important; justify-content: center !important;
  box-sizing: border-box !important;
  width: auto !important; min-width: 0 !important; max-width: 100% !important;
  height: auto !important; min-height: 0 !important; max-height: none !important;
  margin: 4px 0 0 !important;
  padding: 14px 34px !important;
  border: 0 !important; border-radius: 999px !important;
  font-family: inherit !important; font-size: 16px !important; font-weight: 600 !important;
  line-height: 1.2 !important; letter-spacing: normal !important; text-transform: none !important;
  zoom: 1 !important; transform: none;
  color: #fff !important; background: #02778b !important; background-image: none !important;
  box-shadow: 0 8px 20px -10px rgba(2, 119, 139, .7) !important;
}
html body #content .strong-view input[type="submit"]:hover,
html body #content .strong-view button[type="submit"]:hover {
  background: #025f6f !important;
  transform: translateY(-1px);
}
@media (max-width: 600px) {
  html body #content .strong-view input[type="submit"],
  html body #content .strong-view button[type="submit"] { width: 100% !important; }
}

/* Обёртка кнопки — просто контейнер, без фона и отступов (иначе получается «кнопка в кнопке») */
html body #content .strong-view .form-field.submit,
html body #content .strong-view .wpmtst-submit:not(input):not(button),
html body #content .strong-view .button:not(input):not(button) {
  display: block !important;
  width: auto !important; height: auto !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important;
  background: none !important; border: 0 !important; border-radius: 0 !important;
  box-shadow: none !important;
}
html body #content .strong-view .form-field.submit { margin-top: 4px !important; }

/* ═════════ Красная звёздочка у обязательных полей ═════════
   Не зависит от разметки плагина: подпись получает звёздочку, если рядом с ней
   стоит поле с required / aria-required. Родную «звёздочку-символ» плагина
   отключаем, чтобы не было двух красных. */
body .strong-view .required.symbol::after,
body .strong-view .required.symbol::before { content: none !important; }

body .strong-view :has(> input[required], > textarea[required], > select[required],
                       > input[aria-required="true"], > textarea[aria-required="true"]) > label::after {
  content: "*";
  margin-left: 4px;
  color: #d32f2f;
  font-weight: 700;
}
