/*
  =========================
  ESTILOS
  CSS
  ==========================
  */

:root {
  --azul-irs: #0a3161;
  --rojo-irs: #b31942;
  --verde-whatsapp: #25d366;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", Arial, sans-serif;
  background-color: #f8faf7;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 1rem;
}

/* =========================
          HEADER
========================== */

.site-header {
  position: relative;
  top: auto;
  z-index: 10;

  background-color: #f8faf7; /* color inicial */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Al hacer scroll */
.site-header.scrolled {
  background-color: #f8faf7; /* NUEVO COLOR */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* Barra interna */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12rem;
  padding: 0.5rem 0;
}

/* Logos */
.logo {
  height: 64px; /* desktop */
  width: auto;
  transition: height 0.3s ease;
}

.logo-dark {
  display: none;
}

/* Logos en modo oscuro */
body.dark-mode .logo-light {
  display: none;
}

body.dark-mode .logo-dark {
  display: block;
}

/* =========================
          MENÚ
   ========================== */
nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  text-decoration: none;
  color: var(--azul-irs);
  font-weight: 600;
}

nav a.active {
  color: var(--rojo-irs);
  border-bottom: 2px solid var(--rojo-irs);
}

.hamburger {
  display: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--azul-irs);
}

@media (max-width: 768px) {
  .logo {
    height: 52px;
  }

  nav {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    width: 200px;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  }

  nav.show {
    display: flex;
  }

  .hamburger {
    display: block;
  }

  /* =========================
    ANIMACIÓN DE LINKS DEL MENÚ
     ========================== */
  .nav-menu a {
    position: relative;
    padding-bottom: 6px;
    font-weight: 600;
    color: var(--azul-irs);
    transition: color 0.3s ease, transform 0.15s ease;
  }

  /* Línea animada debajo del link */
  .nav-menu a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: var(--azul-irs);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
  }

  /* Hover (antes del click) */
  .nav-menu a:hover {
    color: var(--rojo-irs);
  }

  .nav-menu a:hover::after {
    transform: scaleX(1);
  }

  /* Feedback al tocar (mobile) */
  .nav-menu a:active {
    transform: scale(0.96);
  }

  .nav-menu a.active {
    color: var(--rojo-irs);
  }

  .nav-menu a.active::after {
    transform: scaleX(1);
  }
}

/* =========================
          SECCIONES
   ========================== */
section {
  padding: 4rem 0;
}

h1,
h2 {
  color: var(--azul-irs);
  text-align: center;
  margin-bottom: 2rem;
}

/* =========================
      ¿CÓMO FUNCIONA?
   ========================== */
.how-it-works {
  padding: 4rem 0;
  text-align: center;
}

.how-subtitle {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 3rem;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

/* Tarjetas ¿Cómo Funciona? */
.how-card {
  border: none;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  background: #fff;

  /* Sombra inferior elegante */
  box-shadow: 0 14px 26px rgba(10, 49, 97, 0.18);

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Botón Precio igual a servicios */
.how-btn {
  background: linear-gradient(135deg, #0a3161, #124a8c);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.7rem 1.4rem;

  box-shadow: 0 6px 14px rgba(10, 49, 97, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

/* Hover idéntico a servicios */
.how-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(10, 49, 97, 0.35);
  background: linear-gradient(135deg, #124a8c, #0a3161);
}

/* Click */
.how-btn:active {
  transform: scale(0.96);
}

/* ===============================
    ¿CÓMO FUNCIONA? – MODO OSCURO
   =============================== */
body.dark-mode .how-card {
  background: #020617;
  color: #e5e7eb;
  border-color: #3b82f6;
}

body.dark-mode .how-subtitle {
  color: #cbd5f5;
}

body.dark-mode .how-btn {
  color: #020617;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Contenido fijo de la tarjeta */
.service-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Botón siempre alineado abajo */
.service-content .btn {
  margin-top: auto;
}

.service-card .btn,
.service-card button {
  margin-top: auto;
}

.service-card .btn-info:hover,
.service-card .btn-info:active {
  animation: none;
}

.btn {
  margin-top: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-info {
  background: linear-gradient(135deg, #0a3161, #124a8c);
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
  box-shadow: 0 6px 14px rgba(10, 49, 97, 0.25);
}

/* Hover: antes del click */
.btn-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(10, 49, 97, 0.35);
  background: linear-gradient(135deg, #124a8c, #0a3161);
}

/* Click (feedback inmediato) */
.btn-info:active {
  transform: scale(0.96);
  box-shadow: 0 4px 10px rgba(10, 49, 97, 0.25);
}

.btn-whatsapp {
  background: var(--verde-whatsapp);
  color: #fff;
  margin-left: 0.5rem;
}

.form-section {
  display: none;
  margin-top: 2rem;
  border: 1px solid #e5e5e5;
  padding: 2rem;
  border-radius: 12px;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group input {
  width: 100%;
  padding: 0.6rem;
}

.mensaje-gracias {
  display: none;
  margin-top: 1rem;
  background: #e8f5e9;
  padding: 1rem;
  border-left: 4px solid #2e7d32;
  font-weight: 600;
}

footer {
  text-align: center;
  padding: 2rem;
  background: var(--azul-irs);
  color: #fff;
}

/* =========================
    WHATSAPP FLOTANTE
   ========================== */
.whatsapp-float {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: var(--verde-whatsapp);
  color: #fff;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  transition: transform 0.3s ease;
  background-color: #25d366; /* verde WhatsApp real */
  color: #ffffff;

  /* ANIMACIÓN PULSE */
  animation: pulse 2.2s infinite;
}

/* Pausa la animación al pasar el mouse */
.whatsapp-float:hover {
  animation-play-state: paused;
}

.whatsapp-float:hover {
  transform: scale(1.1);
}

.whatsapp-float svg {
  fill: #ffffff;
}

body.dark-mode .whatsapp-float {
  background-color: #25d366;
}

body.dark-mode .whatsapp-float svg {
  fill: #ffffff;
}

/* =========================
    ANIMACIÓN PULSE WHATSAPP
  ========================== */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }

  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 18px rgba(37, 211, 102, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

@keyframes softPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }

  100% {
    transform: scale(1);
  }
}

/* Animar SOLO el botón principal */
.service-card .btn-info {
  animation: softPulse 3.5s infinite;
}

/* =========================
    IMÁGENES EN SERVICIOS
   ========================== */
.service-image {
  height: 180px;
  width: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

/* =========================
    IMÁGENES DE SERVICIOS
   ========================== */
.service-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.service-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

/* Overlay */
.service-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 49, 97, 0.55);
  /* azul IRS translúcido */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;

  /* CLAVE: no bloquear clics */
  pointer-events: none;
}

/* Ícono del overlay */
.service-icon {
  font-size: 2.5rem;
  color: #ffffff;
  transform: scale(0.8);
  transition: transform 0.35s ease;
}

/* Hover suave */
.service-card:hover .service-image {
  transform: scale(1.08);
}

.service-card:hover .service-overlay {
  opacity: 1;
}

.service-card:hover .service-icon {
  transform: scale(1);
}

/* Mobile: sin hover forzado */
@media (max-width: 768px) {
  .service-overlay {
    opacity: 1;
    background: rgba(10, 49, 97, 0.35);
  }
}

/* =========================
    MODAL
   ========================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 10000;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  border-radius: 16px;
  position: relative;

  /* Estado inicial (cerrado) */
  transform: translateY(30px) scale(0.96);
  opacity: 0;

  transition: transform 0.35s ease, opacity 0.35s ease;
}

/* Animación al abrir */
.modal.show .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

@keyframes modalFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #555;
}

/* =========================
    MENSAJE GRACIAS ANIMADO
   ========================== */
.mensaje-gracias {
  display: none;
  text-align: center;
  margin-top: 1.5rem;
  animation: thanksFade 0.6s ease forwards;
}

.check-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background: #2e7d32;
  color: #fff;
  font-size: 2rem;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: checkPop 0.5s ease;
}

/* Animación del mensaje */
@keyframes thanksFade {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animación del check */
@keyframes checkPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  70% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem;
  font-family: "Montserrat", Arial, sans-serif;
  resize: vertical;
  border: 1px solid #000;
  border-radius: 6px;
  background-color: #fff;
}

/* =========================
        BARRA DE ANUNCIO
   ========================== */
.announcement-bar {
  position: relative; /* 🔑 ya NO flota */
  margin: 1rem auto 2rem;
  max-width: 980px;
  height: 110px;

  background: #ffffff;
  color: #000;
  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3.5rem;
  text-align: center;

  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  font-weight: 600;
}

/* ACTIVAR O DESACTIVAR BARRA DE ANUNCIOS
                    .announcement-bar {
                        display: none;
                    }
                    */

.announcement-text {
  font-size: 1.25rem;
  line-height: 1.4;
}

.announcement-close {
  position: absolute;
  right: 14px;
  top: 12px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #000;
  opacity: 0.85;
}

.announcement-close:hover {
  opacity: 1;
}

/* Mobile ajustes */
@media (max-width: 768px) {
  .announcement-bar {
    max-width: 92%;
    height: auto;
    padding: 1.2rem 2.5rem;
  }

  .announcement-text {
    font-size: 1.1rem;
  }
}

/* =========================
    CINTA INFORMATIVA
   ========================== */
.info-ribbon {
  width: 100%;
  height: 120px;
  /* ~3 cm */
  background: #fc7557;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8rem;
  color: var(--azul-irs);
  font-family: "Montserrat", Arial, sans-serif;
}

.ribbon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.1;
}

.ribbon-main {
  font-size: 2.2rem;
  font-weight: 700;
  color: #0a3161;
  /* azul IRS más oscuro */
}

.ribbon-sub {
  font-size: 0.9rem;
  font-weight: 300;
}

.ribbon-divider {
  font-size: 2rem;
  font-weight: 300;
  opacity: 0.7;
}

/* =========================
          RESPONSIVE
   ========================== */
@media (max-width: 768px) {
  .info-ribbon {
    flex-direction: column;
    height: auto;
    padding: 1.5rem 0;
    gap: 1rem;
  }

  .ribbon-divider {
    display: none;
  }
}

/* =========================
        RESEÑAS CARRUSEL
   ========================== */
.reviews-section {
  padding: 4rem 0;
  background: transparent;
  /* elimina la banda */
  text-align: center;
}

.reviews-title {
  color: var(--azul-irs);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.3rem; /* reduce separación */
}

.reviews-subtitle {
  color: var(--azul-irs); /* mismo color */
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 2rem; /* separación controlada del carrusel */
}

.reviews-carousel {
  overflow: hidden;
  width: 100%;
  padding: 20px 0;
  /* espacio para el float vertical */
}

.reviews-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: scrollReviews 70s linear infinite;
}

.reviews-carousel:hover .reviews-track {
  animation-play-state: paused;
}

/* Tarjeta */
.review-card {
  width: 230px; /* ancho consistente */
  min-height: 260px; /* altura mínima */
  height: auto; /* 🔑 se adapta al contenido */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
  padding: 1rem;
  flex-shrink: 0;

  display: flex;
  flex-direction: column;
  justify-content: space-between; /* distribuye bien el contenido */
}

.stars {
  color: #5d3cd6;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.review-text {
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  flex-grow: 1; /* 🔑 ocupa espacio sobrante */
}

.review-person {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-person img.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.review-person-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.review-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--azul-irs);
}

body.dark-mode .review-name {
  color: #e5e7eb;
}

.review-country {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: #555;
}

.review-country .flag {
  width: 14px; /* CLAVE */
  height: auto;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.15);
}

body.dark-mode .review-country .flag {
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.25);
}

.review-person span {
  font-size: 0.75rem;
  color: #555;
}

.reviews-note {
  font-size: 0.8rem;
  margin-top: 1rem;
  color: #777;
}

@keyframes scrollReviews {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* ============================
      FLOAT SUAVE EN RESEÑAS
   ============================ */
.review-card {
  animation: floatCard 6s ease-in-out infinite;
}

/* Desfase para que no floten todas igual */
.review-card:nth-child(even) {
  animation-delay: 3s;
}

@keyframes floatCard {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }

  100% {
    transform: translateY(0);
  }
}

/* =========================
      MODO OSCURO
   ========================== */
body.dark-mode {
  background-color: #0f172a;
  color: #e5e7eb;
}

/* Header */
body.dark-mode .site-header {
  background: #0f172a;
}

/* Scroll NO cambia el fondo en modo oscuro */
body.dark-mode .site-header.scrolled {
  background-color: #0f172a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.dark-mode nav a {
  color: #e5e7eb;
}

/* Secciones */
body.dark-mode section {
  background: transparent;
}

/* Cards y contenedores */
body.dark-mode .service-card,
body.dark-mode .review-card,
body.dark-mode .modal-content {
  background: #020617;
  color: #e5e7eb;
}

/* Formularios */
body.dark-mode input,
body.dark-mode textarea {
  background: #020617;
  color: #e5e7eb;
  border-color: #94a3b8;
}

/* Botones */
body.dark-mode .btn-info {
  background: #2563eb;
}

body.dark-mode .btn-whatsapp {
  background: #22c55e;
}

/* Ribbon */
body.dark-mode .info-ribbon {
  background: #b45309;
}

/* Carrusel reseñas */
body.dark-mode .reviews-section {
  background: transparent;
}

/* =========================
      BOTÓN MODO OSCURO
      ========================== */
.dark-toggle {
  margin-left: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--azul-irs);
}

body.dark-mode nav a {
  color: #e5e7eb;
}

body.dark-mode .service-card,
body.dark-mode .review-card,
body.dark-mode .modal-content {
  background: #020617;
  color: #e5e7eb;
}

body.dark-mode input,
body.dark-mode textarea {
  background: #020617;
  color: #e5e7eb;
  border-color: #94a3b8;
}

/* =========================
   HERO AVANZADO
========================== */

/* =========================
   HERO CON IMAGEN DE FONDO
========================== */

.hero {
  position: relative;
  background-image: url("../images/hero/documentos.gif");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}

/* Overlay suave para legibilidad 
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 247, 0.88); 
  z-index: 1;
} */


/* Asegurar que el contenido quede encima */
.hero-inner {
  position: relative;
  z-index: 2;
}


/* TEXTO */
.hero-content {
  max-width: 520px;
  margin-right: auto;
  text-align: left;
  animation: heroFade 0.9s ease forwards;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.3;
  max-width: 520px;
  margin-bottom: 1rem;
  color: var(--azul-irs);
}

.hero-subtitle {
  font-size: 1.2rem;
  line-height: 1.5;
  color: #000000;
  margin-bottom: 2rem;
}

/* CTA */
.hero-actions {
  display: flex;
  gap: 1rem;
}

/* VISUAL */
.hero-visual {
  position: relative;
  justify-self: end;
  margin-right: -40px;
  animation: heroSlide 1s ease forwards;
}

.hero-visual img {
  width: 100%;
  max-width: 520px;
  border-radius: 20px;
  border: 2px solid #01000c;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* OVERLAY */
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 49, 97, 0.15);
  border-radius: 20px;
  pointer-events: none;
}

.hero .hero-title {
  text-align: left !important;
}

/* ANIMACIONES */
@keyframes heroFade {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroSlide {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-title {
    font-size: 1.9rem;
    max-width: 100%;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-visual {
    margin-right: 0;
    justify-self: center;
  }

  .hero-visual img {
    max-width: 100%;
  }
}

/* MODO OSCURO (CONSISTENTE) */
body.dark-mode .hero {
  background-color: #0f172a;
}

body.dark-mode .hero-title {
  color: #e5e7eb;
}

body.dark-mode .hero-subtitle {
  color: #cbd5f5;
}

body.dark-mode .hero-visual img {
  border-color: #020617;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body.dark-mode .hero-visual::after {
  background: rgba(0, 0, 0, 0.35);
}

/* =========================
   HERO – CONTROL DE ESPACIADO
========================== */

.hero {
  padding-top: 3rem;
  padding-bottom: 3.5rem;
}

/* El hero NO debe heredar el padding genérico */
.hero.section,
section.hero {
  padding-top: 0;
  padding-bottom: 0;
}

@media (max-width: 768px) {
  .hero {
    padding-top: 2rem;
    padding-bottom: 2.5rem;
  }
}
