/* ==========================================================================
   Formulario de presupuesto (Contact Form 7)
   Independiente del resto del tema: reutilizable en otros proyectos.
   ========================================================================== */

.presupuesto-form {
  --pf-texto: #0c192b;
  --pf-secundario: #526078;
  --pf-fondo: #f4f5f8;
  --pf-azul: #195fff;

  width: 100%;
  color: var(--pf-texto);
  font-family: inherit;
}

.presupuesto-form,
.presupuesto-form * {
  box-sizing: border-box;
}

/* Neutraliza los espacios automáticos de Contact Form 7 */
.presupuesto-form p {
  margin: 0;
  padding: 0;
}

.presupuesto-form br {
  display: none;
}

/* Dos columnas */
.presupuesto-form .presupuesto-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.presupuesto-form label {
  display: block;
  min-width: 0;
  margin: 0;
  color: var(--pf-texto);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.presupuesto-form .opcional {
  color: #7d899e;
  font-size: 13px;
  font-weight: 400;
}

.presupuesto-form .wpcf7-form-control-wrap {
  display: block;
  margin-top: 6px;
}

/* Campos */
.presupuesto-form input[type="text"],
.presupuesto-form input[type="email"],
.presupuesto-form input[type="tel"],
.presupuesto-form textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--pf-fondo);
  box-shadow: none;
  color: var(--pf-texto);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.presupuesto-form input[type="text"],
.presupuesto-form input[type="email"],
.presupuesto-form input[type="tel"] {
  height: 54px;
}

.presupuesto-form .presupuesto-mensaje {
  margin-top: 16px;
}

.presupuesto-form textarea {
  height: 120px;
  min-height: 120px;
  resize: vertical;
}

.presupuesto-form textarea::placeholder {
  color: #7d899e;
  opacity: 1;
}

.presupuesto-form input:focus-visible,
.presupuesto-form textarea:focus-visible,
.presupuesto-form a:focus-visible {
  outline: 2px solid var(--pf-azul);
  outline-offset: 3px;
}

/* Privacidad */
.presupuesto-form .presupuesto-privacidad {
  margin-top: 16px;
}

.presupuesto-form .presupuesto-privacidad .wpcf7-form-control-wrap {
  margin-top: 0;
}

.presupuesto-form .wpcf7-acceptance .wpcf7-list-item {
  margin: 0;
}

.presupuesto-form .wpcf7-acceptance label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--pf-secundario);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}

.presupuesto-form input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--pf-azul);
  appearance: auto;
}

.presupuesto-form .presupuesto-privacidad a {
  color: var(--pf-texto);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Botón */
.presupuesto-form .presupuesto-enviar {
  position: relative;
  margin-top: 24px;
}

.presupuesto-form input[type="submit"] {
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 16px 42px;
  border: 0;
  border-radius: 999px;
  background: var(--pf-azul);
  box-shadow: none;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  transition: background-color .2s;
}

.presupuesto-form input[type="submit"]:hover {
  background: #104edb;
}

.presupuesto-form input[type="submit"]:focus-visible {
  outline: 2px solid var(--pf-azul);
  outline-offset: 4px;
}

.presupuesto-form input[type="submit"]:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.presupuesto-form .wpcf7-spinner {
  position: absolute;
  top: 50%;
  right: 10px;
  margin: 0;
  transform: translateY(-50%);
}

/* Texto inferior */
.presupuesto-form .presupuesto-legal {
  margin-top: 16px;
  color: #7d899e;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

/* Validación */
.presupuesto-form .wpcf7-not-valid-tip {
  margin-top: 5px;
  color: #b42318;
  font-size: 12px;
}

.presupuesto-form [aria-invalid="true"] {
  border-color: #b42318;
}

/* Móvil */
@media (max-width: 480px) {
  .presupuesto-form .presupuesto-grid {
    grid-template-columns: 1fr;
  }
}

/* Mensaje general de Contact Form 7 (enviado, errores, fallo de envío).
   Contact Form 7 lo coloca al final del <form>, fuera de .presupuesto-form,
   por eso se localiza con :has(). */
.wpcf7 form:has(.presupuesto-form) .wpcf7-response-output {
  margin: 20px 0 0;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #f4f5f8;
  color: #0c192b;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

/* Enviado correctamente */
.wpcf7 form.sent:has(.presupuesto-form) .wpcf7-response-output {
  border-color: #b7e4c7;
  background: #ecf8f0;
  color: #14532d;
}

/* Campos con errores, casilla sin aceptar o spam */
.wpcf7 form.invalid:has(.presupuesto-form) .wpcf7-response-output,
.wpcf7 form.unaccepted:has(.presupuesto-form) .wpcf7-response-output,
.wpcf7 form.payment-required:has(.presupuesto-form) .wpcf7-response-output,
.wpcf7 form.spam:has(.presupuesto-form) .wpcf7-response-output,
.wpcf7 form.failed:has(.presupuesto-form) .wpcf7-response-output,
.wpcf7 form.aborted:has(.presupuesto-form) .wpcf7-response-output {
  border-color: #f5c2c0;
  background: #fdf0ef;
  color: #912018;
}
