/* ============================================
   TuConta.Cloud — Landing Page Styles
   Pure CSS (complementa Tailwind CDN)
   ============================================ */

/* --- Design tokens (centralizados para mantenimiento) --- */
:root {
  --tc-indigo: #4f46e5;
  --tc-indigo-600: #4f46e5;
  --tc-indigo-700: #4338ca;
  --tc-slate-900: #0f172a;
  --tc-slate-bg: #f8fafc;
  --tc-green-accent: #10b981;
  --tc-whatsapp: #25d366;
  --tc-radius-card: 32px;
  --tc-radius-pill: 9999px;
  --tc-shadow-card: 0 10px 30px -10px rgba(15, 23, 42, 0.15);
  --tc-focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.35);
}

/* --- Base & Fonts --- */
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

/* --- Scroll Animations (reemplazo de Framer Motion) --- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
}

.fade-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered children */
.stagger-children>* {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger-children.visible>*:nth-child(1) {
  transition-delay: 0.0s;
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible>*:nth-child(2) {
  transition-delay: 0.1s;
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible>*:nth-child(3) {
  transition-delay: 0.15s;
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible>*:nth-child(4) {
  transition-delay: 0.2s;
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible>*:nth-child(5) {
  transition-delay: 0.25s;
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible>*:nth-child(6) {
  transition-delay: 0.3s;
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible>*:nth-child(7) {
  transition-delay: 0.35s;
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible>*:nth-child(8) {
  transition-delay: 0.4s;
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible>*:nth-child(9) {
  transition-delay: 0.45s;
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible>*:nth-child(10) {
  transition-delay: 0.5s;
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible>*:nth-child(n+11) {
  transition-delay: 0.55s;
  opacity: 1;
  transform: translateY(0);
}

/* --- Navbar scroll state --- */
#navbar {
  transition: padding 0.5s ease;
}

#navbar.scrolled {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

#navbar .nav-inner {
  transition: all 0.5s ease;
}

#navbar.scrolled .nav-inner {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.1);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem 1.5rem;
}

/* --- Mobile Menu --- */
#mobile-menu {
  display: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#mobile-menu.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* --- FAQ Accordion --- */
.faq-answer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.faq-item.active .faq-answer {
  display: block;
  max-height: 300px;
  opacity: 1;
}

.faq-item .faq-toggle svg:last-child {
  transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle svg:last-child {
  transform: rotate(180deg);
}

/* --- Module Tabs content animation --- */
.module-content {
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Floating Bounce --- */
@keyframes gentleBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.animate-gentle-bounce {
  animation: gentleBounce 3s ease-in-out infinite;
}

/* --- WhatsApp Pulse --- */
@keyframes waPing {
  0% {
    transform: scale(1);
    opacity: 0.2;
  }

  75%,
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.wa-ping {
  animation: waPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* --- WhatsApp Tooltip --- */
#wa-tooltip {
  opacity: 0;
  transform: translateX(20px) scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

#wa-tooltip.show {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

/* --- Hover Effects --- */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.module-card-icon {
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.module-card:hover .module-card-icon {
  transform: scale(1.1);
  background: #4f46e5;
  color: white;
}

/* --- Pricing Featured Scale --- */
@media (min-width: 768px) {
  .pricing-featured {
    transform: scale(1.05);
  }
}

/* --- Trust Strip --- */
.trust-strip {
  filter: grayscale(1);
  opacity: 0.5;
  transition: all 0.5s ease;
}

.trust-strip:hover {
  filter: grayscale(0);
  opacity: 1;
}

/* --- Bottom Mobile Nav --- */
@media (min-width: 768px) {
  #mobile-bottom-nav {
    display: none !important;
  }
}

/* Safe area para iPhone con notch / home indicator */
@media (max-width: 767.98px) {
  #mobile-bottom-nav {
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

/* --- Radial gradient for CTA sections --- */
.cta-bg-radial {
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

/* --- Counter animation smoothing --- */
[data-count] {
  font-variant-numeric: tabular-nums;
}

/* ============================================
   A11y — Focus visible consistente
   ============================================ */
:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 3px;
  border-radius: 6px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 3px;
}

/* ============================================
   Scroll margin para anclas con navbar fijo
   (evita que el encabezado quede tapado al hacer click en un #)
   ============================================ */
:target,
section[id],
main [id] {
  scroll-margin-top: 90px;
}

/* ============================================
   Padding inferior en móvil para no ocultar
   contenido detrás del bottom-nav flotante
   ============================================ */
@media (max-width: 767px) {
  body {
    padding-bottom: 96px;
  }
}

/* ============================================
   Back to top button
   ============================================ */
#back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 7.5rem;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  z-index: 40;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#back-to-top:hover {
  background: #4f46e5;
}

@media (min-width: 768px) {
  #back-to-top {
    right: 2rem;
    bottom: 7rem;
  }
}

/* ============================================
   FAQ — permitir respuestas más largas
   ============================================ */
.faq-item.active .faq-answer {
  max-height: 800px;
}

/* ============================================
   Pricing featured: evitar overflow horizontal
   al escalarse en pantallas justas
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  .pricing-featured {
    transform: scale(1.02);
  }
}

/* ============================================
   Print styles — para que una factura con la
   landing impresa/guardada como PDF sea legible
   ============================================ */
@media print {

  #navbar,
  #mobile-bottom-nav,
  #wa-tooltip,
  #back-to-top,
  .animate-gentle-bounce,
  .wa-ping,
  nav,
  footer .flex.gap-3 {
    display: none !important;
  }

  body {
    padding-bottom: 0 !important;
    color: #000 !important;
    background: #fff !important;
  }

  a {
    color: #0f172a !important;
    text-decoration: none !important;
  }

  .fade-up,
  .fade-in,
  .fade-left,
  .fade-scale,
  .stagger-children>* {
    opacity: 1 !important;
    transform: none !important;
  }

  section {
    page-break-inside: avoid;
  }
}

/* ============================================
   Reduce motion — respeta preferencia del usuario
   Desactiva animaciones para quienes tienen
   `prefers-reduced-motion: reduce` activado.
   ============================================ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  html {
    scroll-behavior: auto;
  }

  .fade-up,
  .fade-in,
  .fade-left,
  .fade-scale,
  .stagger-children>* {
    opacity: 1 !important;
    transform: none !important;
  }

  .animate-gentle-bounce,
  .wa-ping {
    animation: none !important;
  }
}

/* ============================================
   Billing toggle (precios mensual/anual)
   ============================================ */
#billing-toggle .billing-option {
  cursor: pointer;
  border: none;
  outline: none;
  white-space: nowrap;
}

#billing-toggle .billing-option[aria-pressed="true"] {
  background: #ffffff;
  color: var(--tc-slate-900);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.15);
}

/* Hover sutil en tarjetas de precios (no destacadas) */
.pricing-card:not(.pricing-featured) {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-card:not(.pricing-featured):hover {
  transform: translateY(-4px);
  box-shadow: var(--tc-shadow-card);
}

@media (prefers-reduced-motion: reduce) {
  .pricing-card:not(.pricing-featured):hover {
    transform: none;
  }
}