/* =========================================================
   CLOUD-TECNOLOGIES — Sistema de diseño global
   Variables CSS disponibles en todas las páginas
   ========================================================= */
:root {
  /* Primario */
  --ct-orange:       #ea580c;
  --ct-orange-light: #f97316;
  --ct-orange-dark:  #c2410c;
  --ct-orange-glow:  rgba(234, 88, 12, 0.15);

  /* Fondos */
  --ct-bg-dark:    #0a0a0f;
  --ct-bg-card:    #111118;
  --ct-bg-surface: #1a1a24;
  --ct-bg-light:   #f8f7f5;

  /* Texto */
  --ct-text-primary: #f1f0ee;
  --ct-text-muted:   #9ca3af;
  --ct-text-dark:    #1f2937;

  /* Bordes y superficies */
  --ct-border: rgba(234, 88, 12, 0.2);
  --ct-glass:  rgba(255, 255, 255, 0.03);

  /* Easing */
  --ease-in:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.0, 0, 0.2, 1);

  /* Duración */
  --dur-fast: 150ms;
  --dur-base: 300ms;
  --dur-slow: 600ms;
}

/* =========================================================
   RESET GLOBAL
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================================================
   HEADER / NAVEGACIÓN
   ========================================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  z-index: 100;
  transition:
    background var(--dur-base) var(--ease-in),
    padding    var(--dur-base) var(--ease-in),
    box-shadow var(--dur-base) var(--ease-in),
    border-color var(--dur-base) var(--ease-in);
  background: transparent;
  border-bottom: 1px solid transparent;
}

header.abajo {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 48px;
  border-bottom-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
}

header .logo img {
  transition: filter var(--dur-base) var(--ease-in);
}
header:not(.abajo) .logo img {
  /* Logo en blanco puro cuando está sobre la imagen oscura */
  filter: brightness(0) invert(1);
}
header.abajo .logo img {
  /* Logo original a color cuando el header es blanco */
  filter: none;
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
}

header ul {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

header ul li {
  list-style: none;
}

header ul li a {
  position: relative;
  padding: 6px 2px;
  margin: 0 12px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.04em;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color var(--dur-base) var(--ease-in);
}

header ul li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ct-orange), var(--ct-orange-light));
  left: 0;
  bottom: -4px;
  border-radius: 2px;
  transition: width var(--dur-base) var(--ease-in);
}

header ul li a:hover {
  color: var(--ct-orange-light);
}

header ul li a:hover::after {
  width: 100%;
}

header.abajo ul li a {
  color: var(--ct-text-dark);
}

header.abajo ul li a:hover {
  color: var(--ct-orange);
}

/* Active nav link */
header ul li a.nav-active {
  color: var(--ct-orange-light);
}
header ul li a.nav-active::after {
  width: 100%;
}
header.abajo ul li a.nav-active {
  color: var(--ct-orange);
}
header.abajo ul li a.nav-active::after {
  width: 100%;
  background: linear-gradient(90deg, var(--ct-orange), var(--ct-orange-light));
}

@media (max-width: 768px) {
  header {
    padding: 20px 24px;
  }
  header.abajo {
    padding: 12px 24px;
  }
  header ul li a {
    margin: 0 8px;
    font-size: 0.85rem;
  }
}

/* =========================================================
   COMPONENTES GLOBALES REUTILIZABLES
   ========================================================= */

/* Badge / Pill */
.ct-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(234, 88, 12, 0.1);
  color: var(--ct-orange-light);
  border: 1px solid rgba(234, 88, 12, 0.3);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Botón primario */
.ct-btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--ct-orange), var(--ct-orange-dark));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 14px 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform  var(--dur-base) var(--ease-in),
    box-shadow var(--dur-base) var(--ease-in);
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}
.ct-btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--ct-orange-light), var(--ct-orange));
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-in);
}
.ct-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(234, 88, 12, 0.48);
}
.ct-btn-primary:hover::before {
  opacity: 1;
}
.ct-btn-primary > * {
  position: relative;
  z-index: 1;
}

/* Card glassmorphism */
.ct-card-glass {
  background: var(--ct-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--ct-border);
  border-radius: 16px;
  transition:
    border-color var(--dur-base) var(--ease-in),
    transform    var(--dur-base) var(--ease-in),
    box-shadow   var(--dur-base) var(--ease-in);
}
.ct-card-glass:hover {
  border-color: rgba(234, 88, 12, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 24px rgba(234, 88, 12, 0.1);
}

/* Separador decorativo */
.ct-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
.ct-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(234, 88, 12, 0.4), transparent);
}
.ct-divider-dot {
  width: 8px;
  height: 8px;
  background: var(--ct-orange);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(234, 88, 12, 0.6);
  flex-shrink: 0;
}

/* Estadísticas / Contadores */
.ct-stat {
  text-align: center;
  padding: 24px 16px;
}
.ct-stat-number {
  display: inline-block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--ct-orange), var(--ct-orange-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.ct-stat-suffix {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--ct-orange), var(--ct-orange-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ct-stat-label {
  font-size: 0.75rem;
  color: var(--ct-text-muted);
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
}

/* Etiqueta de sección */
.ct-section-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ct-orange);
  margin-bottom: 12px;
}

/* Escala tipográfica */
.text-heroic {
  font-size: clamp(1.4rem, 2.8vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.text-display {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.text-body-lg {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--ct-text-muted);
}

/* Texto en gradiente naranja */
.text-gradient {
  background: linear-gradient(135deg, var(--ct-orange), var(--ct-orange-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Línea de acento vertical */
.ct-accent-line {
  border-left: 3px solid var(--ct-orange);
  padding-left: 20px;
}

/* =========================================================
   FOOTER OSCURO (compartido en todas las páginas)
   ========================================================= */
.footer-dark {
  background-color: #0d1b2a;
  color: var(--ct-text-primary);
}
.footer-dark h1,
.footer-dark .text-orange-600 {
  color: var(--ct-orange-light) !important;
}
.footer-dark .text-gray-800 {
  color: var(--ct-text-primary) !important;
}
.footer-dark hr,
.footer-dark .border-black {
  border-color: rgba(255, 255, 255, 0.08) !important;
}
.footer-dark span.text-orange-600 {
  color: var(--ct-text-muted) !important;
}
.footer-dark .ct-footer-nav-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ct-text-muted);
  margin-bottom: 12px;
  display: block;
}
.footer-dark .ct-footer-nav a {
  display: block;
  color: rgba(241, 240, 238, 0.55);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color var(--dur-base) ease;
}
.footer-dark .ct-footer-nav a:hover {
  color: var(--ct-orange-light);
}
.footer-dark .ct-footer-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(234, 88, 12, 0.35), transparent);
  border: none;
  margin: 32px 0;
}
.footer-dark .ct-footer-copy {
  color: rgba(241, 240, 238, 0.35) !important;
  font-size: 0.85rem;
}

/* Sección clara — overrides para hijos sobre fondo blanco */
.ct-section-light .ct-card-glass {
  background: #ffffff;
  border-color: rgba(234, 88, 12, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.ct-section-light .ct-card-glass:hover {
  box-shadow: 0 12px 32px rgba(234, 88, 12, 0.14), 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: rgba(234, 88, 12, 0.35);
  transform: translateY(-4px);
}
.ct-section-light .ct-stat-label {
  color: #64748b;
}

/* Social icons en footer oscuro */
.ct-footer-social {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
}
.ct-footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(234, 88, 12, 0.25);
  background: rgba(234, 88, 12, 0.05);
  color: var(--ct-orange);
  text-decoration: none;
  transition:
    background  var(--dur-base) ease,
    border-color var(--dur-base) ease,
    box-shadow  var(--dur-base) ease,
    transform   var(--dur-base) ease;
}
.ct-footer-social a:hover {
  background: var(--ct-orange);
  border-color: var(--ct-orange);
  color: #fff;
  box-shadow: 0 0 20px rgba(234, 88, 12, 0.45);
  transform: translateY(-3px);
}

/* Input oscuro para suscripción en footer */
.input-dark {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(234, 88, 12, 0.2) !important;
  color: var(--ct-text-primary) !important;
  transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease !important;
}
.input-dark::placeholder {
  color: var(--ct-text-muted) !important;
}
.input-dark:focus {
  border-color: var(--ct-orange) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12) !important;
}

/* Botón de suscripción en footer oscuro */
.btn-subscribe-dark {
  background: linear-gradient(135deg, var(--ct-orange), var(--ct-orange-dark)) !important;
  color: #fff !important;
  font-weight: 700 !important;
  border: none !important;
  transition: box-shadow var(--dur-base) ease, transform var(--dur-base) ease !important;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3) !important;
}
.btn-subscribe-dark:hover {
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.5) !important;
  transform: translateY(-1px) !important;
}

/* =========================================================
   HAMBURGER BUTTON — mobile only
   ========================================================= */
#nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 200;
  -webkit-tap-highlight-color: transparent;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
  transition:
    transform  0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity    0.3s ease,
    background 0.3s ease;
}

header.abajo .hamburger-line {
  background: var(--ct-text-dark);
}

#nav-toggle.is-open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#nav-toggle.is-open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#nav-toggle.is-open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   MOBILE OVERLAY + SLIDE PANEL
   ========================================================= */
#mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

#mobile-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

#mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: min(300px, 82vw);
  height: 100vh;
  background: #0d1b2a;
  z-index: 150;
  display: flex;
  flex-direction: column;
  padding: 90px 36px 52px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 1px solid rgba(234, 88, 12, 0.2);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
}

#mobile-menu.is-open {
  transform: translateX(0);
}

#mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

#mobile-menu ul li a {
  display: block;
  color: rgba(241, 240, 238, 0.72);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  letter-spacing: 0.02em;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

#mobile-menu ul li a:hover,
#mobile-menu ul li a.nav-active {
  color: var(--ct-orange-light);
  padding-left: 8px;
}

#mobile-menu .mobile-cta {
  margin-top: auto;
  display: block;
  text-align: center;
  background: linear-gradient(135deg, var(--ct-orange), var(--ct-orange-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}

#mobile-menu .mobile-cta:hover {
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.48);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  header nav {
    display: none;
  }
  #nav-toggle {
    display: flex;
  }
}
