/* ==========================================================
   BiosMed – Formulario "Envíe su Consulta" (WPForms ID 4574)
   Ubicación: /wp-content/themes/medicenter-child/css/contact-form.css

   Todo el CSS está escrito bajo #wpforms-4574, el ID real que
   WPForms genera para ESTE formulario específico, para no
   afectar a ningún otro formulario del sitio.

   No se modifica ningún ajuste de WPForms (envío, reCAPTCHA,
   notificaciones) — solo apariencia.
   ========================================================== */

#wpforms-4574 {
  max-width: 950px;
  margin: 0 auto;
  background: var(--biosmed-white, #ffffff);
  border: 1px solid var(--biosmed-gray-100, #eef1f5);
  border-radius: 12px;
  box-shadow: var(--biosmed-shadow-soft, 0 4px 16px rgba(20, 30, 60, 0.08));
  padding: clamp(24px, 4vw, 48px);
  box-sizing: border-box;
}

#wpforms-4574 * {
  box-sizing: border-box;
}

/* Título/descripción propios del formulario (si se dejan
   activos en vez de usar el <h2> de WPBakery) */
#wpforms-4574 .wpforms-title {
  font-size: var(--biosmed-h2-size, 1.8rem);
  font-weight: var(--biosmed-weight-bold, 700);
  color: var(--biosmed-blue-dark, #163b6d);
  margin: 0 0 8px;
}

#wpforms-4574 .wpforms-description {
  color: var(--biosmed-gray-700, #4a4f57);
  margin: 0 0 24px;
}

/* ----------------------------------------------------------
   Grid de 2 columnas
   ---------------------------------------------------------- */
#wpforms-4574 .wpforms-field-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

/* WPForms limita el ANCHO DEL CONTENEDOR de cada campo según
   su tamaño configurado (Small/Medium/Large) — Teléfono, Empresa,
   RUC/DNI y Email están puestos en "Small" en el formulario, lo
   que los recortaba. Como ahora el ancho real lo maneja el grid
   de arriba, neutralizamos ese límite interno de WPForms. */
#wpforms-4574 .wpforms-field-small,
#wpforms-4574 .wpforms-field-medium,
#wpforms-4574 .wpforms-field-large {
  width: 100% !important;
  max-width: 100% !important;
}

/* Campos que ocupan el ancho completo */
#wpforms-4574 .wpforms-field-select,
#wpforms-4574 .wpforms-field-name,
#wpforms-4574 .wpforms-field-textarea,
#wpforms-4574 .wpforms-field-html,
#wpforms-4574 .wpforms-field-divider {
  grid-column: 1 / -1;
}

/* Nombre/Apellidos: WPForms ya los separa internamente en 2
   columnas propias (formato "first-last"); solo normalizamos
   el espacio entre ambos. */
#wpforms-4574 .wpforms-field-name .wpforms-field-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

#wpforms-4574 .wpforms-field-name .wpforms-field-row-block {
  flex: 1 1 220px;
}

/* ----------------------------------------------------------
   Labels
   ---------------------------------------------------------- */
#wpforms-4574 .wpforms-field-label {
  display: block;
  font-size: 0.92rem;
  font-weight: var(--biosmed-weight-semibold, 600);
  color: var(--biosmed-gray-900, #24272c);
  margin-bottom: 6px;
}

#wpforms-4574 .wpforms-required-label {
  color: #e0433c;
  margin-left: 2px;
}

/* ----------------------------------------------------------
   Inputs / select / textarea
   ---------------------------------------------------------- */
#wpforms-4574 input[type="text"],
#wpforms-4574 input[type="email"],
#wpforms-4574 input[type="tel"],
#wpforms-4574 input[type="number"],
#wpforms-4574 select,
#wpforms-4574 textarea {
  width: 100%;
  height: 48px;
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 0.95rem;
  color: var(--biosmed-gray-900, #24272c);
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#wpforms-4574 textarea {
  height: auto;
  min-height: 150px;
  padding: 12px 14px;
  resize: vertical;
}

#wpforms-4574 input:focus,
#wpforms-4574 select:focus,
#wpforms-4574 textarea:focus {
  outline: none;
  border-color: var(--biosmed-blue, #1f6fb2);
  box-shadow: 0 0 0 3px rgba(31, 111, 178, 0.15);
}

/* ----------------------------------------------------------
   reCAPTCHA — evitar overflow en móvil
   ---------------------------------------------------------- */
#wpforms-4574 .wpforms-field-recaptcha {
  max-width: 100%;
  overflow-x: auto;
}

#wpforms-4574 .wpforms-recaptcha-container {
  transform-origin: left top;
}

/* ----------------------------------------------------------
   Botón
   ---------------------------------------------------------- */
#wpforms-4574 .wpforms-submit-container {
  grid-column: 1 / -1;
  margin-top: 8px;
  text-align: right;
}

#wpforms-4574 .wpforms-submit {
  background-color: var(--biosmed-blue, #1f6fb2);
  color: #ffffff;
  font-weight: var(--biosmed-weight-semibold, 600);
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  padding: 0 32px;
  min-height: 48px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#wpforms-4574 .wpforms-submit:hover,
#wpforms-4574 .wpforms-submit:focus {
  background-color: var(--biosmed-blue-dark, #163b6d);
  transform: translateY(-1px);
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 700px) {
  #wpforms-4574 .wpforms-field-container {
    grid-template-columns: 1fr;
  }

  #wpforms-4574 .wpforms-submit-container {
    text-align: stretch;
  }

  #wpforms-4574 .wpforms-submit {
    width: 100%;
  }

  #wpforms-4574 .wpforms-field-name .wpforms-field-row {
    flex-direction: column;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #wpforms-4574 .wpforms-submit {
    transition: none;
  }
}

/* ----------------------------------------------------------
   Columna junto al formulario ("Institución especializada...")
   Reutiliza la tipografía ya definida por .biosmed-section en
   design-system.css (h3 y p) — solo se agrega el layout/imagen.
   ---------------------------------------------------------- */
.biosmed-contact-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: clamp(16px, 3vw, 32px) 0;
}

.biosmed-contact-intro img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: var(--biosmed-space-md, 24px);
  display: block;
}

.biosmed-contact-intro h3 {
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem);
}

@media (max-width: 700px) {
  .biosmed-contact-intro {
    padding-top: var(--biosmed-space-lg, 40px);
  }

  .biosmed-contact-intro img {
    height: 200px;
  }
}
