* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

:root {
  --base-font: 'Poppins', sans-serif;
  --primary-blue: #007bff;
  --accent-blue: #00bfff;
  --blue-gradient: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
  --blue-gradient-rev: linear-gradient(90deg, var(--accent-blue), var(--primary-blue));
  --dark-blue: #003366;
  --shadow-accent: rgba(0, 191, 255, 0.8);
  --shadow-soft: rgba(0, 0, 0, 0.18);
}

body {
  font-family: var(--base-font);
  background: linear-gradient(
    180deg,
    /* Azul medio al inicio */ #e6f3ff 8%,
    /* Azul muy claro */ #33a3ffce 18%,
    /* Azul claro difuminado */ #e6f3ff 32%,
    /* Azul medio difuminado */ #3e9eff 55%,
    /* Azul medio en el centro */ #ffffff 80%,
    /* Azul muy claro */ #3399ff 100%
  );
  background-repeat: no-repeat;
  background-attachment: scroll;
  color: #fff;
  overflow-x: hidden;
}

p,
.lead,
.descripcion-servicios,
.politica-calidad p,
.servicios {
  font-size: 1rem !important;
  line-height: 1.7;
}

.contenedor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-main ul {
  list-style: none;
  display: flex;
  gap: 30px;
  align-items: center;
  margin: 0;
}

.nav-main a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  transition: color 0.3s ease;
}
/* Subrayado animado */
.nav-main a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 4px;
  left: 0;
  bottom: -4px;
  background: linear-gradient(90deg, #2b77ce, #1a2be7);
  transition: width 0.3s ease;
}
.nav-main a:hover::after {
  width: 100%;
}

.section-inner {
  position: relative;
  z-index: 1;
}

.header-transparente {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  transition: background 0.5s ease, backdrop-filter 0.5s ease,
    box-shadow 0.5s ease;
  z-index: 1000;
}
.header-transparente.scrolled {
  /* Fondo negro semitransparente (más claro) al hacer scroll */
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  border-bottom: none;
}
.logo {
  height: 100%;
  width: 70%;
  max-width: 300px;
  margin-left: 10px;
  animation: fadeIn 2s ease-in-out;
}
.btn-iniciar {
  background: #0056b3;
  padding: 8px 16px;
  border-radius: 25px;
}
.btn-iniciar:hover {
  background: var(--blue-gradient-rev);
  box-shadow: 0 0 12px var(--shadow-accent);
  transform: scale(1.05);
}

.hero {
  position: relative;
  height: 100vh;
  background: url("/static/img/ejm.png") no-repeat center center/cover;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 60px;
  pointer-events: none;
  z-index: 3;
}
.contenido-hero {
  position: relative;
  z-index: 2;
  max-width: 700px;
  color: #fff;
  text-shadow: 0 2px 18px #003366, 0 0 2px #fff;
  animation: fadeUp 2s ease;
  padding: 0 16px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-title {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 18px;
  animation: fadeUp 1.5s ease;
  line-height: 1.18;
  color: #fff;
  letter-spacing: 2px;
}
.hero-sub {
  font-size: 0.9rem;
  margin-bottom: 18px;
  animation: fadeUp 2s ease;
  line-height: 1.7;
  color: #fff;
  font-weight: 400;
  letter-spacing: 1px;
}
.btn-principal {
  background: var(--blue-gradient);
  padding: 8px 16px;
  /* border-radius unified via combined selector */
}
.btn-principal:hover {
  background: var(--blue-gradient-rev);
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--shadow-accent);
}

.derechos-deberes {
  padding: 20px 2% 20px 2%;
  background: none;
  color: #003366;
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s ease;
}
.derechos-deberes.visible {
  opacity: 1;
  transform: translateY(0);
}
.derechos-deberes h2 {
  font-size: 1.7rem;
  margin-top: 70px;
  margin-bottom: 10px;
  font-weight: 700;
  text-align: center;
}
.derechos-deberes .lead {
  font-size: 1.7rem;
  margin-bottom: 40px;
  opacity: 0.95;
  text-align: center;
  font-weight: 500;
}
.tarjetas {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.tarjeta-img {
  background: transparent;
  width: 380px;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 40px;
  box-shadow: 0 0 40px rgb(222, 238, 247);
  padding: 0;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.4, 2, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.4, 2, 0.3, 1), z-index 0.2s;
  z-index: 1;
}
.tarjeta-img.en-frente {
  position: static;
  transform: scale(2.2);
  width: 450px;
  height: 460px;
  max-width: 100vw;
  max-height: 100vh;
  box-shadow: 0 12px 120px 40px rgba(75, 176, 212, 0.833);
  z-index: 101;
  background: #fff;
  transition: transform 0.5s cubic-bezier(0.4, 2, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.4, 2, 0.3, 1);
}
.tarjeta-img.oculta {
  display: none !important;
}

.img-derechos-deberes {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 191, 255, 0.18);
  margin: 0;
}

.servicios {
  padding: 10px 2%;
  text-align: center;
  background: transparent;
}

.titulo-servicios {
  font-size: 1.7rem;
  margin-bottom: 0px;
  margin-top: 80px;
  font-weight: 700;
  color: #003366;
}

.grid-imagenes {
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;

  gap: 50px;
  margin-top: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.card-img {
  position: relative;
  width: 290px;
  height: 390px;
  perspective: 1000px;
  background: transparent;
  border: none;
  border-radius: 20px;
  overflow: hidden;
}

.card-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* evita deformar la imagen */
  object-position: center; /* centrada */
  border-radius: 20px;
  backface-visibility: hidden;
  transition: opacity 0.3s ease, transform 1.2s ease;
}

/* Imagen posterior (se ve al rotar) */
.card-img .img-back {
  transform: rotateY(180deg);
}

.card-img:hover .img-front {
  opacity: 0;
  transform: rotateY(180deg);
}

.card-img:hover .img-back {
  opacity: 1;
  transform: rotateY(0deg);
}

.descripcion-servicios {
  color: #003366;
  font-size: 1rem;
  margin-top: 16px;
  margin-bottom: 16px;
}

.btn-servicios {
  display: inline-block;
  background: #0056b3;
  padding: 12px 30px;
  border-radius: 25px;
  transition: background 0.3s ease;
}

.btn-servicios:hover {
  background: #0056b3;
}

.politica-calidad {
  padding: 40px 8% 100px 8%;
  text-align: center;
  background: transparent;
  color: #003366;
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s ease;
}
.politica-calidad.visible {
  opacity: 1;
  transform: translateY(0);
}
.politica-calidad h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-top: 50px;
  margin-bottom: 20px;
}
.pdf-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 0 25px rgba(214, 101, 8, 0.12);
  overflow: hidden;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  height: 450px;
  position: relative;
}
.pdf-preview iframe {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  box-shadow: none;
  overflow-y: scroll;
  border: none;
}

.btn-descargar {
  display: inline-block;
  background: #0056b3;
  color: #fff;
  padding: 10px 20px;
  margin-top: 1px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.btn-iniciar,
.btn-principal,
.btn-servicios,
.btn-descargar {
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-block;
  border-radius: 25px;
}

.btn-descargar:hover {
  background: var(--blue-gradient-rev);
  box-shadow: 0 0 15px var(--shadow-accent);
  transform: scale(1.05);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}

.footer {
  background-color: #001c70;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.footer-contenido {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1300px;
  width: 100%;
  padding: 0 35px;
}

.footer-copyright {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.footer-copyright p {
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

.footer-logo-centro {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-logo {
  max-width: 180px;
  width: 100%;
  height: auto;
  opacity: 0.95;
}

.footer-redes {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 25px;
}

.footer-redes a {
  display: inline-block;
}

.footer-redes i {
  font-size: 2rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.footer-redes a:nth-child(1) i {
  color: #1877f3; /* Facebook */
}
.footer-redes a:nth-child(2) i {
  color: #e72fc5; /* Instagram */
}
.footer-redes a:nth-child(3) i {
  color: #ff0000; /* YouTube */
}

.footer-redes a:hover i {
  color: #00bfff;
  transform: scale(1.1);
}

.footer-redes .btn-volver-arriba i {
  color: #ffffff; /* Blanco puro */
  font-size: 2rem;
  transition: color 0.3s ease;
}

.footer-redes .btn-volver-arriba:hover i {
  color: #0891ed;
}
