:root {
  --bg-primary: #0a0f1e;
  --bg-secondary: #070b18;
  --surface: #0f1526;
  --surface-2: #131a2e;
  --primary: #22c55e;
  --primary-600: #16a34a;
  --primary-soft: rgba(34,197,94,.12);
  --accent: #38bdf8;
  --accent-soft: rgba(56,189,248,.12);
  --gold: #fbbf24;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.14);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
  --shadow-green: 0 8px 30px rgba(34,197,94,.18);
  --grad-main: linear-gradient(135deg, #22c55e 0%, #38bdf8 50%, #22c55e 100%);
  --grad-text: linear-gradient(90deg, #4ade80, #38bdf8, #a78bfa);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
::selection { background: rgba(34,197,94,.35); color: #fff; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: linear-gradient(#22c55e, #38bdf8); border-radius: 999px; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 600px at 12% -8%, rgba(34,197,94,.16), transparent 60%),
    radial-gradient(800px 520px at 88% 0%, rgba(56,189,248,.14), transparent 55%),
    radial-gradient(1000px 700px at 50% 120%, rgba(167,139,250,.09), transparent 60%),
    var(--bg-primary);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .25;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
}
.container { width: min(1120px, 92vw); margin: 0 auto; }

/* ============ HEADER ============ */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,15,30,.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: .85rem 0; gap: 1rem; }
.logo { display: flex; align-items: center; gap: .6rem; color: var(--text-primary); text-decoration: none; font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.logo img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; filter: drop-shadow(0 4px 12px rgba(34,197,94,.4)); transition: transform .3s ease; }
.logo:hover img { transform: rotate(-6deg) scale(1.06); }
.nav-links { display: flex; gap: .35rem; list-style: none; align-items: center; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: .45rem .85rem; border-radius: 999px; transition: all .25s ease;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.07); }
#langSel {
  padding: .42rem .7rem; border-radius: 10px; font-size: .9rem; cursor: pointer;
  background: rgba(255,255,255,.06); color: var(--text-primary); border: 1px solid var(--border);
  transition: all .25s ease; outline: none;
}
#langSel:hover { border-color: var(--border-strong); background: rgba(255,255,255,.1); }
#langSel:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
#langSel option { background: var(--surface); color: var(--text-primary); }

/* ============ HERO ============ */
.hero { position: relative; padding: clamp(4rem, 9vw, 7rem) 0 2.5rem; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto;
  height: 600px; background: radial-gradient(ellipse at 50% 0%, rgba(34,197,94,.2), transparent 60%);
  filter: blur(30px); pointer-events: none;
}
.hero-content { position: relative; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem 1rem; border-radius: 999px; margin-bottom: 1.25rem;
  background: var(--primary-soft); border: 1px solid rgba(34,197,94,.35); color: #4ade80;
  font-size: .85rem; font-weight: 600; letter-spacing: .04em;
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 1.04; font-weight: 800; letter-spacing: -.03em;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 1.1rem;
  animation: heroIn .8s ease both;
}
.hero p {
  color: var(--text-secondary); font-size: clamp(1.05rem, 2vw, 1.2rem); max-width: 680px; margin: 0 auto 2.2rem;
  animation: heroIn .8s ease .12s both;
}
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .9rem; animation: heroIn .8s ease .24s both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ============ BOTONES ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.5rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .97rem;
  border: 1px solid transparent; cursor: pointer; transition: all .28s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.btn.primary {
  background: var(--grad-main); background-size: 200% 100%; color: #06121a;
  box-shadow: var(--shadow-green);
}
.btn.primary:hover { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 12px 36px rgba(34,197,94,.3); }
.btn.primary:active { transform: translateY(0); }
.btn.ghost { background: rgba(255,255,255,.04); color: var(--text-primary); border-color: var(--border-strong); }
.btn.ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); transform: translateY(-2px); }

/* ============ SECCIONES ============ */
.section { position: relative; padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem); margin-bottom: .75rem; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(180deg, #fff, #c9d4e6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.section-sub { color: var(--text-secondary); max-width: 640px; margin-bottom: 2rem; font-size: 1.02rem; }

/* ============ GRID Y CARDS ============ */
.grid { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card {
  position: relative;
  background: linear-gradient(165deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 4px 20px rgba(0,0,0,.2);
  transition: transform .3s cubic-bezier(.4,0,.2,1), border-color .3s, box-shadow .3s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
}
.card::after {
  content: ""; position: absolute; top: -60%; left: 50%; width: 140%; aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(34,197,94,.14), transparent 60%);
  opacity: 0; transition: opacity .4s ease; pointer-events: none;
}
.card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow), var(--shadow-green); }
.card:hover::after { opacity: 1; }
.card h3 { margin-bottom: .7rem; font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; position: relative; }
.card p { color: var(--text-secondary); margin-bottom: .75rem; font-size: .95rem; position: relative; }
.card ul { padding-left: .25rem; list-style: none; color: var(--text-secondary); display: flex; flex-direction: column; gap: .5rem; position: relative; }
.card ul li { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.card ul li::before { content: "✦"; color: var(--primary); font-size: .75rem; }
.card .link { position: relative; }
.link { color: var(--primary); text-decoration: none; font-weight: 600; font-size: .95rem; transition: all .2s ease; }
.link:hover { color: #4ade80; text-decoration: none; }
.link:hover::after { width: 100%; }
.link::after { content: ""; display: block; height: 1px; width: 0; background: currentColor; transition: width .25s ease; }

/* stat chips */
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem; margin-top: 2.5rem; }
.stat { text-align: center; }
.stat strong { display: block; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat span { color: var(--text-secondary); font-size: .9rem; }

/* ============ TAGS ============ */
.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.tag {
  padding: .32rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  background: var(--primary-soft); color: var(--primary); border: 1px solid rgba(34,197,94,.35);
}
.tag.alt { background: var(--accent-soft); color: var(--accent); border-color: rgba(56,189,248,.35); }
.tag.gold { background: rgba(251,191,36,.1); color: var(--gold); border-color: rgba(251,191,36,.35); }

/* ============ TABLAS ============ */
.table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 1rem; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.table th, .table td { border-bottom: 1px solid var(--border); padding: .85rem 1rem; text-align: left; font-size: .93rem; }
.table tr:last-child td { border-bottom: none; }
.table th {
  background: rgba(255,255,255,.05); color: var(--text-secondary); font-weight: 600; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .06em;
}
.table tbody tr { transition: background .2s ease; }
.table tbody tr:hover { background: rgba(34,197,94,.05); }
.table td:first-child { font-weight: 600; }

/* ============ HERO-SMALL ============ */
.hero-small { padding: clamp(2.5rem, 5vw, 4rem) 0 1rem; text-align: center; position: relative; }
.hero-small::before {
  content: ""; position: absolute; inset: auto 15% -10%; height: 200px;
  background: radial-gradient(ellipse at 50% 60%, rgba(34,197,94,.13), transparent 60%);
  filter: blur(20px); pointer-events: none;
}
.hero-small h1 {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.03em; position: relative;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-small p { color: var(--text-secondary); max-width: 700px; margin: .8rem auto 0; position: relative; font-size: 1.03rem; }

/* ============ CONTROLS / FORM ============ */
.controls { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.5rem; }
.controls input, .controls select, label select, label input {
  padding: .7rem 1rem; border-radius: var(--radius-sm); font-size: .93rem;
  border: 1px solid var(--border); background: rgba(255,255,255,.05); color: var(--text-primary);
  transition: all .25s ease; outline: none;
}
.controls input { flex: 2 1 200px; }
.controls select { flex: 1 1 160px; cursor: pointer; }
.controls input::placeholder { color: var(--text-muted); }
.controls input:focus, .controls select:focus, label select:focus, label input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
label { display: flex; flex-direction: column; gap: .4rem; font-weight: 600; color: var(--text-secondary); margin-bottom: .6rem; font-size: .92rem; }
label select, label input { margin-top: .15rem; }
#contador, .controls .tag { align-self: center; }

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--border); padding: 1.75rem 0 2rem; margin-top: 3rem;
  background: linear-gradient(180deg, transparent, rgba(7,11,24,.8));
}
.footer-content { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; color: var(--text-secondary); font-size: .92rem; }
.footer a { color: var(--text-secondary); text-decoration: none; transition: color .2s ease; }
.footer a:hover { color: var(--primary); }

/* ============ RESULTADOS / CARDS DINÁMICAS ============ */
#resultado { animation: heroIn .5s ease both; }
#resultado h2 { margin-top: 1.5rem; }
#resultado .card { animation: heroIn .5s ease both; }

/* reveal on scroll */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.4,0,.2,1); }
.rv.in { opacity: 1; transform: none; }

/* scroll up / active nav */
.nav-links a.active { color: #fff; background: var(--primary-soft); border: 1px solid rgba(34,197,94,.3); }

/* ============ RESPONSIVE ============ */
@media (max-width: 720px) {
  .nav { flex-wrap: wrap; justify-content: center; }
  .nav-links { justify-content: center; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .footer-content { flex-direction: column; text-align: center; }
}

@media print {
  .header, .footer, .btn:not(#btnImprimir), .controls { display: none !important; }
  body { background: #fff !important; color: #000; }
  .card { box-shadow: none; border-color: #ccc; }
}