:root {
  --verde-oscuro: hsl(156, 40%, 32%);
  --verde-medio: #2d6a4f;
  --verde: #0bce52;
  --verde-claro: #74c69d;
  --verde-suave: #b7e4c7;
}


/* ===== CONTENEDOR GENERAL ===== */

.contacto {
  background: #d3f3dc radial-gradient(circle farthest-corner at 15% 15%, #ffffff 0%, #d3f3dc 100%);
   background-attachment: fixed;
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 20px 40px; /* 👈 quitamos padding arriba */
  position: relative;
}

/* ===== HERO CON IMAGEN ===== */

.contacto::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 400px;

  background:
    linear-gradient(to right, rgba(0,0,0,0.6), rgba(0,0,0,0.3)),
    url("/images/contacto-hero.webp") center / cover no-repeat;

  z-index: 0;
}

/* ===== TEXTO HERO ===== */

.contacto-hero {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 400px;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  color: white;
  z-index: 2;
}






/* ===== LAYOUT FLEX ===== */

.contacto-wrapper {
  display: flex;
  gap: 60px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: flex-start;
  position: relative;
  z-index: 1;

  margin-top: 340px/* 👈 efecto cards sobre el hero */
}

/* ===== IZQUIERDA ===== */

.contacto-izquierda {
  flex: 1.5;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(3px);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.contacto-izquierda:hover {
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.contacto-izquierda form {
  margin-top: 20px;
}

.contacto-izquierda h1 {
  color: var(--verde-oscuro);
  font-weight: 700;
}

/* TEXTOS */

/* ===== TEXTO HERO (LIMPIO) ===== */
.contacto-hero h1 {
   
    font-size: 48px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    color: white !important;
    text-transform: none;
    margin: 0;
    text-align: center; /* Centrado clásico de texto */
    letter-spacing: 2px; /* Un poco más juntas para ese look del Index */
}


.contacto p {
  color: #555;
  line-height: 1.6;
}

.contacto-extra {
  margin: 20px 0;
  color: #2d6a4f;
  font-size: 14px;
  line-height: 1.8;
  color: var(--verde-oscuro);
  font-weight: 500;
}

/* ===== FORMULARIO ===== */

.contacto-formulario {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===== INPUTS ===== */

.contacto-input-group {
  position: relative;
}

.contacto-input-group input,
.contacto-input-group textarea {
  width: 100%;
  font-size: 14px;
  padding: 15px 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  background: #fafafa;
  transition: all 0.25s ease;

  box-sizing: border-box;
}

/* HOVER */

.contacto-input-group input:hover,
.contacto-input-group textarea:hover {
  border-color: #bbb;
}

/* FOCUS */

.contacto-input-group input:focus,
.contacto-input-group textarea:focus {
  border-color: var(--verde);
  box-shadow: 0 0 0 2px rgba(11, 206, 82, 0.15);
  background: white;
}

/* TEXTAREA */

textarea {
  min-height: 100px;
  resize: vertical;
}

/* ===== LABEL FLOTANTE ===== */

.contacto-input-group label {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  background: #fafafa;
  padding: 0 5px;
  color: #888;
  font-size: 13px;
  transition: 0.3s;
  pointer-events: none;
}

.contacto-input-group textarea + label {
  top: 20px;
}

/* EFECTO LABEL */

.contacto-input-group input:focus + label,
.contacto-input-group input:not(:placeholder-shown) + label,
.contacto-input-group textarea:focus + label,
.contacto-input-group textarea:not(:placeholder-shown) + label {
  top: -8px;
  font-size: 11px;
  color: var(--verde);
}

/* ===== BOTÓN ENVIAR Y ACEPTO PRIVACIDAD ===== */

.contacto-privacidad {
    display: flex;
    align-items: flex-start; /* Alinea arriba por si el texto ocupa 2 líneas */
    gap: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.contacto-privacidad input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0bce52; /* El verde de Biofont para el check */
    margin-top: 3px;
}

.contacto-privacidad label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
    line-height: 1.4;
}

.contacto-privacidad label a {
    color: #1b4332;
    text-decoration: underline;
    font-weight: 600;
}

.contacto-privacidad label a:hover {
    color: #0bce52;
}

.btn-enviar {
  background-color: #0ea043;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 10px;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.btn-enviar:hover {
  background: var(--verde-medio);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(11, 206, 82, 0.3);
  
}

.btn-enviar:active {
  transform: scale(0.98);
}

/* ===== DERECHA ===== */

.contacto-derecha {
  flex: 1;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(3px);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  margin-top: 60px;
  transition: all 0.3s ease;
}

.contacto-derecha:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* TITULOS */

.contacto-derecha h2 {
  margin-top: 0;
  color: var(--verde-oscuro);
  font-size: 18px;
  margin-bottom: 10px;
}

/* TEXTOS */

.contacto-derecha p {
  margin: 6px 0;
  color: #555;
  font-size: 14px;
}

/* ICONOS */

.contacto-derecha i {
  margin-right: 8px;
  color: var(--verde);
}

/* ===== ANIMACIÓN ===== */

.contacto-izquierda,
.contacto-derecha {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease forwards;
  transition: transform 0.3s ease; /* 👈 esto es lo importante */
}

.contacto-izquierda:hover,
.contacto-derecha:hover {
  transform: translateY(-5px) scale(1.01); /* 👈 efecto pro */
}

.contacto-derecha {
  animation-delay: 0.2s;
}

/* Fondo oscurecido */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Oscurece el fondo */
    backdrop-filter: blur(5px); /* Efecto desenfoque muy moderno */
    display: none; /* Escondido por defecto */
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Caja del mensaje */
.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* Animación cuando se muestra */
.modal-overlay.show {
    display: flex;
    opacity: 1;
}
.modal-overlay.show .modal-content {
    transform: translateY(0);
}

/* Icono de check */
.modal-icon {
    font-size: 60px;
    color: #0bce52; /* El verde Biofont */
    margin-bottom: 20px;
}

.modal-content h2 {
    color: #1b4332;
    margin-bottom: 15px;
}

.modal-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Botón del modal */
.btn-modal {
    background: #1b4332;
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-modal:hover {
    background: #0bce52;
    transform: scale(1.05);
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE MOVIL===== */
@media (max-width: 768px) {
  /* 1. CABECERA Y MENÚ */
  .topbar, header {
    position: static !important;
    width: 100%;
  }

  .topbar-content {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 6px 0;
  }

  .topbar-content span, .topbar-content a {
    font-size: 11px;
    color: var(--verde-medio);
    gap: 4px;
  }

  .menu-toggle {
    display: block !important;
    cursor: pointer;
    padding: 10px;
  }

  header nav ul#menu {
    display: none;
  }

  header nav ul#menu.active {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    padding: 20px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 1000;
  }

  /* 2. SECCIÓN CONTACTO Y HERO */
  .contacto {
    padding: 0 10px 30px;
  }

  .contacto::before, 
  .contacto-hero {
    height: 160px !important; /* Más bajo para el SE */
  }

 .contacto-hero h1 {
    font-size: 30px !important; /* Tamaño móvil */
    gap: 10px;
  }


  /* 3. WRAPPER Y TARJETAS (CORRECCIÓN DE SOLAPAMIENTO) */
  .contacto-wrapper {
    display: flex !important;
    flex-direction: column !important; /* Fuerza una debajo de otra */
    margin-top: 140px !important;     /* Sube las tarjetas sobre el hero */
    gap: 20px;
    max-width: 100%;
    align-items: center;              /* Centra las tarjetas en la pantalla */
  } 

  .contacto-izquierda, 
  .contacto-derecha {
    width: 100% !important;           /* Ocupan todo el ancho disponible */
    max-width: 340px;                 /* Ajuste ideal para iPhone SE */
    padding: 15px !important;
    margin: 0 auto !important;        /* Centrado horizontal */
    flex: none !important;            /* Anula el flex de escritorio */
    box-sizing: border-box;
  }

  /* 4. FORMULARIO COMPACTO (SLIM) */
  /* 4. FORMULARIO AJUSTADO */
  .contacto h1, 
  .contacto-izquierda h1 {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .contacto-formulario {
    gap: 15px !important; /* Aumentamos espacio entre campos */
    margin-top: 10px;
  }

  .contacto-input-group {
    margin-bottom: 5px !important;
    position: relative;
  }

  .contacto-input-group input,
  .contacto-input-group textarea {
    padding: 12px 12px !important; /* Más relleno interno para que el texto no choque */
    font-size: 16px !important;    /* 👈 16px es el mínimo para evitar el zoom molesto en iPhone */
    height: 45px !important;       /* 👈 Altura un poco más humana para que quepa la etiqueta */
    border-radius: 6px !important;
    background: #ffffff !important;
  }

  .contacto-input-group textarea {
    height: auto !important;
    min-height: 80px !important;
    padding-top: 15px !important;
  }

  /* Ajuste de etiquetas cuando están en reposo */
  .contacto-input-group label {
    font-size: 14px !important;
    left: 12px !important;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important; /* Quitamos el fondo para que no haga parches */
  }

  .contacto-input-group textarea + label {
    top: 22px !important;
  }

  /* LA CLAVE: Posición de la etiqueta cuando el usuario escribe */
  .contacto-input-group input:focus + label,
  .contacto-input-group input:not(:placeholder-shown) + label,
  .contacto-input-group textarea:focus + label,
  .contacto-input-group textarea:not(:placeholder-shown) + label {
    top: 0px !important;             /* La subimos justo al borde superior */
    font-size: 11px !important;
    color: var(--verde) !important;
    background: white !important;    /* Le ponemos fondo blanco para que tape la línea del borde */
    padding: 0 4px !important;
    transform: translateY(-50%);     /* La dejamos "cabalgando" sobre el borde del input */
    z-index: 10;
  }


    /* El botón también lo hacemos más bajito */
    .btn-enviar {
      padding: 10px !important;
      font-size: 14px !important;
      margin-top: 5px !important;
    }

  /* 5. INFO DE CONTACTO (CENTRADA) */
  .contacto-derecha {
    text-align: center;
  }

  .contacto-derecha h2 {
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  .contacto-derecha p {
    font-size: 13px;
    justify-content: center; /* Centra iconos y texto */
    margin: 6px 0;
  }
}


