/* ════════════════════════════════════════════════════════════
   🥚 LIMPIAAI v9.0 — AURORA EDITION · PREMIUM ENHANCEMENT LAYER
   Aurora Mesh • 3D Tilt • Scroll Reveal • Shimmer Text
   Micro-interactions • Dashboard • Confetti-ready • A11y
   Se carga DESPUÉS de style.css y refina/extiende el design system
   ════════════════════════════════════════════════════════════ */

:root {
  --aur1: #7c3aed;
  --aur2: #2563eb;
  --aur3: #06b6d4;
  --aur4: #10b981;
  --gold1: #fbbf24;
  --gold2: #f59e0b;
  --glass-hi: rgba(255,255,255,.07);
  --ring-focus: 0 0 0 3px rgba(167,139,250,.45);
}

/* ═══ ACCESSIBILITY: focus visible + reduced motion ═══ */
:focus-visible { outline: none; box-shadow: var(--ring-focus); border-radius: 8px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ═══ AURORA MESH BACKGROUND (subtle upgrade over body::before) ═══ */
.aurora-mesh {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  opacity: .8;
}
.aurora-blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .16; will-change: transform;
}
.ab-1 { width: 55vmax; height: 55vmax; top: -20%; left: -15%;
  background: radial-gradient(circle, var(--aur1), transparent 65%);
  animation: abFloat1 26s ease-in-out infinite alternate; }
.ab-2 { width: 45vmax; height: 45vmax; bottom: -18%; right: -12%;
  background: radial-gradient(circle, var(--aur2), transparent 65%);
  animation: abFloat2 32s ease-in-out infinite alternate; }
.ab-3 { width: 35vmax; height: 35vmax; top: 35%; left: 55%;
  background: radial-gradient(circle, var(--aur3), transparent 65%);
  opacity: .1; animation: abFloat3 38s ease-in-out infinite alternate; }
@keyframes abFloat1 { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
@keyframes abFloat2 { to { transform: translate(-7vmax, -5vmax) scale(1.1); } }
@keyframes abFloat3 { to { transform: translate(-10vmax, 8vmax) scale(.9); } }

/* ═══ SHIMMER GRADIENT TEXT ═══ */
.shimmer-text {
  background: linear-gradient(110deg, #f1f5f9 20%, #c4b5fd 38%, #93c5fd 50%, #c4b5fd 62%, #f1f5f9 80%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmerSweep 5.5s ease-in-out infinite;
}
@keyframes shimmerSweep { 0%,100% { background-position: 110% 0; } 50% { background-position: -10% 0; } }

.gold-text {
  background: linear-gradient(120deg, #fde68a, #f59e0b 45%, #fbbf24 60%, #fde68a);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmerSweep 6s ease-in-out infinite;
}

/* ═══ SCROLL REVEAL ═══ */
.rv { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.rv.in { opacity: 1; transform: none; }
.rv-d1 { transition-delay: .06s; } .rv-d2 { transition-delay: .12s; }
.rv-d3 { transition-delay: .18s; } .rv-d4 { transition-delay: .24s; }

/* ═══ 3D TILT CARDS ═══ */
.tilt { transform-style: preserve-3d; transition: transform .18s ease-out, box-shadow .3s ease; will-change: transform; }
.tilt:hover { box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 0 32px rgba(124,58,237,.14); }
.tilt .tilt-shine {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.08), transparent 42%);
  opacity: 0; transition: opacity .25s ease;
}
.tilt:hover .tilt-shine { opacity: 1; }

/* ═══ HERO REFINEMENT ═══ */
.hero-title { letter-spacing: -.5px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 14px; border-radius: 99px; margin-bottom: 14px;
  font-size: .64rem; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--ta); background: rgba(124,58,237,.1);
  border: 1px solid rgba(124,58,237,.28);
  box-shadow: 0 0 20px rgba(124,58,237,.12), inset 0 0 12px rgba(124,58,237,.06);
  animation: eyebrowGlow 3s ease-in-out infinite;
}
.hero-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--aur4);
  box-shadow: 0 0 8px var(--aur4); animation: dotPulse 1.6s ease-in-out infinite;
}
@keyframes eyebrowGlow { 50% { box-shadow: 0 0 32px rgba(124,58,237,.22), inset 0 0 12px rgba(124,58,237,.1); } }
@keyframes dotPulse { 50% { opacity: .35; transform: scale(.8); } }

/* ═══ STAT CARDS UPGRADE (animated counter + top accent) ═══ */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 15%; right: 15%; height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,.6), transparent);
  opacity: .7;
}
.stat-card .stat-val { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ═══ TECH CARDS: gradient border-on-hover ═══ */
.tech-card { position: relative; overflow: hidden; transition: transform var(--tn), border-color var(--tn); }
.tech-card:hover { transform: translateY(-3px); border-color: rgba(124,58,237,.35) !important; }
.tech-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--gneon); transform: scaleX(0); transform-origin: left;
  transition: transform .4s cubic-bezier(.16,1,.3,1);
}
.tech-card:hover::after { transform: scaleX(1); }

/* ═══ BUTTON MICRO-INTERACTIONS ═══ */
.btn-primary, .btn-secondary, .btn-outline { position: relative; overflow: hidden; }
.btn-primary:active { transform: scale(.97); }
.btn-primary::after {
  content: ''; position: absolute; top: 0; left: -80%; width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.22), transparent);
  transform: skewX(-20deg); transition: none;
}
.btn-primary:hover::after { animation: btnSheen .8s ease; }
@keyframes btnSheen { to { left: 130%; } }

/* Ripple effect (JS injects .ripple-ink) */
.ripple-ink {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255,255,255,.28); transform: scale(0);
  animation: rippleGo .55s ease-out forwards;
}
@keyframes rippleGo { to { transform: scale(2.6); opacity: 0; } }

/* ═══ UPLOAD ZONE: animated dashed border ═══ */
.upload-zone { position: relative; transition: transform var(--tn), box-shadow var(--tn); }
.upload-zone:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(124,58,237,.14); }
.upload-zone.drag {
  border-color: var(--pl) !important;
  box-shadow: 0 0 0 3px rgba(167,139,250,.25), 0 0 40px rgba(124,58,237,.25);
  transform: scale(1.015);
}
.upload-zone-icon { transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.upload-zone:hover .upload-zone-icon { transform: translateY(-4px) scale(1.1); }

/* ═══ ENERGY DASHBOARD (History) ═══ */
.dash-card {
  background: var(--gc); border: 1px solid var(--bd); border-radius: var(--rx);
  padding: 18px 16px 14px; margin-bottom: 16px; position: relative; overflow: hidden;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.dash-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gneon); opacity: .6;
}
.dash-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 800; margin-bottom: 12px; color: var(--t1);
}
.dash-title i { color: var(--pl); }
.dash-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.dash-kpi {
  text-align: center; padding: 10px 4px; border-radius: var(--r);
  background: rgba(255,255,255,.025); border: 1px solid var(--bd);
}
.dash-kpi-val { font-family: var(--mono); font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.dash-kpi-label { font-size: .58rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--t3); margin-top: 2px; }
.dash-spark-wrap { position: relative; height: 84px; }
.dash-spark { width: 100%; height: 100%; display: block; }
.dash-empty-hint { font-size: .68rem; color: var(--t3); text-align: center; padding: 8px 0 2px; }

/* ═══ HISTORY ITEMS refinement ═══ */
.hist-item { position: relative; overflow: hidden; }
.hist-item:hover { transform: translateY(-2px); border-color: rgba(124,58,237,.3); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.hist-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gneon); opacity: 0; transition: opacity var(--tn);
}
.hist-item:hover::before { opacity: 1; }

/* ═══ RESULT GAUGE: glow + count-up ready ═══ */
.res-gauge { filter: drop-shadow(0 0 14px rgba(124,58,237,.25)); }
.res-gauge-val { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ═══ SYMBOL CARDS: entrance stagger ═══ */
.sym-card { animation: symIn .5s cubic-bezier(.16,1,.3,1) backwards; }
.sym-card:nth-child(1) { animation-delay: .05s; }
.sym-card:nth-child(2) { animation-delay: .12s; }
.sym-card:nth-child(3) { animation-delay: .19s; }
.sym-card:nth-child(4) { animation-delay: .26s; }
.sym-card:nth-child(5) { animation-delay: .33s; }
.sym-card:nth-child(n+6) { animation-delay: .4s; }
@keyframes symIn { from { opacity: 0; transform: translateX(-14px); } }
.sym-card:hover { transform: translateX(3px); }
.sym-card { transition: transform var(--tn), box-shadow var(--tn); }

/* ═══ CONFETTI CANVAS ═══ */
.confetti-canvas {
  position: fixed; inset: 0; z-index: 9000; pointer-events: none;
}

/* ═══ FLOATING ACTION BUTTON (scroll top on results) ═══ */
.fab-top {
  position: fixed; right: 16px; bottom: calc(var(--bh) + var(--sb) + 46px);
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--aur1), var(--aur2));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(124,58,237,.4);
  z-index: 500; opacity: 0; transform: translateY(14px) scale(.85);
  pointer-events: none; transition: opacity .3s, transform .3s;
}
.fab-top.show { opacity: 1; transform: none; pointer-events: all; }
.fab-top:active { transform: scale(.92); }

/* ═══ EXPORT / DOWNLOAD BUTTON accent ═══ */
.act-export {
  background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(6,182,212,.08));
  border: 1px solid rgba(16,185,129,.25); color: var(--okl);
}
.act-export:hover { border-color: rgba(16,185,129,.5); box-shadow: 0 0 24px rgba(16,185,129,.15); }

/* ═══ SKELETON SHIMMER (loading states) ═══ */
.skel {
  background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.03) 75%);
  background-size: 200% 100%; animation: skelWave 1.4s ease infinite;
  border-radius: var(--r);
}
@keyframes skelWave { to { background-position: -200% 0; } }

/* ═══ HEADER polish: scrolled state + brand shimmer ═══ */
.hdr { transition: box-shadow .3s ease, background .3s ease; }
.hdr.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,.55); }
.hdr-title { position: relative; }
.hdr-badge {
  background: linear-gradient(135deg, var(--aur1), var(--aur2));
  animation: badgePulse 4s ease-in-out infinite;
}
@keyframes badgePulse { 50% { box-shadow: 0 0 14px rgba(124,58,237,.5); } }

/* ═══ BOTTOM NAV: active indicator pill ═══ */
.bnav-btn { position: relative; }
.bnav-btn::before {
  content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%) scaleX(0);
  width: 22px; height: 3px; border-radius: 99px;
  background: var(--gneon); transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.bnav-btn.active::before { transform: translateX(-50%) scaleX(1); }

/* ═══ TOAST refinement ═══ */
.toast { border-left: 3px solid var(--pl); }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }

/* ═══ STEP ITEMS: connector line ═══ */
.steps-list { position: relative; }
.step-item { position: relative; }
.step-item:not(:last-child)::after {
  content: ''; position: absolute; left: 17px; top: 44px; bottom: -14px; width: 2px;
  background: linear-gradient(180deg, rgba(124,58,237,.35), rgba(124,58,237,.05));
}
html[dir="rtl"] .step-item:not(:last-child)::after { left: auto; right: 17px; }

/* ═══ CULTURE CARDS hover ═══ */
.cult-card { transition: transform var(--tn), border-color var(--tn), box-shadow var(--tn); }
.cult-card:hover { transform: translateY(-3px) scale(1.03); border-color: rgba(124,58,237,.4); box-shadow: 0 8px 24px rgba(124,58,237,.15); }

/* ═══ SIDE MENU polish ═══ */
.side-nav a { transition: background var(--tf), padding-left var(--tf), color var(--tf); border-radius: 10px; }
.side-nav a:hover { background: rgba(124,58,237,.1); padding-left: 18px; color: var(--pl); }
html[dir="rtl"] .side-nav a:hover { padding-left: 0; padding-right: 18px; }

/* ═══ LEGAL MODAL: entrance ═══ */
.legal-content { animation: modalPop .5s cubic-bezier(.16,1,.3,1); }
@keyframes modalPop { from { opacity: 0; transform: translateY(24px) scale(.97); } }

/* ═══ SCREEN TRANSITIONS ═══ */
.scr.active .scr-inner > * { animation: none; }
.scr.active { animation: scrFade .4s ease-out; }
@keyframes scrFade { from { opacity: 0; } }

/* ═══ RESULTS LEVEL BANNER: animated aura ═══ */
.res-level-banner { position: relative; overflow: hidden; }
.res-level-banner::after {
  content: ''; position: absolute; inset: -50%;
  background: conic-gradient(from 0deg, transparent 70%, rgba(255,255,255,.06), transparent 82%);
  animation: bannerSweep 6s linear infinite; pointer-events: none;
}
@keyframes bannerSweep { to { transform: rotate(360deg); } }

/* ═══ PRINT STYLES (export-friendly) ═══ */
@media print {
  .hdr, .bottom-nav, .footer-legal, .fab-top, .res-actions,
  .particle-canvas, .aurora-mesh, .side-menu, .side-overlay { display: none !important; }
  body { background: #fff; color: #111; }
  .scr { position: static !important; opacity: 1 !important; }
}

/* ═══ LARGE SCREENS: center column + richer layout ═══ */
@media (min-width: 900px) {
  .scr-inner { max-width: 760px; margin: 0 auto; }
  .tech-grid { grid-template-columns: repeat(3, 1fr); }
  /* v21: aquí `.stats-row` tenía `max-width:640px` con márgenes automáticos
     mientras `.scr-inner` mide 760px. Resultado: esa única fila quedaba 120px
     más estrecha y centrada, así que sus bordes NO coincidían con los de
     ningún otro bloque de la columna — el desfase visible en pantalla ancha.
     Debe ocupar el mismo ancho que todo lo demás. */
}
