/* ============================================================
   styles.css — ANERSA Soluciones Digitales
   Paleta: índigo · cian · slate oscuro (dark-first)
   ============================================================ */

/* ── Variables de diseño (Dark mode — default) ──────────────── */
:root {
  --primary:       #4F46E5;
  --primary-lt:    #818CF8;
  --primary-dk:    #3730A3;
  --accent:        #06B6D4;
  --accent-glow:   #22D3EE;
  --bg:            #0F172A;
  --bg-card:       #1E293B;
  --bg-mid:        #334155;
  --text:          #F8FAFC;
  --text-muted:    #94A3B8;
  --text-light:    #64748B;
  --border:        rgba(99, 102, 241, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --wa-green:      #10B981;
  --wa-green-dk:   #059669;
  --shadow-indigo: 0 8px 32px rgba(79, 70, 229, 0.35);
  --shadow-cyan:   0 8px 32px rgba(6, 182, 212, 0.25);
  --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Light mode overrides ──────────────────────────────────── */
html:not(.dark) {
  --bg:            #FFFFFF;
  --bg-card:       #F8FAFC;
  --bg-mid:        #E2E8F0;
  --text:          #0F172A;
  --text-muted:    #475569;
  --text-light:    #94A3B8;
  --border:        rgba(79, 70, 229, 0.15);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ── Reset / base ───────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

/* ── Gradient text ──────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-lt) 0%, var(--accent-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Navbar ─────────────────────────────────────────────────── */
#navbar {
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

#navbar.scrolled {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(99, 102, 241, 0.15), 0 4px 24px rgba(0, 0, 0, 0.35);
}

html:not(.dark) #navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 4px 24px rgba(0, 0, 0, 0.07);
}

.nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--primary-lt), var(--accent-glow));
  border-radius: 2px;
  transition: width 0.25s ease;
}

.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; }

.mobile-nav-link {
  display: block;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.mobile-nav-link:hover {
  color: var(--text);
  background: rgba(99, 102, 241, 0.08);
}

/* ── Botones ─────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(79, 70, 229, 0.5);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  background: var(--wa-green);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}

.btn-whatsapp:hover {
  background: var(--wa-green-dk);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.45);
}

.btn-outline-indigo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  color: var(--primary-lt);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-outline-indigo:hover {
  background: rgba(79, 70, 229, 0.1);
  border-color: var(--primary-lt);
  transform: translateY(-2px);
}

/* ── WhatsApp Float ─────────────────────────────────────────── */
.wa-float-btn {
  background: var(--wa-green);
  animation: wa-pulse 2.8s ease-in-out infinite;
}

.wa-float-btn:hover {
  background: var(--wa-green-dk);
  animation: none;
}

@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50%       { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0); }
}

/* ── Fade-up (scroll reveal) ─────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

/* Delays escalonados para grids */
.fade-up:nth-child(2) { transition-delay: 0.10s; }
.fade-up:nth-child(3) { transition-delay: 0.20s; }
.fade-up:nth-child(4) { transition-delay: 0.30s; }
.fade-up:nth-child(5) { transition-delay: 0.10s; }
.fade-up:nth-child(6) { transition-delay: 0.20s; }

/* ── Glass card ─────────────────────────────────────────────── */
.glass-card {
  background: rgba(30, 41, 59, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 1rem;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

html:not(.dark) .glass-card {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(79, 70, 229, 0.12);
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-5px);
  box-shadow: var(--shadow-indigo);
}

/* ── Hero grid background (CSS puro) ────────────────────────── */
.grid-bg {
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
}

html:not(.dark) .grid-bg {
  background-image:
    linear-gradient(rgba(79, 70, 229, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 70, 229, 0.05) 1px, transparent 1px);
}

/* Hero: fondo en light mode */
html:not(.dark) #hero {
  background: #f8fafc;
}

html:not(.dark) #hero .absolute.bottom-0 {
  background: linear-gradient(to top, #f8fafc, transparent);
}

/* fade-up: respetar animation-delay inline */
.fade-up[style*="animation-delay"] {
  transition-delay: var(--delay, 0s);
}

/* Aplicar delay con CSS var en cada elemento vía style inline */
.fade-up { --delay: 0s; }

/* ── Eyebrow / section label ─────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-lt);
}

.section-label::before,
.section-label::after {
  content: '';
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--primary-lt);
  opacity: 0.5;
}

/* ── Sección de servicios ────────────────────────────────────── */
.service-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: background 0.3s ease;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.features-list li {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.price-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent-glow);
  margin-bottom: 1.25rem;
}

.card-cta {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  border: 1.5px solid rgba(99, 102, 241, 0.3);
  color: var(--primary-lt);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-top: auto;
}

.card-cta:hover {
  background: rgba(79, 70, 229, 0.12);
  border-color: var(--primary-lt);
}

/* ── Timeline / Proceso ──────────────────────────────────────── */
.step-number {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

/* ── Benefit card ────────────────────────────────────────────── */
.benefit-card {
  padding: 1.5rem;
  border-radius: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

html:not(.dark) .benefit-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.benefit-card:hover {
  border-color: rgba(6, 182, 212, 0.3);
  transform: translateY(-3px);
}

.benefit-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.625rem;
  background: rgba(6, 182, 212, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--accent);
}

/* ── FAQ Accordion ───────────────────────────────────────────── */
.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--bg-card);
  transition: border-color 0.2s ease;
}

html:not(.dark) .faq-item {
  box-shadow: var(--shadow-sm);
}

.faq-item[data-open="true"],
.faq-item:has([aria-expanded="true"]) {
  border-color: rgba(99, 102, 241, 0.3);
}

.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 1rem;
  transition: color 0.2s ease;
}

.faq-trigger:hover { color: var(--primary-lt); }

.faq-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--primary-lt);
  transition: transform 0.3s ease;
}

.faq-body {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ── Formulario de contacto ──────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-input::placeholder { color: var(--text-light); }

.form-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

html:not(.dark) .form-input {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
}

.social-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.social-icon:hover {
  color: var(--primary-lt);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(79, 70, 229, 0.08);
}

/* ── Proceso: light mode bg ──────────────────────────────────── */
html:not(.dark) #proceso {
  background: #f1f5f9;
}

html:not(.dark) #faq {
  background: #f1f5f9;
}

html:not(.dark) footer#contacto {
  background: #0f172a;
}

/* ── Select option (dark bg para dark mode) ──────────────────── */
.form-input option {
  background: #1E293B;
  color: #F8FAFC;
}

html:not(.dark) .form-input option {
  background: #fff;
  color: #0F172A;
}

/* ── Textarea resize override ────────────────────────────────── */
textarea.form-input { resize: vertical; min-height: 7rem; }

/* ── btn-whatsapp full-width variant ────────────────────────── */
.btn-whatsapp.w-full { display: flex; }

/* ============================================================
   FASE 6 — Polish: light mode, nav activo, micro-interacciones
   ============================================================ */

/* ── Light mode: headings (override Tailwind text-white) ──────── */
html:not(.dark) h1,
html:not(.dark) h2,
html:not(.dark) h3,
html:not(.dark) h4 {
  color: #0F172A;
}
/* gradient-text mantiene su gradiente (usa -webkit-text-fill-color) */

/* ── Light mode: hero adjustments ────────────────────────────── */
html:not(.dark) .hero-gradient-overlay {
  opacity: 0.08;
}

html:not(.dark) #hero .text-indigo-300 {
  color: #4338CA;
}

html:not(.dark) #hero .text-slate-400 {
  color: #475569;
}

html:not(.dark) #hero .border-slate-700 {
  border-color: #CBD5E1;
}

/* ── Light mode: section backgrounds ────────────────────────── */
html:not(.dark) #soluciones {
  background-color: #FFFFFF;
}

html:not(.dark) #porque {
  background-color: #FFFFFF;
}

/* ── Light mode: mobile menu ─────────────────────────────────── */
html:not(.dark) #mobile-menu {
  background: rgba(255, 255, 255, 0.97);
  border-top-color: rgba(0, 0, 0, 0.08);
}

html:not(.dark) .mobile-nav-link {
  color: #475569;
}

html:not(.dark) .mobile-nav-link:hover {
  color: #0F172A;
  background: rgba(79, 70, 229, 0.06);
}

/* ── Light mode: icon buttons ───────────────────────────────── */
html:not(.dark) #darkToggle,
html:not(.dark) #menu-toggle {
  color: #475569;
}

html:not(.dark) #darkToggle:hover,
html:not(.dark) #menu-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0F172A;
}

/* ── Light mode: pre-footer CTA band ─────────────────────────── */
html:not(.dark) #pre-footer-cta {
  background: linear-gradient(to right, rgba(79, 70, 229, 0.07), rgba(6, 182, 212, 0.05));
  border-color: rgba(79, 70, 229, 0.12);
}

/* ── Light mode: section-label ──────────────────────────────── */
html:not(.dark) .section-label {
  color: var(--primary);
}

html:not(.dark) .section-label::before,
html:not(.dark) .section-label::after {
  background: var(--primary);
  opacity: 0.6;
}

/* ── Light mode: card-cta text ───────────────────────────────── */
html:not(.dark) .card-cta {
  border-color: rgba(79, 70, 229, 0.25);
  color: var(--primary);
}

html:not(.dark) .card-cta:hover {
  background: rgba(79, 70, 229, 0.06);
  border-color: var(--primary);
}

/* ── Active nav link ─────────────────────────────────────────── */
.nav-link.active {
  color: var(--text);
}

.nav-link.active::after {
  width: 100%;
}

/* ── WhatsApp float: tooltip ─────────────────────────────────── */
#whatsapp-float {
  overflow: visible;
}

.wa-tooltip {
  position: absolute;
  right: calc(100% + 0.875rem);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: #1E293B;
  color: #F8FAFC;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.375rem 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(99, 102, 241, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.wa-tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #1E293B;
}

.wa-float-btn:hover .wa-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

html:not(.dark) .wa-tooltip {
  background: #334155;
  border-color: rgba(79, 70, 229, 0.2);
}

html:not(.dark) .wa-tooltip::after {
  border-left-color: #334155;
}
