/**
 * Widget Formulario — VIP Travel
 *
 * Campos apilados con etiqueta arriba, bordes suaves y botón a todo el ancho
 * (igual que la maqueta aprobada). Los colores se pueden sobrescribir desde
 * Elementor mediante las variables --vt-form-*.
 */

.vt-form {
  --vt-form-label: #1b3a5c;
  --vt-form-text: var(--vt-text, #1a1a1a);
  --vt-form-placeholder: #8b8b8b;
  --vt-form-border: #d9dde2;
  --vt-form-border-focus: var(--vt-accent, #5694a9);
  --vt-form-field-bg: #ffffff;
  --vt-form-radius: 10px;
  --vt-form-gap: 22px;
  --vt-form-btn-bg: #e2a03f;
  --vt-form-btn-bg-hover: #cf8f2f;
  --vt-form-btn-text: #1b3a5c;

  display: grid;
  gap: var(--vt-form-gap);
  font-family: var(--vt-font-body, inherit);
}

/* --- Campo --- */
.vt-form__field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.vt-form__label {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--vt-form-label);
}

.vt-form__req {
  color: #c0392b;
  margin-left: 2px;
}

.vt-form__control {
  width: 100%;
  padding: 16px 18px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--vt-form-text);
  background: var(--vt-form-field-bg);
  border: 1px solid var(--vt-form-border);
  border-radius: var(--vt-form-radius);
  transition: border-color .2s ease, box-shadow .2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.vt-form__control::placeholder {
  color: var(--vt-form-placeholder);
  opacity: 1;
}

.vt-form__control:focus {
  outline: none;
  border-color: var(--vt-form-border-focus);
  box-shadow: 0 0 0 3px rgba(86, 148, 169, .18);
}

textarea.vt-form__control {
  min-height: 150px;
  resize: vertical;
}

/* Select: flecha propia (los nativos no se pueden estilar igual en todos los SO). */
.vt-form__control--select {
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b3a5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px 18px;
  cursor: pointer;
}

/* --- Errores por campo --- */
.vt-form__error {
  display: none;
  font-size: 13px;
  font-weight: 600;
  color: #c0392b;
}

.vt-form__field.has-error .vt-form__control {
  border-color: #c0392b;
}

.vt-form__field.has-error .vt-form__error {
  display: block;
}

/* --- Honeypot: invisible para personas, presente para bots --- */
.vt-form__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Botón --- */
.vt-form__actions {
  margin-top: 4px;
}

.vt-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 32px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  color: var(--vt-form-btn-text);
  background: var(--vt-form-btn-bg);
  border: 0;
  border-radius: var(--vt-form-radius);
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease, opacity .2s ease;
}

.vt-form__submit:hover {
  background: var(--vt-form-btn-bg-hover);
}

.vt-form__submit:active {
  transform: translateY(1px);
}

.vt-form--btn-full .vt-form__submit {
  width: 100%;
}

.vt-form--btn-center .vt-form__actions {
  text-align: center;
}

.vt-form--btn-right .vt-form__actions {
  text-align: right;
}

/* Estado enviando */
.vt-form.is-sending .vt-form__submit {
  opacity: .7;
  pointer-events: none;
}

.vt-form__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: vt-form-spin .7s linear infinite;
}

.vt-form.is-sending .vt-form__spinner {
  display: inline-block;
}

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

@media (prefers-reduced-motion: reduce) {
  .vt-form__spinner {
    animation-duration: 2s;
  }
}

/* --- Mensaje global (éxito / error) --- */
.vt-form__message {
  display: none;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: var(--vt-form-radius);
}

.vt-form__message.is-visible {
  display: block;
}

.vt-form__message--success {
  color: #1e6b45;
  background: #e8f6ee;
  border: 1px solid #bfe3ce;
}

.vt-form__message--error {
  color: #a5281b;
  background: #fdecea;
  border: 1px solid #f3c4bf;
}

/* Al enviar bien, el formulario se oculta y queda sólo el mensaje. */
.vt-form.is-done .vt-form__field,
.vt-form.is-done .vt-form__actions {
  display: none;
}

/* --- Captcha --- */
.vt-form__field--captcha {
  gap: 6px;
}

/* La casilla de Google/Cloudflare tiene ancho fijo: en móvil se escala para que
   no desborde la columna. */
.vt-form__captcha {
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 360px) {
  .vt-form__captcha > div {
    transform: scale(.85);
    transform-origin: 0 0;
  }
}

/* Suma simple: campo corto, no necesita todo el ancho. */
.vt-form__control--math {
  max-width: 140px;
}

/* Aviso legal de reCAPTCHA v3. */
.vt-form__legal {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--vt-muted, #808080);
}

.vt-form__legal a {
  color: inherit;
  text-decoration: underline;
}

/* Con v3 el badge flotante de Google puede taparse con la barra inferior del
   sitio: se mantiene visible pero fuera del camino. */
.grecaptcha-badge {
  z-index: 5;
}

/* --- Elementos que siempre ocupan el ancho completo (útil con 2 columnas) --- */
.vt-form__message,
.vt-form__actions,
.vt-form__legal,
.vt-form__field--full {
  grid-column: 1 / -1;
}

@media (max-width: 767px) {
  .vt-form__control {
    padding: 14px 16px;
    font-size: 16px;
    /* 16px evita el zoom automático en iOS */
  }
}
