/* =========================================================
   CONTACTO
   Diseño homologado con el formulario de Bioequivalentes
   Archivo: assets/css/contact.css
========================================================= */

.page-contacto {
  --contact-blue: #082b7a;
  --contact-blue-dark: #061f5e;
  --contact-yellow: #ffc72c;
  --contact-yellow-dark: #e5a823;
  --contact-text: #17324d;
  --contact-text-soft: #53677e;
  --contact-surface: #ffffff;
  --contact-surface-soft: #f7f9fc;
  --contact-border: rgba(8, 43, 122, 0.11);
  --contact-border-strong: rgba(8, 43, 122, 0.18);
  --contact-shadow-md: 0 16px 38px rgba(10, 35, 90, 0.08);
  --contact-radius-sm: 14px;
  --contact-radius-lg: 28px;
  --contact-danger: #c93434;
  --contact-success: #167447;
}

/* =========================================================
   LAYOUT GENERAL
========================================================= */

.page-contacto .contact-main,
.page-contacto .contact-main * {
  box-sizing: border-box;
}

.page-contacto .contact-main {
  width: 100%;
  overflow: hidden;
  background: var(--contact-surface-soft);
}

.page-contacto .contact-section {
  position: relative;
  width: 100%;
  padding: clamp(58px, 6vw, 82px) 0 clamp(76px, 7vw, 108px);
}

.page-contacto .contact-section--form {
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 199, 44, 0.06),
      transparent 28rem
    ),
    linear-gradient(
      180deg,
      #f8faff 0%,
      #f5f7fb 100%
    );
}

.page-contacto .contact-container {
  width: min(100% - 40px, 820px);
  max-width: 820px;
  margin-inline: auto;
}

/* =========================================================
   ENCABEZADO
========================================================= */

.page-contacto .contact-section-head {
  width: 100%;
  max-width: 820px;
  margin: 0 auto 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.page-contacto .contact-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  margin: 0 auto 16px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 199, 44, 0.38);
  border-radius: 999px;
  background: rgba(255, 199, 44, 0.16);
  color: var(--contact-blue);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.page-contacto .contact-title {
  max-width: none;
  margin: 0;
  color: var(--contact-blue);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-align: center;
  text-wrap: balance;
}

.page-contacto .contact-lead {
  max-width: 64ch;
  margin: 18px auto 0;
  color: var(--contact-text-soft);
  font-size: 1.02rem;
  line-height: 1.7;
  text-align: center;
  text-wrap: balance;
}

/* =========================================================
   TARJETA DEL FORMULARIO
========================================================= */

.page-contacto .contact-form {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 34px;
  display: grid;
  gap: 18px;
  border: 1px solid var(--contact-border);
  border-radius: var(--contact-radius-lg);
  background: #ffffff;
  box-shadow: var(--contact-shadow-md);
}

/* =========================================================
   CAMPOS
========================================================= */

.page-contacto .contact-field {
  display: grid;
  gap: 8px;
}

.page-contacto .contact-field label {
  margin: 0;
  color: var(--contact-blue);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.35;
  text-align: left;
}

.page-contacto .contact-field label span,
.page-contacto .contact-required span {
  color: var(--contact-danger);
}

.page-contacto .contact-field input,
.page-contacto .contact-field select,
.page-contacto .contact-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(8, 43, 122, 0.16);
  border-radius: var(--contact-radius-sm);
  background: #ffffff;
  color: var(--contact-text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: none;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.page-contacto .contact-field textarea {
  min-height: 148px;
  resize: vertical;
}

.page-contacto .contact-field input::placeholder,
.page-contacto .contact-field textarea::placeholder {
  color: #78879a;
  opacity: 1;
}

.page-contacto .contact-field input:hover,
.page-contacto .contact-field select:hover,
.page-contacto .contact-field textarea:hover {
  border-color: var(--contact-border-strong);
}

.page-contacto .contact-field input:focus,
.page-contacto .contact-field select:focus,
.page-contacto .contact-field textarea:focus {
  border-color: var(--contact-yellow-dark);
  box-shadow: 0 0 0 4px rgba(255, 199, 44, 0.2);
}

.page-contacto .contact-field input:disabled,
.page-contacto .contact-field select:disabled,
.page-contacto .contact-field textarea:disabled {
  cursor: not-allowed;
  background: #f2f4f7;
  color: #7d8796;
}

/* Validación visual después de interacción */
.page-contacto .contact-field input:user-invalid,
.page-contacto .contact-field select:user-invalid,
.page-contacto .contact-field textarea:user-invalid {
  border-color: rgba(201, 52, 52, 0.68);
}

/* =========================================================
   TEXTO DE CAMPOS REQUERIDOS
========================================================= */

.page-contacto .contact-required {
  margin: 0;
  color: var(--contact-text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
}

/* =========================================================
   ACCIONES
========================================================= */

.page-contacto .contact-form-actions {
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.page-contacto .contact-submit {
  width: 100%;
  min-height: 50px;
  margin: 4px 0 0;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--contact-yellow);
  border-radius: var(--contact-radius-sm);
  background: var(--contact-yellow);
  color: #111111;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.page-contacto .contact-submit:hover {
  transform: translateY(-1px);
  border-color: var(--contact-yellow-dark);
  background: var(--contact-yellow-dark);
  box-shadow: 0 12px 24px rgba(0, 26, 112, 0.12);
}

.page-contacto .contact-submit:active {
  transform: translateY(0);
  box-shadow: none;
}

.page-contacto .contact-submit:focus-visible {
  outline: 3px solid rgba(255, 199, 44, 0.55);
  outline-offset: 3px;
}

.page-contacto .contact-submit:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
  box-shadow: none;
}

.page-contacto .contact-whatsapp-link {
  justify-self: center;
  margin: 0;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--contact-blue);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  text-underline-offset: 4px;
  transition:
    color 150ms ease,
    background-color 150ms ease;
}

.page-contacto .contact-whatsapp-link:hover {
  color: var(--contact-blue-dark);
  background: rgba(255, 199, 44, 0.1);
  text-decoration: underline;
}

.page-contacto .contact-whatsapp-link:focus-visible {
  outline: 3px solid rgba(255, 199, 44, 0.55);
  outline-offset: 3px;
}

/* =========================================================
   MENSAJES
========================================================= */

.page-contacto .contact-notice {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
}

.page-contacto .contact-notice--success {
  border: 1px solid rgba(22, 116, 71, 0.24);
  background: rgba(22, 116, 71, 0.08);
  color: var(--contact-success);
}

.page-contacto .contact-notice--error {
  border: 1px solid rgba(201, 52, 52, 0.24);
  background: rgba(201, 52, 52, 0.07);
  color: var(--contact-danger);
}

.page-contacto .contact-notice[hidden] {
  display: none !important;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 768px) {
  .page-contacto .contact-section {
    padding: 48px 0 68px;
  }

  .page-contacto .contact-container {
    width: min(100% - 30px, 820px);
  }

  .page-contacto .contact-section-head {
    margin-bottom: 28px;
  }

  .page-contacto .contact-title {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .page-contacto .contact-lead {
    max-width: 36ch;
    font-size: 0.98rem;
    line-height: 1.6;
  }

  .page-contacto .contact-form {
    width: 100%;
    padding: 24px 18px;
    border-radius: 20px;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 520px) {
  .page-contacto .contact-section {
    padding: 42px 0 58px;
  }

  .page-contacto .contact-container {
    width: min(100% - 24px, 820px);
  }

  .page-contacto .contact-kicker {
    margin-bottom: 14px;
    font-size: 0.7rem;
  }

  .page-contacto .contact-title {
    font-size: clamp(1.9rem, 10vw, 2.45rem);
  }

  .page-contacto .contact-lead {
    max-width: 32ch;
    margin-top: 14px;
    font-size: 0.94rem;
  }

  .page-contacto .contact-form {
    padding: 22px 16px;
    gap: 17px;
    border-radius: 18px;
  }

  .page-contacto .contact-field input,
  .page-contacto .contact-field select,
  .page-contacto .contact-field textarea {
    font-size: 16px;
  }

  .page-contacto .contact-field input,
  .page-contacto .contact-field select {
    min-height: 50px;
  }

  .page-contacto .contact-field textarea {
    min-height: 138px;
  }

  .page-contacto .contact-submit {
    min-height: 48px;
    padding-inline: 18px;
    border-radius: 13px;
  }

  .page-contacto .contact-whatsapp-link {
    max-width: 100%;
    font-size: 0.84rem;
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .page-contacto .contact-field input,
  .page-contacto .contact-field select,
  .page-contacto .contact-field textarea,
  .page-contacto .contact-submit,
  .page-contacto .contact-whatsapp-link {
    transition: none;
  }

  .page-contacto .contact-submit:hover {
    transform: none;
  }
}
/* =========================================================
   CONTACT HERO
   Imagen responsive y contenido centrado
========================================================= */

.page-contacto .contact-hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: clamp(460px, 36.458vw, 700px);
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #061f5e;
}

/* Imagen del hero */

.page-contacto .contact-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.page-contacto .contact-hero__image {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
}

/* Contraste */

.page-contacto .contact-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(4, 25, 73, 0.7) 0%,
      rgba(4, 25, 73, 0.52) 50%,
      rgba(4, 25, 73, 0.7) 100%
    ),
    linear-gradient(
      180deg,
      rgba(4, 25, 73, 0.12) 0%,
      rgba(4, 25, 73, 0.32) 100%
    );
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

/* Contenido */

.page-contacto .contact-hero__content {
  position: relative;
  inset: auto;
  z-index: 2;
  width: min(100% - 40px, 940px);
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(64px, 7vw, 104px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: none;
  text-align: center;
}

.page-contacto .contact-hero__kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  margin: 0 auto 18px;
  padding: 7px 15px;
  border: 1px solid #ffc72c;
  border-radius: 999px;
  background: #ffc72c;
  color: #061f5e;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(255, 199, 44, 0.18);
}

.page-contacto .contact-hero__title {
  max-width: 19ch;
  margin: 0 auto;
  color: #ffffff;
  font-size: clamp(2.5rem, 4.1vw, 4.5rem);
  font-weight: 850;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 5px 24px rgba(0, 0, 0, 0.24);
}

.page-contacto .contact-hero__description {
  max-width: 58ch;
  margin: 20px auto 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(1rem, 1.2vw, 1.13rem);
  line-height: 1.65;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* Acciones */

.page-contacto .contact-hero__actions {
  width: 100%;
  margin: 30px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.page-contacto .contact-hero__actions .btn {
  min-width: 180px;
  min-height: 46px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.page-contacto .contact-hero__primary {
  border: 1px solid #ffc72c;
  background: #ffc72c;
  color: #111827;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.page-contacto .contact-hero__primary:hover {
  transform: translateY(-1px);
  border-color: #f2bb1f;
  background: #f2bb1f;
  color: #111827;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.16);
}

.page-contacto .contact-hero__email {
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.page-contacto .contact-hero__email:hover,
.page-contacto .contact-hero__email:focus-visible {
  color: #ffffff;
}

.page-contacto .contact-hero__email:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.page-contacto .contact-hero__actions .btn:focus-visible {
  outline: 3px solid rgba(255, 199, 44, 0.75);
  outline-offset: 4px;
}

/* Tablet */

@media (max-width: 1024px) {
  .page-contacto .contact-hero {
    min-height: 540px;
  }

  .page-contacto .contact-hero__content {
    width: min(100% - 36px, 780px);
    padding: 72px 0;
  }

  .page-contacto .contact-hero__title {
    max-width: 17ch;
    font-size: clamp(2.35rem, 6vw, 3.8rem);
  }

  .page-contacto .contact-hero__description {
    max-width: 48ch;
  }
}

/* Mobile */

@media (max-width: 768px) {
  .page-contacto .contact-hero {
    min-height: 600px;
  }

  .page-contacto .contact-hero__image {
    object-position: center;
  }

  .page-contacto .contact-hero__overlay {
    background:
      linear-gradient(
        180deg,
        rgba(4, 25, 73, 0.48) 0%,
        rgba(4, 25, 73, 0.68) 55%,
        rgba(4, 25, 73, 0.84) 100%
      );
  }

  .page-contacto .contact-hero__content {
    width: min(100% - 30px, 620px);
    padding: 62px 0;
  }

  .page-contacto .contact-hero__kicker {
    margin-bottom: 16px;
    font-size: 0.7rem;
  }

  .page-contacto .contact-hero__title {
    max-width: 14ch;
    font-size: clamp(2.1rem, 10vw, 3.1rem);
    line-height: 1.05;
  }

  .page-contacto .contact-hero__description {
    max-width: 34ch;
    margin-top: 18px;
    font-size: 0.98rem;
    line-height: 1.58;
  }

  .page-contacto .contact-hero__actions {
    width: min(100%, 320px);
    margin-top: 26px;
    flex-direction: column;
  }

  .page-contacto .contact-hero__actions .btn {
    width: 100%;
    min-width: 0;
  }
}

/* Mobile pequeño */

@media (max-width: 480px) {
  .page-contacto .contact-hero {
    min-height: 570px;
  }

  .page-contacto .contact-hero__content {
    width: min(100% - 24px, 460px);
    padding: 52px 0;
  }

  .page-contacto .contact-hero__title {
    font-size: clamp(2rem, 10.5vw, 2.7rem);
  }
}

/* Preferencia de movimiento reducido */

@media (prefers-reduced-motion: reduce) {
  .page-contacto .contact-hero__actions .btn {
    transition: none;
  }

  .page-contacto .contact-hero__actions .btn:hover {
    transform: none;
  }
}