/*
 * Один вид для форм Otter, Contact Form 7 и попапов.
 * Размеры и рамка не меняются при наведении: кнопка остаётся зелёной,
 * текст белым. Страничные стили задают hover через id, поэтому здесь !important.
 */

.wp-block-themeisle-blocks-form .wp-block-themeisle-blocks-form-input input,
.wp-block-themeisle-blocks-form .wp-block-themeisle-blocks-form-input textarea,
.wp-block-themeisle-blocks-form .wp-block-themeisle-blocks-form-input select,
.wpcf7-form
  input.wpcf7-form-control:not([type='submit']):not([type='checkbox']):not(
    [type='radio']
  ):not([type='file']),
.wpcf7-form textarea.wpcf7-form-control,
.wpcf7-form select.wpcf7-form-control,
.ays-pb-modal
  input:not([type='submit']):not([type='checkbox']):not([type='radio']):not(
    [type='hidden']
  ):not([type='file']),
.ays-pb-modal textarea,
.ays-pb-modal select {
  box-sizing: border-box !important;
  width: 100% !important;
  height: 50px !important;
  min-height: 50px !important;
  margin: 0 !important;
  padding: 0 20px !important;
  border: 1px solid #ecedf0 !important;
  border-radius: 10px !important;
  background-color: #ffffff !important;
  color: #3c4d6b !important;
  font-family: inherit !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 48px !important;
  outline: none !important;
  box-shadow: none !important;
}

.wp-block-themeisle-blocks-form .wp-block-themeisle-blocks-form-input textarea,
.wpcf7-form textarea.wpcf7-form-control,
.ays-pb-modal textarea {
  height: auto !important;
  min-height: 120px !important;
  padding: 14px 20px !important;
  line-height: 1.4 !important;
  resize: vertical;
}

/*
 * «Оформление заявки»: на странице высота поля 100px.
 * Ниже 768px обёртка сжимается до ширины текста, и поле становится узким.
 */
.main-form-7 form textarea.wpcf7-form-control {
  height: 100px !important;
  min-height: 100px !important;
  resize: none !important;
  position: static !important;
  left: auto !important;
  width: 100% !important;
}

@media (max-width: 768px) {
  .main-form-7 form label.textarea span {
    display: block !important;
    width: 100% !important;
  }
}

.wp-block-themeisle-blocks-form input[type='number'],
.wpcf7-form input[type='number'],
.ays-pb-modal input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.wp-block-themeisle-blocks-form input[type='number']::-webkit-outer-spin-button,
.wp-block-themeisle-blocks-form input[type='number']::-webkit-inner-spin-button,
.wpcf7-form input[type='number']::-webkit-outer-spin-button,
.wpcf7-form input[type='number']::-webkit-inner-spin-button,
.ays-pb-modal input[type='number']::-webkit-outer-spin-button,
.ays-pb-modal input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wp-block-themeisle-blocks-form
  .wp-block-themeisle-blocks-form-input
  input::placeholder,
.wp-block-themeisle-blocks-form
  .wp-block-themeisle-blocks-form-input
  textarea::placeholder,
.wpcf7-form input::placeholder,
.wpcf7-form textarea::placeholder,
.ays-pb-modal input::placeholder,
.ays-pb-modal textarea::placeholder {
  color: #b1b8c4 !important;
  font-weight: 300 !important;
  opacity: 1 !important;
}

.wp-block-themeisle-blocks-form
  .wp-block-themeisle-blocks-form-input
  input:hover,
.wp-block-themeisle-blocks-form
  .wp-block-themeisle-blocks-form-input
  input:focus,
.wp-block-themeisle-blocks-form
  .wp-block-themeisle-blocks-form-input
  textarea:hover,
.wp-block-themeisle-blocks-form
  .wp-block-themeisle-blocks-form-input
  textarea:focus,
.wp-block-themeisle-blocks-form
  .wp-block-themeisle-blocks-form-input
  select:hover,
.wp-block-themeisle-blocks-form
  .wp-block-themeisle-blocks-form-input
  select:focus,
.wpcf7-form
  input.wpcf7-form-control:not([type='submit']):not([type='checkbox']):not(
    [type='radio']
  ):not([type='file']):hover,
.wpcf7-form
  input.wpcf7-form-control:not([type='submit']):not([type='checkbox']):not(
    [type='radio']
  ):not([type='file']):focus,
.wpcf7-form textarea.wpcf7-form-control:hover,
.wpcf7-form textarea.wpcf7-form-control:focus,
.wpcf7-form select.wpcf7-form-control:hover,
.wpcf7-form select.wpcf7-form-control:focus,
.ays-pb-modal
  input:not([type='submit']):not([type='checkbox']):not([type='radio']):not(
    [type='hidden']
  ):not([type='file']):hover,
.ays-pb-modal
  input:not([type='submit']):not([type='checkbox']):not([type='radio']):not(
    [type='hidden']
  ):not([type='file']):focus,
.ays-pb-modal textarea:hover,
.ays-pb-modal textarea:focus,
.ays-pb-modal select:hover,
.ays-pb-modal select:focus {
  border-color: #979797 !important;
  outline: none !important;
  box-shadow: none !important;
}

.wp-block-themeisle-blocks-form .wp-block-button {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  align-self: stretch !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

/*
 * «Быстрый заказ» стоит в блоке с выравниванием по центру и сжимается
 * до ширины текста. Растягиваем на всю полосу, колонки делим поровну.
 * Ниже 993px страница сама ставит одну колонку.
 */
.wp-block-themeisle-blocks-form.horizontal-form {
  align-self: stretch !important;
  width: 100% !important;
  max-width: none !important;
}

.wp-block-themeisle-blocks-form.horizontal-form .otter-form__container {
  height: auto !important;
  align-items: start !important;
}

.wp-block-themeisle-blocks-form.horizontal-form
  .wp-block-themeisle-blocks-form-input,
.wp-block-themeisle-blocks-form.horizontal-form .wp-block-button {
  overflow: visible !important;
  height: auto !important;
  align-self: start !important;
  justify-content: flex-start !important;
}

.wp-block-themeisle-blocks-form.horizontal-form
  .wp-block-button
  button[type='submit'] {
  height: 50px !important;
  max-height: 50px !important;
  align-self: start !important;
}

@media (min-width: 993px) {
  .wp-block-themeisle-blocks-form.horizontal-form .otter-form__container {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) !important;
  }
}

.wp-block-themeisle-blocks-form .otter-error-message {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  display: block !important;
  margin: 0 0 0 20px !important;
  padding: 0 !important;
  color: #b42318 !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
}

.wp-block-themeisle-blocks-form.horizontal-form .otter-error-message {
  color: #ffffff !important;
}

.wp-block-themeisle-blocks-form .otter-form-input.otter-invalid-field {
  border-color: #b42318 !important;
  background-color: #ffffff !important;
}

.wp-block-themeisle-blocks-form .wp-block-button__link .spinner,
.wp-block-themeisle-blocks-form button[type='submit'] .spinner {
  position: absolute !important;
  top: 50% !important;
  right: auto !important;
  left: 50% !important;
  width: 18px !important;
  height: 18px !important;
  margin: -9px 0 0 -9px !important;
  padding: 0 !important;
}

.wp-block-themeisle-blocks-form .wp-block-button .wp-block-button__link,
.wp-block-themeisle-blocks-form button[type='submit'],
.wpcf7-form input.wpcf7-submit,
.wpcf7-form button.wpcf7-submit,
.ays-pb-modal .wpcf7-submit {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 50px !important;
  height: 50px !important;
  margin: 0 !important;
  padding: 0 28px !important;
  border: 1px solid #22b573 !important;
  border-radius: 10px !important;
  background-color: #22b573 !important;
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  letter-spacing: normal !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease !important;
}

.wp-block-themeisle-blocks-form .wp-block-button .wp-block-button__link:hover,
.wp-block-themeisle-blocks-form .wp-block-button .wp-block-button__link:focus,
.wp-block-themeisle-blocks-form button[type='submit']:hover,
.wp-block-themeisle-blocks-form button[type='submit']:focus,
.wpcf7-form input.wpcf7-submit:hover,
.wpcf7-form input.wpcf7-submit:focus,
.wpcf7-form button.wpcf7-submit:hover,
.wpcf7-form button.wpcf7-submit:focus,
.ays-pb-modal .wpcf7-submit:hover,
.ays-pb-modal .wpcf7-submit:focus,
.main-form-7 form .form-btn input:hover,
.main-form-7 form .form-btn input:focus,
.contact-form-banner form .form-btn input:hover,
.contact-form-banner form .form-btn input:focus {
  background-color: #1a9960 !important;
  border-color: #1a9960 !important;
  color: #ffffff !important;
  outline: none !important;
  box-shadow: none !important;
}

.wp-block-themeisle-blocks-form
  .wp-block-button
  .wp-block-button__link:has(.spinner),
.wp-block-themeisle-blocks-form
  .wp-block-button
  .wp-block-button__link:has(.spinner):hover,
.wp-block-themeisle-blocks-form
  .wp-block-button
  .wp-block-button__link:has(.spinner):focus,
.wp-block-themeisle-blocks-form button[type='submit']:has(.spinner),
.wp-block-themeisle-blocks-form button[type='submit']:has(.spinner):hover,
.wp-block-themeisle-blocks-form button[type='submit']:has(.spinner):focus {
  color: transparent !important;
}

.wpcf7-form .policy {
  box-sizing: border-box;
  padding-right: 20px !important;
  padding-left: 20px !important;
}

.wp-block-themeisle-blocks-form .o-form-server-response {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  flex: 1 0 100% !important;
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
  text-align: center !important;
}

.wp-block-themeisle-blocks-form .o-form-server-response:empty {
  display: none !important;
}

.wp-block-themeisle-blocks-form .o-form-server-response:not(:empty) {
  display: block !important;
  margin-top: 12px !important;
}

.wp-block-themeisle-blocks-form .o-form-server-response.o-success {
  display: none !important;
}

.wp-block-themeisle-blocks-form .o-form-server-response.o-error {
  color: #b42318 !important;
}

.wpcf7 form .wpcf7-response-output {
  margin: 12px 0 0 !important;
  padding: 0 !important;
  border: none !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
  text-align: center !important;
}

.wpcf7 form.sent .wpcf7-response-output {
  display: none !important;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output {
  color: #b42318 !important;
}

html.akudinov-form-popup-open {
  overflow: hidden;
}

/* Cost form: visible keyboard focus and inline Russian feedback. */
.aku-cost-form input:focus-visible {
  outline: 2px solid #167c4e !important; outline-offset:3px;
  border-color:#167c4e !important; box-shadow:0 0 0 3px rgba(34,181,115,.2) !important;
}
.aku-cost-form input[aria-invalid='true'] { border-color:#b42318 !important; }
.aku-cost-form__error { display:block; margin:8px 0 0; color:#fff; font-size:14px; line-height:1.4; }
.aku-cost-form__error:empty, .aku-cost-form__status:empty { display:none; }
.aku-cost-form__status { grid-column:1 / -1; width:100%; margin:12px 0 0; color:#fff; font-size:16px; line-height:1.5; }
.aku-cost-form .wp-block-button__link:focus-visible { outline:2px solid #fff !important; outline-offset:3px; }

.akudinov-form-popup {
  position: fixed;
  z-index: 1000000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.akudinov-form-popup[hidden] {
  display: none !important;
}

.akudinov-form-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(60, 77, 107, 0.45);
}

.akudinov-form-popup__dialog {
  position: relative;
  box-sizing: border-box;
  width: min(420px, 100%);
  margin: 0;
  padding: 32px 28px 28px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(60, 77, 107, 0.18);
  text-align: center;
}

.akudinov-form-popup__title {
  margin: 0 0 12px;
  color: #3c4d6b;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
}

.akudinov-form-popup__text {
  margin: 0 0 24px;
  color: #3c4d6b;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
}

.akudinov-form-popup__close {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  margin: 0;
  padding: 0 28px;
  border: 1px solid #22b573;
  border-radius: 10px;
  background: #22b573;
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.akudinov-form-popup__close:hover,
.akudinov-form-popup__close:focus {
  border-color: #1a9960;
  background: #1a9960;
  color: #ffffff;
}

@media (max-width: 600px) {
  .wp-block-themeisle-blocks-form .wp-block-button .wp-block-button__link,
  .wp-block-themeisle-blocks-form button[type='submit'],
  .wpcf7-form input.wpcf7-submit,
  .wpcf7-form button.wpcf7-submit,
  .ays-pb-modal .wpcf7-submit {
    height: auto !important;
    min-height: 50px !important;
    padding: 12px 20px !important;
    white-space: normal !important;
  }
}
