/* Lead form styles */

.form-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.custom-form {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 18px;
}

.custom-form__wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.custom-form form.leadform,
form.leadform {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 24px;
  box-sizing: border-box;
  border-radius: 18px;
  border: 2px solid rgba(74, 114, 255, 0.85);
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(15, 16, 25, 0.28);
}

.custom-form form.leadform input[type='text'],
.custom-form form.leadform input[type='email'],
.custom-form form.leadform input[type='tel'],
form.leadform input[type='text'],
form.leadform input[type='email'],
form.leadform input[type='tel'] {
  display: block;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 14px 16px;
  box-sizing: border-box;
  border: 1px solid rgba(160, 169, 189, 0.55);
  border-radius: 12px;
  background: #fff;
  color: #1d1d1d;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.custom-form form.leadform input::placeholder,
form.leadform input::placeholder {
  color: #8a8f9c;
  font-weight: 400;
  opacity: 1;
}

.custom-form form.leadform input:focus,
form.leadform input:focus {
  outline: none;
  border-color: #4a72ff;
  box-shadow: 0 0 0 3px rgba(74, 114, 255, 0.22);
}

.custom-form form.leadform input.valid,
form.leadform input.valid {
  background-color: rgba(199, 248, 206, 0.65);
  border-color: #4caf50;
  box-shadow: none;
}

.custom-form form.leadform input.invalid,
form.leadform input.invalid {
  background-color: rgba(248, 196, 192, 0.65);
  border-color: #e53935;
  box-shadow: none;
}

.custom-form form.leadform .iti,
form.leadform .iti,
.custom-form form.leadform .intl-tel-input,
form.leadform .intl-tel-input {
  width: 100%;
  display: block;
}


.custom-form form.leadform button.submit,
form.leadform button.submit,
.custom-form form.leadform .submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  margin-top: 6px;
  padding: 16px 24px;
  box-sizing: border-box;
  border: 1px solid rgba(160, 169, 189, 0.4);
  border-radius: 16px;
  background: linear-gradient(140deg, #4a72ff 0%, #7ed4ff 100%);
  color: #071022;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(67, 120, 255, 0.38);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease;
}

.custom-form form.leadform button.submit:hover,
form.leadform button.submit:hover,
.custom-form form.leadform .submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(85, 152, 255, 0.45);
  filter: brightness(1.04);
}

.custom-form form.leadform button.submit:active,
form.leadform button.submit:active {
  transform: translateY(0);
  box-shadow: 0 10px 22px rgba(67, 120, 255, 0.3);
}

.custom-form form.leadform .error-msg,
form.leadform .error-msg {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 2px;
  color: #ff3355;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}

.custom-form form.leadform .error-msg.hide,
form.leadform .error-msg.hide,
.custom-form form.leadform .hide {
  display: none;
}

.custom-form form.leadform .form-preloader,
form.leadform .form-preloader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(15, 16, 25, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.custom-form form.leadform .form-preloader.hidden,
form.leadform .form-preloader.hidden {
  display: none;
}

.custom-form form.leadform .form-preloader .spinner,
form.leadform .form-preloader .spinner {
  width: 50px;
  height: 50px;
  animation: leadform-spin 1s linear infinite;
}

.custom-form form.leadform .form-preloader .path,
form.leadform .form-preloader .path {
  stroke: #7ed4ff;
  stroke-linecap: round;
  animation: leadform-dash 1.4s ease-in-out infinite;
}

@keyframes leadform-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes leadform-dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

.custom-form__mask {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
}

/* Поля имени из core/form.php — тот же столбец и отступ, что у остальных полей */
.apx-lead {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.apx-lead .apx-lead-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

@media screen and (max-width: 576px) {
  .custom-form,
  .form-container {
    max-width: 100%;
  }

  .custom-form form.leadform,
  form.leadform {
    padding: 22px 16px;
    border-radius: 14px;
  }

  .custom-form form.leadform input[type='text'],
  .custom-form form.leadform input[type='email'],
  .custom-form form.leadform input[type='tel'],
  form.leadform input[type='text'],
  form.leadform input[type='email'],
  form.leadform input[type='tel'] {
    min-height: 50px;
    font-size: 15px;
  }

  .custom-form form.leadform button.submit,
  form.leadform button.submit {
    min-height: 52px;
    font-size: 15px;
  }
}
