html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Poppins', sans-serif;
  overflow: hidden; /* evita scroll en pantallas grandes */
}

body {
  min-height: 100vh; /* asegura que ocupe toda la ventana */
  display: flex;
  justify-content: center;
  align-items: center;
  background: url("../images/fondo.gif") center center / cover no-repeat fixed;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: -1;
}

/* Contenedor principal */
.contact-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* centra verticalmente */
  position: relative;
  z-index: 1;
  padding: 40px 12px;
  max-width: 1200px;
  margin: 0 auto;
  height: 100vh; /* ocupa toda la ventana */
  box-sizing: border-box;
}

/* Logo arriba */
.logo {
  width: 100%;               /* ocupa el ancho del formulario */
  max-width: 200px;          /* tamaño visual del logo */
  height: auto;
  margin-bottom: 20px;       /* espacio entre logo y formulario */
  display: block;
  align-self: center;        /* lo centra dentro de la columna */
}

/* Contenedor en dos columnas: formulario+footer y bienvenida */
.contact-content {
  display: flex;
  flex-direction: row;
  gap: 40px;
  justify-content: center;
  align-items: flex-start; /* alinea arriba con el formulario */
  width: 100%;
}

/* Columna izquierda: formulario + footer */
.form-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 440px;
  max-width: 92vw;
}

/* Caja del formulario */
.contact-box {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  border-radius: 15px;
  padding: 32px;
  width: 100%;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  text-align: center;
  box-sizing: border-box;
}

/* Footer debajo del formulario */
footer {
  width: 100%;
  text-align: center;
  margin-top: 20px;
  color: #fff;
  font-size: 16px;
}

/* Columna derecha: bienvenida */
.info-box {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: 15px;
  padding: 27px;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  box-sizing: border-box;
  width: 440px;
  max-width: 92vw;
  height: auto; /* se ajusta al contenido */
}

/* Formulario */
.contact-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Campos */
.contact-box input,
.contact-box textarea,
.contact-box button {
  width: 100%;
  display: block;
  box-sizing: border-box;
  border: none;
  border-radius: 10px;
  outline: none;
  font-size: 15px;
}

.contact-box input,
.contact-box textarea {
  padding: 12px 14px;
  margin: 0;
  background: #ffffff;
  color: #222;
  line-height: 1.2;
}

.contact-box ::placeholder {
  color: #666;
  opacity: 1;
}

.contact-box textarea {
  resize: none;
  min-height: 110px;
  line-height: 1.4;
}

/* Botón */
.contact-box button {
  padding: 12px;
  background: #ff6a00;
  color: #fff;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.3s ease;
}

.contact-box button:hover {
  background: #ee0979;
}

.contact-box button:active {
  transform: scale(0.98);
}

/* Foco */
.contact-box input:focus,
.contact-box textarea:focus {
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.35);
}

/* Título y mensaje */
.contact-box h2 {
  margin: 0 0 14px 0;
  font-weight: 600;
}

#successMessage {
  margin-top: 10px;
  font-size: 16px;
  color: #fff;
}

/* Animaciones */
.animated-logo {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 1s ease, transform 1s ease;
}

.animated-form {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
}

.animated-success {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.visible {
  opacity: 1 !important;
  transform: none !important;
}

.info-image-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.info-image {
  display: block;
  margin: 20px auto 0 auto;
  max-width: 440px;       /* igual que .info-box */
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}


@media (max-width: 768px) {
  html, body {
    margin: 0;
    padding: 0;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .contact-wrapper {
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    height: auto;
  }

  .contact-content {
    display: flex;
    flex-direction: column; /* apila todo en móviles */
    width: 100%;
    gap: 24px;
  }

  /* Texto de bienvenida primero */
  .contact-content .form-column:nth-of-type(2) {
    order: -2; /* .info-box está dentro de este bloque */
    gap: 10px;
  }

  /* Imagen debajo del texto */
  .contact-content .form-column:nth-of-type(2) .info-image {
    order: -1;
    display: block;
    max-width: 92vw;
    height: auto;
    margin: 16px auto 0 auto;
  }

  /* Formulario después */
  .contact-content .form-column:nth-of-type(1) {
    order: 0;
  }

  .contact-box {
    width: 100%;
    padding: 24px;
    box-sizing: border-box;
  }

  .logo {
    max-width: 160px;
    margin-bottom: 16px;
  }

  footer {
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
  }
}
