/* Модальна форма на мобільних (використовує .modal з modal.css) */

.trial-form__modal {
  /* Наслідує .modal з modal.css */
}

.trial-form__modal .modal__content {
  background: var(--color-bg);
  border: 2px solid var(--color-primary);
}

.trial-form__modal .modal__title {
  color: var(--color-primary);
}

/* Специфічні стилі для форми в хедері (десктоп) */
.trial-form--desktop .form-group {
  margin-bottom: 0;
}

/* Повністю переписані стилі для Hero форми */
.trial-form--hero {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.trial-form--hero .form-group {
  position: relative;
  margin-bottom: 1rem;
}

.trial-form--hero .form-group:last-of-type {
  margin-bottom: 1.5rem;
}

.trial-form--hero .form-group input,
.trial-form--hero .form-group input[type="text"],
.trial-form--hero .form-group input[type="tel"],
.trial-form--hero .form-group input.form-group__input {
  background-color: var(--color-white);
  border: 2px solid var(--color-white);
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: var(--font-family-base);
  color: var(--color-black);
  min-height: 52px;
  width: 100%;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.trial-form--hero .form-group input:hover {
  border-color: var(--color-white);
  background-color: var(--color-white);
}

.trial-form--hero .form-group input:focus,
.trial-form--hero .form-group input[type="text"]:focus,
.trial-form--hero .form-group input[type="tel"]:focus,
.trial-form--hero .form-group input.form-group__input:focus {
  border-color: var(--color-white);
  background-color: var(--color-white);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
  outline: none;
}

.trial-form--hero .form-group input::placeholder {
  color: rgba(0, 0, 0, 0.5);
  opacity: 1;
}

.trial-form--hero .button {
  min-height: 52px;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 0.5rem;
  padding: 0.875rem 2rem;
  box-shadow: 0 4px 12px rgba(231, 30, 20, 0.3);
  transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .trial-form--hero .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 30, 20, 0.4);
  }
}

/* Помилки валідації для hero форми - позиціонування всередині інпута */
.trial-form--hero .form-error {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding-left: 1rem;
  color: var(--color-error);
  font-size: 1rem;
  pointer-events: none;
  z-index: 2;
  background: transparent;
  margin: 0;
}

.trial-form--hero .form-group:has(.form-error) input {
  color: transparent;
}

.trial-form--hero .form-group:has(.form-error) input::placeholder {
  opacity: 0;
}

/* Fallback для браузерів без підтримки :has() */
@supports not selector(:has(*)) {
  .trial-form--hero .form-group.has-error .form-error {
    display: flex;
  }

  .trial-form--hero .form-group.has-error input {
    color: transparent;
  }

  .trial-form--hero .form-group.has-error input::placeholder {
    opacity: 0;
  }
}

/* Мобільна оптимізація hero форми */
@media (width <= 767px) {
  .trial-form--hero {
    width: 100%;
    max-width: 100%;
  }

  .trial-form--hero .form-group {
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
  }

  .trial-form--hero .form-group:last-of-type {
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
  }

  .trial-form--hero .form-group input,
  .trial-form--hero .form-group input[type="text"],
  .trial-form--hero .form-group input[type="tel"],
  .trial-form--hero .form-group input.form-group__input {
    /* Адаптивні розміри для мобільних */
    padding: clamp(0.75rem, 2vw, 0.875rem) clamp(0.875rem, 3vw, 1rem);
    font-size: clamp(0.9375rem, 3vw, 1rem); /* 15-16px */
    min-height: clamp(48px, 12vw, 52px);
  }

  .trial-form--hero .button {
    /* Адаптивні розміри кнопки */
    min-height: clamp(48px, 12vw, 52px);
    font-size: clamp(0.875rem, 3vw, 1rem);
    padding: clamp(0.75rem, 2vw, 0.875rem) clamp(1.5rem, 5vw, 2rem);
    width: 100%;

    /* Переконаємося, що кнопка завжди видима */
    display: block;
    box-sizing: border-box;
  }

  .trial-form--hero .form-error {
    font-size: clamp(0.875rem, 3vw, 1rem);
    padding-left: clamp(0.875rem, 3vw, 1rem);
  }
}

