/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GENERAL
   ========================================================================== */
:root {
  --color-primary: #18599e;     /* Azul de los botones y links */
  --color-secondary: #00bfff;   /* Azul claro para textos enfatizados */
  --color-dark-bg: #0d1b2a;     /* Fondo oscuro de las consecuencias */
  --color-light-bg: #f4f7f6;    /* Fondo claro de las tarjetas */
  --color-white: #ffffff;
  --color-text: #333333;
  --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-handwritten: Georgia, 'Times New Roman', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  color: var(--color-text);
  line-height: 1.6;
}

ul, ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   2. HEADER / NAVBAR
   ========================================================================== */
.navbar {
  background-color: rgba(13, 27, 42, 0.95);
  color: var(--color-white);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.8rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.navbar__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.navbar__logo img {
  height: 50px;
  width: auto;
}

/* Hamburguer Button */
.navbar__toggle {
  display: none; /* Oculto en escritorio */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1100;
}

.navbar__toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--color-white);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.navbar__nav ul {
  display: flex;
  gap: 1.5rem;
}

.navbar__nav a {
  font-weight: 600;
  transition: color 0.3s;
  font-size: 0.95rem;
  white-space: nowrap;
}

.navbar__nav a:hover,
.navbar__nav a.active {
  color: var(--color-secondary);
}

/* ==========================================================================
   3. HERO SECTION
   ========================================================================== */
.hero {
  background: linear-gradient(90deg, rgba(13, 27, 42, 0.88) 0%, rgba(13, 27, 42, 0.62) 48%, rgba(13, 27, 42, 0.22) 100%), url('../img/hero-bg.jpg') no-repeat center center/cover;
  min-height: 62vh;
  display: flex;
  align-items: center;
  color: var(--color-white);
  padding: 4rem 2rem;
  text-align: left;
}

.hero__container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.hero__content {
  max-width: 590px;
}

.hero__title {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  margin-bottom: 1.5rem;
  line-height: 1.05;
}

.hero__title span {
  color: var(--color-secondary);
}

.hero__subtitle {
  max-width: 520px;
  font-size: 1.08rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero__button {
  display: inline-block;
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: 0.8rem 1.4rem;
  border-radius: 4px;
  font-weight: bold;
  box-shadow: none;
  transition: background-color 0.2s;
}

.hero__button:hover {
  background-color: #0056b3;
}

/* ==========================================================================
   4. FEATURES SECTION (4 Tarjetas)
   ========================================================================== */
.features {
  padding: 4rem 2rem;
  background-color: var(--color-white);
}

.features__container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0;
}

.features__card {
  background-color: transparent;
  padding: 1.2rem 1.5rem;
  border-top: 2px solid var(--color-primary);
  border-right: 1px solid rgba(13, 27, 42, 0.14);
  border-radius: 0;
  box-shadow: none;
}

.features__card:last-child {
  border-right: 0;
}

.features__icon {
  width: 42px;
  height: 42px;
  margin-bottom: 1rem;
}

.features__card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: var(--color-dark-bg);
}

.features__card p {
  font-size: 0.95rem;
  color: #555;
}

.features__card ul {
  text-align: left;
}

.features__card ul li {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.2rem;
  color: #555;
}

/* Viñeta personalizada */
.features__card ul li::before {
  content: "•";
  color: var(--color-primary);
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* ==========================================================================
   5. CONSEQUENCES SECTION (Franja Oscura)
   ========================================================================== */
.consequences {
  background-color: var(--color-dark-bg);
  color: var(--color-white);
  padding: 5rem 2rem;
}

.consequences__container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.consequences__block {
  background-color: transparent;
  padding: 1.4rem;
  border-radius: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.24);
}

.consequences__block:first-child {
  border-left: 0;
}

.consequences__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.consequences__header img {
  width: 35px;
  height: 35px;
}

.consequences__header h3 {
  font-size: 1.4rem;
}

.consequences__block ul li {
  margin-bottom: 0.8rem;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.95rem;
  opacity: 0.9;
}

.consequences__block ul li::before {
  content: "→";
  color: var(--color-secondary);
  position: absolute;
  left: 0;
}

/* Estilos de Pizarra / Badges */
.consequences__badge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 0;
  border-left: 1px solid var(--color-secondary);
  padding: 1.4rem;
  border-radius: 0;
  text-align: center;
}

.handwritten-1, .handwritten-2 {
  font-family: var(--font-handwritten);
  font-size: 1.7rem;
  font-style: italic;
  font-weight: normal;
  color: var(--color-secondary);
}

.sub-badge {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
.footer {
  background-color: #060d14;
  color: var(--color-white);
  padding: 4rem 2rem 2rem;
  font-size: 0.9rem;
}

.footer__container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer__content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 2rem;
}

.footer__logo-block {
  flex: 1 1 250px;
}

.footer__logo-block img {
  height: 60px;
  margin-bottom: 1rem;
}

.footer__columns {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  flex: 2 1 500px;
  justify-content: space-between;
}

.footer__column {
  flex: 1 1 150px;
}

.footer__column h3 {
  color: var(--color-secondary);
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
}

.footer__column p {
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.footer__column a {
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.3s, color 0.3s;
}

.footer__column .footer__social-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.footer__social-icon {
  display: inline-block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.footer__social-dot {
  fill: currentColor;
  stroke: none;
}

.footer__social-icon--facebook path {
  fill: currentColor;
  stroke: none;
}

.footer__column a:hover {
  opacity: 1;
  color: var(--color-primary);
}

.footer__column hr {
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 1rem 0;
}

.footer__copyright {
  text-align: center;
  opacity: 0.6;
  font-size: 0.85rem;
}

.footer__copyright a {
  color: var(--color-secondary);
}

/* ==========================================================================
   7. RESPONSIVE DESIGN (Pantallas Pequeñas)
   ========================================================================== */
@media (max-width: 768px) {
  .navbar {
    padding: 0.8rem 1rem;
  }

  .navbar__container {
    flex-direction: row; /* Mantiene logo y botón en la misma línea */
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .navbar__toggle {
    display: flex; /* Muestra el botón en móvil */
  }

  .navbar__nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: rgba(13, 27, 42, 0.98);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar__nav.active {
    max-height: 300px; /* Altura suficiente para los links */
  }

  .navbar__nav ul {
    flex-direction: column;
    gap: 0;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
  }

  .navbar__nav a {
    font-size: 1rem;
    display: block;
    padding: 1rem 0;
    width: 100%;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* Animación del botón hamburguesa al estar activo */
  .navbar__toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }
  .navbar__toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .navbar__toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  .hero {
    min-height: 55vh;
    background-position: 58% center;
    text-align: center;
    padding: 3rem 1.5rem;
  }

  .hero__content {
    max-width: 100%;
    margin: 0 auto;
  }

  .hero__title {
    font-size: 2.2rem;
  }

  .hero__subtitle {
    margin: 0 auto 2rem;
    text-align: center;
  }

  .features__container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .features__card {
    border-right: 0;
    border-bottom: 2px solid var(--color-primary);
    padding: 1.5rem;
  }

  .consequences__container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .consequences__block {
    border-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.24);
    padding: 1.5rem 0;
  }

  .footer__content {
    flex-direction: column;
    text-align: center;
  }

  .footer__columns {
    justify-content: center;
    text-align: center;
  }

  .footer__social-link {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .navbar__nav a {
    font-size: 0.85rem;
  }

  .hero {
    min-height: auto;
    padding: 4rem 1rem;
  }

  .hero__title {
    font-size: 2rem;
  }

  .features,
  .consequences,
  .join,
  .internal-content {
    padding: 3rem 1.25rem;
  }

  .join__container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .join__info {
    text-align: center;
  }

  .join__stats {
    justify-content: center;
  }

  .join__form-wrapper {
    padding: 1.5rem;
  }

  .internal-hero h1 {
    font-size: 1.8rem;
  }
}


/* ==========================================================================
   8. JOIN SECTION (Sección Únete con Formulario)
   ========================================================================== */
.join {
  padding: 6rem 2rem;
  background-color: var(--color-light-bg);
}

.join__container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 4rem;
  align-items: center;
}

.join__info h2 {
  font-size: 2.5rem;
  color: var(--color-dark-bg);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.join__info p {
  color: #555;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.join__stats {
  display: flex;
  gap: 2rem;
}

.join__stat-item {
  background-color: var(--color-white);
  padding: 1rem 1.5rem;
  border-radius: 0;
  border-top: 2px solid var(--color-primary);
  box-shadow: none;
  font-size: 1rem;
  color: #555;
}

.join__stat-item strong {
  display: block;
  font-size: 1.8rem;
  color: var(--color-primary);
}

/* Estilos específicos del formulario */
.join__form-wrapper {
  background-color: var(--color-white);
  padding: 2.5rem;
  border-radius: 4px;
  border: 1px solid rgba(13, 27, 42, 0.12);
  box-shadow: none;
}

.form__group {
  margin-bottom: 1.5rem;
}

.form__group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-dark-bg);
  font-size: 0.9rem;
}

.form__group input,
.form__group select,
.form__group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* Enfoque visual al dar clic en los campos */
.form__group input:focus,
.form__group select:focus,
.form__group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.12);
}

.form__consent label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.form__consent input[type="checkbox"] {
  width: auto;
  margin-top: 0.3rem;
  padding: 0;
  flex: 0 0 auto;
}

.form__feedback {
  min-height: 1.5em;
  margin-top: 0.8rem;
  color: #a52a2a;
}

.form__feedback--success {
  color: #27623b;
}

.join__submit-btn {
  width: 100%;
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: 1rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
  box-shadow: none;
}

.join__submit-btn:hover {
  background-color: #0056b3;
}

.join__submit-btn:active {
  background-color: #004c9e;
}

.form__privacy {
  text-align: center;
  font-size: 0.8rem;
  color: #777;
  margin-top: 1.5rem;
}

.form__privacy a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ==========================================================================
   9. INTERFACES Y PÁGINAS INTERNAS (Información y Consejos)
   ========================================================================== */

/* Encabezados Superiores de Páginas Internas */
.internal-hero {
  background: linear-gradient(rgba(13, 27, 42, 0.85), rgba(13, 27, 42, 0.85)), url('../img/hero-bg.jpg') no-repeat center center/cover;
  padding: 5rem 2rem;
  text-align: center;
  color: var(--color-white);
  border-bottom: 3px solid var(--color-primary);
}

.internal-hero h1 {
  font-size: 2.8rem;
  margin-bottom: 0.8rem;
  color: var(--color-white);
}

.internal-hero p {
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
}

/* Modificador visual opcional para distinguir la portada de consejos */
.consejos-hero {
  background: linear-gradient(rgba(6, 13, 20, 0.9), rgba(6, 13, 20, 0.9)), url('../img/hero-bg.jpg') no-repeat center center/cover;
}

/* Contenedor Base de Contenido Interno */
.internal-content {
  padding: 5rem 2rem;
  background-color: var(--color-white);
}

.internal-content__container {
  max-width: 900px;
  margin: 0 auto;
}

/* Bloques de Texto e Información */
.info-block, .tips-section, .action-protocol {
  margin-bottom: 4rem;
}

.info-block h2, .tips-section h2, .action-protocol h2 {
  font-size: 1.8rem;
  color: var(--color-dark-bg);
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 0.5rem;
}

/* Línea decorativa debajo de los títulos secundarios */
.info-block h2::after, .tips-section h2::after, .action-protocol h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

.info-block p, .tips-section p, .action-protocol p {
  color: #555;
  margin-bottom: 1.5rem;
}

/* Cuadrículas Internas (Mallas de 2 y 3 Columnas) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.info-card {
  background-color: var(--color-light-bg);
  padding: 2rem;
  border-radius: 0;
  border-top: 2px solid var(--color-primary);
}

.info-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  color: var(--color-dark-bg);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.tip-box {
  background-color: var(--color-white);
  border: 0;
  border-top: 2px solid var(--color-primary);
  padding: 1.5rem;
  border-radius: 0;
  position: relative;
  box-shadow: none;
}

/* Números Gigantes Decorativos para los Consejos */
.tip-number {
  position: absolute;
  top: -20px;
  left: 20px;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-size: 0.9rem;
  font-weight: bold;
  padding: 0.3rem 0.8rem;
  border-radius: 0;
  box-shadow: none;
}

.tip-box h3 {
  font-size: 1.2rem;
  margin-top: 0.5rem;
  margin-bottom: 0.8rem;
  color: var(--color-dark-bg);
}

/* Listas con Estilos Especiales (Valores y Protocolos) */
.values-list {
  margin-top: 1.5rem;
}

.values-list li {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  position: relative;
  color: #555;
}

.values-list li::before {
  content: "✓";
  color: #28a745; /* Verde para destacar aceptación de valores */
  font-weight: bold;
  position: absolute;
  left: 0;
}

.protocol-steps {
  counter-reset: step-counter;
  margin-top: 1.5rem;
}

.protocol-steps li {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 3rem;
  color: #555;
}

/* Reemplazo de numeración por defecto por burbujas estilizadas */
.protocol-steps li::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 2px;
  background-color: var(--color-dark-bg);
  color: var(--color-secondary);
  font-weight: bold;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* Ajustes Responsivos para Tablets y Celulares */
@media (max-width: 768px) {
  .internal-hero {
    padding: 4rem 1.5rem;
  }

  .internal-hero h1 {
    font-size: 2.2rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   10. MODAL DE ALERTA PERSONALIZADA (JavaScript custom-alert)
   ========================================================================== */
.custom-alert-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(6, 13, 20, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeInModal 0.3s ease forwards;
}

.custom-alert-box {
  background-color: var(--color-white);
  padding: 2.5rem 2rem;
  border-radius: 6px;
  max-width: 450px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  animation: slideUpBox 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.custom-alert-icon {
  width: 60px;
  height: 60px;
  background-color: #28a745;
  color: var(--color-white);
  border-radius: 50%;
  font-size: 2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.custom-alert-box h2 {
  color: var(--color-dark-bg);
  margin-bottom: 1rem;
  font-size: 1.6rem;
}

.custom-alert-box p {
  color: #555;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.custom-alert-btn {
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: 0.8rem 2.5rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.custom-alert-btn:hover {
  background-color: #0056b3;
}

/* Animación de salida al cerrar */
.custom-alert-modal--closing {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Animaciones CSS nativas */
@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUpBox {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Reveal elements when they enter the viewport during scrolling. */
.scroll-reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.scroll-reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

.features__card.scroll-reveal:nth-child(2),
.consequences__block.scroll-reveal:nth-child(2),
.tips-grid .scroll-reveal:nth-child(2) {
  transition-delay: 0.12s;
}

.features__card.scroll-reveal:nth-child(3),
.tips-grid .scroll-reveal:nth-child(3) {
  transition-delay: 0.24s;
}

.features__card.scroll-reveal:nth-child(4) {
  transition-delay: 0.36s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
}

/* ==========================================================================
   12. PÁGINA DE PRIVACIDAD (Versión Blindada)
   ========================================================================== */
.privacidad-hero {
  /* CORREGIDO: Degradado de color sólido para evitar fallos de rutas relativas */
  background: linear-gradient(135deg, #0d1b2a 0%, #060d14 100%) !important;
  padding: 5rem 2rem;
  text-align: center;
  color: var(--color-white);
  border-bottom: 3px solid var(--color-primary);
}

.privacy-layout {
  text-align: left;
}

.privacy-date {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 2rem;
  border-bottom: 1px dashed #ddd;
  padding-bottom: 0.5rem;
}

.privacy-block {
  margin-bottom: 3rem;
}

.privacy-block h2 {
  font-size: 1.4rem;
  color: var(--color-dark-bg);
  margin-bottom: 1rem;
}

.privacy-block p {
  font-size: 1rem;
  color: #555;
  line-height: 1.7;
}
