/* =============================================================
   Shortly — sistema de diseño único
   1. Tokens  2. Reset  3. Utilidades  4. Tipografía  5. Botones
   6. Formularios  7. Nav  8. Hero + tool-card  9. Resultado
   10. Features  11. Dashboard mockup (landing)  12. Tráfico
   13. Pricing  14. FAQ  15. Footer  16. Toasts  17. Modales
   18. App shell (dashboard real)  19. Tablas  20. Auth
   21. API  22. QR  23. Ads  24. Legal  25. Redirect
   26. Responsive globals  27. Reduced motion
   ============================================================= */

/* ===================== 1. TOKENS ===================== */
:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --text: #0F172A;
  --muted: #64748B;
  --muted-2: #94A3B8;
  --line: #E2E8F0;
  --line-2: #EDF1F5;

  --accent: #6366F1;
  --accent-2: #8B5CF6;
  --accent-dark: #4F46E5;
  --accent-light: #EEF2FF;
  --accent-ring: rgba(99, 102, 241, .18);

  --success: #16A34A;
  --success-light: #F0FDF4;
  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --warning: #D97706;
  --warning-light: #FFFBEB;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 4px 16px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, .10), 0 4px 12px rgba(15, 23, 42, .05);
  --shadow-glow: 0 8px 30px rgba(99, 102, 241, .22);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --nav-h: 72px;
  --container: 1220px;
}

/* ===================== 2. RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; }
ul, ol { list-style: none; padding: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .7rem 1.1rem; background: var(--text); color: #fff;
  border-radius: var(--radius-sm); font-weight: 600; transition: top .25s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* ===================== 3. UTILIDADES ===================== */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section-head { max-width: 640px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--accent-dark);
  background: var(--accent-light); padding: .35rem .75rem; border-radius: var(--radius-full); margin-bottom: 1rem;
}
.section-title { font-size: clamp(1.7rem, 3.2vw, 2.5rem); margin-bottom: .75rem; }
.section-sub { color: var(--muted); font-size: 1.05rem; max-width: 56ch; }
.badge {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600;
  padding: .3rem .65rem; border-radius: var(--radius-full); border: 1px solid var(--line);
}
.badge.is-success { background: var(--success-light); color: var(--success); border-color: transparent; }
.badge.is-danger { background: var(--danger-light); color: var(--danger); border-color: transparent; }
.badge.is-muted { background: var(--surface-2); color: var(--muted); border-color: transparent; }
.badge.is-accent { background: var(--accent-light); color: var(--accent-dark); border-color: transparent; }
.divider { height: 1px; background: var(--line); border: 0; }
.icon { width: 1em; height: 1em; flex-shrink: 0; }
.stack { display: flex; flex-direction: column; }
.hstack { display: flex; align-items: center; }

/* ===================== 4. TIPOGRAFÍA ===================== */
.gradient-text {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: 1.15rem; color: var(--muted); }
code, .mono { font-family: var(--mono); }

/* ===================== 5. BOTONES ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.3rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .95rem;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s var(--ease-out), border-color .18s var(--ease-out), color .18s var(--ease-out);
  white-space: nowrap; line-height: 1.2; min-height: 44px;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 10px 34px rgba(99,102,241,.32); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: #FEE2E2; }
.btn-sm { padding: .5rem .9rem; font-size: .85rem; min-height: 36px; border-radius: var(--radius-sm); }
.btn-lg { padding: .95rem 1.7rem; font-size: 1.02rem; min-height: 52px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: .55rem; min-height: 40px; min-width: 40px; border-radius: var(--radius-sm); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.link-arrow { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--accent-dark); }
.link-arrow .icon { transition: transform .2s var(--ease-out); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ===================== 6. FORMULARIOS ===================== */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.field-label { font-size: .85rem; font-weight: 600; color: var(--text); }
.field-hint { font-size: .8rem; color: var(--muted); }
.field-error { font-size: .8rem; color: var(--danger); font-weight: 500; display: none; }
.field.has-error .field-error { display: block; }
.field.has-error .input, .field.has-error .textarea { border-color: var(--danger); background: var(--danger-light); }
.input, .textarea, .select {
  width: 100%; padding: .8rem .95rem; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--surface); font-size: .95rem; transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.textarea { resize: vertical; min-height: 90px; }
.checkbox-row { display: flex; align-items: center; gap: .55rem; font-size: .9rem; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.input-group { position: relative; }
.input-group .input { padding-right: 2.6rem; }
.input-group-icon { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.prefix-input { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out); }
.prefix-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.prefix-input .prefix { display: flex; align-items: center; padding-inline: .9rem; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: .9rem; border-right: 1px solid var(--line); }
.prefix-input input { border: 0; flex: 1; min-width: 0; padding: .8rem .8rem; background: transparent; }
.prefix-input input:focus { outline: none; }
.avail-msg { font-size: .8rem; font-weight: 600; margin-top: .35rem; display: none; align-items: center; gap: .3rem; }
.avail-msg.is-ok { display: flex; color: var(--success); }
.avail-msg.is-bad { display: flex; color: var(--danger); }

/* ===================== 7. NAV ===================== */
.nav { position: sticky; top: 0; z-index: 100; height: var(--nav-h); background: rgba(248,250,252,.82); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); border-bottom: 1px solid var(--line-2); }
@supports not (backdrop-filter: blur(1px)) { .nav { background: var(--bg); } }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; flex-shrink: 0; }
.nav-logo-icon { width: 30px; height: 30px; color: var(--accent); }
.nav-links { display: none; align-items: center; gap: 1.9rem; }
.nav-links a { font-size: .92rem; font-weight: 500; color: var(--muted); transition: color .18s var(--ease-out); }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: none; align-items: center; gap: .7rem; }
.nav-burger { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 42px; align-items: center; border-radius: var(--radius-sm); }
.nav-burger:hover { background: var(--surface-2); }
.nav-burger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s var(--ease-out), opacity .25s var(--ease-out); }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-mobile { display: none; position: fixed; inset: var(--nav-h) 0 0 0; background: var(--bg); z-index: 99; padding: 1.25rem; overflow-y: auto; }
.nav-mobile.is-open { display: block; animation: fadeInUp .25s var(--ease-out); }
.nav-mobile a { display: block; padding: .95rem .25rem; font-size: 1.05rem; font-weight: 600; border-bottom: 1px solid var(--line-2); }
.nav-mobile .nav-mobile-actions { margin-top: 1.5rem; display: flex; flex-direction: column; gap: .7rem; }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-actions { display: flex; }
  .nav-burger { display: none; }
}

/* ===================== 8. HERO + TOOL CARD ===================== */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2rem, 5vw, 3.5rem); position: relative; }
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 620px;
  background: radial-gradient(60% 60% at 50% 20%, rgba(99,102,241,.14), transparent 70%),
              radial-gradient(40% 40% at 80% 10%, rgba(139,92,246,.12), transparent 70%);
  filter: blur(10px);
}
.hero-inner { text-align: center; max-width: 780px; margin-inline: auto; }
.hero-title { font-size: clamp(2.3rem, 5.4vw, 3.9rem); margin-bottom: 1.1rem; max-width: 20ch; margin-inline: auto; }
.hero-sub { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 52ch; margin-inline: auto; }
.hero-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.4rem; margin-top: 1.6rem; color: var(--muted-2); font-size: .85rem; }
.hero-trust span { display: inline-flex; align-items: center; gap: .4rem; }
.hero-trust .icon { width: 16px; height: 16px; color: var(--success); }

.tool-card {
  max-width: 700px; margin: 2.6rem auto 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(1.25rem, 3vw, 2rem);
}
.tool-tabs { display: flex; gap: .4rem; margin-bottom: 1.1rem; background: var(--surface-2); padding: .3rem; border-radius: var(--radius-sm); }
.tool-tab { flex: 1; padding: .55rem .5rem; border-radius: 7px; font-size: .85rem; font-weight: 600; color: var(--muted); transition: all .18s var(--ease-out); }
.tool-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.shorten-form { display: flex; flex-direction: column; gap: .7rem; }
.shorten-row { display: flex; gap: .6rem; flex-direction: column; }
.shorten-input-wrap { position: relative; flex: 1; }
.shorten-input {
  width: 100%; padding: 1rem 1.1rem; border-radius: 12px; border: 1.5px solid var(--line); font-size: 1rem;
  background: var(--surface-2); transition: border-color .18s var(--ease-out), background .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.shorten-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-ring); }
.shorten-input.has-error { border-color: var(--danger); background: var(--danger-light); }
.shorten-msg { font-size: .82rem; color: var(--danger); font-weight: 500; min-height: 1.1em; display: none; }
.shorten-msg.is-visible { display: block; }

.tool-options { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
.option-toggle {
  display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .85rem; border-radius: var(--radius-full);
  border: 1.5px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--surface);
  transition: all .18s var(--ease-out);
}
.option-toggle:hover { border-color: var(--accent); color: var(--accent-dark); }
.option-toggle.is-active { background: var(--accent-light); border-color: var(--accent); color: var(--accent-dark); }
.option-toggle .icon { width: 16px; height: 16px; }

.custom-panel { display: none; margin-top: .9rem; padding-top: .9rem; border-top: 1px dashed var(--line); }
.custom-panel.is-open { display: block; animation: fadeInUp .3s var(--ease-out); }
.advanced-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; margin-top: .5rem; }

.tool-submit { margin-top: .3rem; }

/* Estado de carga elegante */
.processing { display: none; align-items: center; gap: .8rem; justify-content: center; padding: 1.4rem 0; color: var(--muted); font-weight: 500; }
.processing.is-visible { display: flex; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--accent-light); border-top-color: var(--accent); animation: spin .7s linear infinite; }

/* ===================== 9. RESULTADO ===================== */
.result-card { display: none; margin-top: 1.4rem; padding: 1.5rem; border-radius: var(--radius); background: linear-gradient(180deg, var(--accent-light), var(--surface) 55%); border: 1px solid var(--accent-ring); }
.result-card.is-visible { display: block; animation: resultIn .5s var(--ease-out); }
@keyframes resultIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.result-head { display: flex; align-items: center; gap: .5rem; color: var(--success); font-weight: 700; font-size: .92rem; margin-bottom: .9rem; }
.result-head .icon { width: 20px; height: 20px; }
.result-url-row { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .3rem .3rem .3rem 1rem; flex-wrap: wrap; }
.result-url { font-weight: 700; font-size: 1.05rem; color: var(--accent-dark); word-break: break-all; flex: 1; min-width: 160px; }
.result-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.result-original { margin-top: .9rem; font-size: .85rem; color: var(--muted); word-break: break-all; }
.result-original strong { color: var(--text); font-weight: 600; }
.result-meta { margin-top: .35rem; font-size: .8rem; color: var(--muted-2); }
.copied-pill {
  position: absolute; top: -2.2rem; right: 0; background: var(--text); color: #fff; font-size: .78rem; font-weight: 600;
  padding: .35rem .7rem; border-radius: var(--radius-full); opacity: 0; transform: translateY(4px); transition: all .22s var(--ease-out); pointer-events: none;
}
.copied-pill.is-visible { opacity: 1; transform: translateY(0); }
.copy-btn-wrap { position: relative; }

/* ===================== 10. FEATURES ===================== */
.features-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
.feature-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out), border-color .22s var(--ease-out); }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.feature-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-light); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 1.08rem; margin-bottom: .45rem; }
.feature-card p { color: var(--muted); font-size: .92rem; }

/* ===================== 11. DASHBOARD MOCKUP (landing) ===================== */
.mockup-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(1.1rem, 3vw, 2rem); }
.mockup-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.mockup-head h3 { font-size: 1.1rem; }
.range-tabs { display: flex; gap: .3rem; background: var(--surface-2); padding: .25rem; border-radius: var(--radius-sm); }
.range-tab { padding: .4rem .7rem; font-size: .78rem; font-weight: 600; color: var(--muted); border-radius: 6px; }
.range-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; margin-bottom: 1.5rem; }
.metric-tile { background: var(--surface-2); border-radius: var(--radius); padding: 1rem 1.1rem; }
.metric-tile .metric-label { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: .3rem; }
.metric-tile .metric-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.metric-tile .metric-delta { font-size: .76rem; font-weight: 700; color: var(--success); margin-top: .25rem; display: inline-flex; align-items: center; gap: .2rem; }
.metric-tile .metric-delta.is-down { color: var(--danger); }

.chart-wrap { position: relative; width: 100%; height: clamp(160px, 26vw, 240px); margin-bottom: 1.6rem; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#chartGradient); opacity: .9; }
.chart-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart-grid line { stroke: var(--line-2); stroke-width: 1; }
.chart-axis-label { font-size: 10px; fill: var(--muted-2); font-family: var(--sans); }

.analytics-cols { display: grid; gap: 1.6rem; grid-template-columns: 1fr; }
.analytics-block h4 { font-size: .92rem; margin-bottom: 1rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: .74rem; }
.country-row { display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem; font-size: .88rem; }
.country-flag { font-size: 1.15rem; width: 1.4em; text-align: center; }
.country-name { width: 108px; flex-shrink: 0; font-weight: 500; }
.country-bar-track { flex: 1; height: 8px; border-radius: var(--radius-full); background: var(--surface-2); overflow: hidden; }
.country-bar-fill { height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1s var(--ease-out); }
.country-pct { width: 38px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.donut-wrap { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.donut { width: 148px; height: 148px; border-radius: 50%; flex-shrink: 0; position: relative; }
.donut::after { content: ""; position: absolute; inset: 22%; background: var(--surface); border-radius: 50%; }
.donut-legend { display: flex; flex-direction: column; gap: .6rem; flex: 1; min-width: 140px; }
.donut-legend-item { display: flex; align-items: center; gap: .55rem; font-size: .88rem; }
.donut-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.donut-legend-item .name { flex: 1; font-weight: 500; }
.donut-legend-item .pct { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ===================== 12. FUENTES DE TRÁFICO ===================== */
.traffic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.traffic-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem; display: flex; align-items: center; gap: .8rem; transition: box-shadow .2s var(--ease-out), transform .2s var(--ease-out); }
.traffic-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.traffic-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.traffic-icon svg { width: 19px; height: 19px; color: var(--accent-dark); }
.traffic-name { font-weight: 700; font-size: .92rem; }
.traffic-stat { font-size: .78rem; color: var(--muted); }
.traffic-pct { margin-left: auto; font-weight: 800; font-size: 1rem; color: var(--accent-dark); }

/* ===================== 13. PRICING ===================== */
.pricing-grid { display: grid; gap: 1.3rem; grid-template-columns: 1fr; align-items: start; }
.price-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 1.9rem; position: relative; transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out); }
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.price-card.is-featured { border-color: var(--accent); box-shadow: var(--shadow-lg); background: linear-gradient(180deg, var(--accent-light) 0%, var(--surface) 22%); }
.price-popular { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: .74rem; font-weight: 700; padding: .3rem .8rem; border-radius: var(--radius-full); box-shadow: var(--shadow-glow); white-space: nowrap; }
.price-name { font-weight: 700; font-size: 1.05rem; margin-bottom: .3rem; }
.price-value { display: flex; align-items: baseline; gap: .3rem; margin: .6rem 0 .3rem; }
.price-amount { font-size: 2.5rem; font-weight: 800; letter-spacing: -.02em; }
.price-period { color: var(--muted); font-size: .9rem; }
.price-desc { color: var(--muted); font-size: .88rem; margin-bottom: 1.3rem; }
.price-features { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1.6rem; }
.price-features li { display: flex; align-items: flex-start; gap: .55rem; font-size: .89rem; }
.price-features .icon { width: 17px; height: 17px; color: var(--success); flex-shrink: 0; margin-top: .15rem; }

/* ===================== 14. FAQ ===================== */
.faq { max-width: 760px; margin-inline: auto; display: flex; flex-direction: column; gap: .7rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .3rem 1.2rem; transition: border-color .2s var(--ease-out); }
.faq details[open] { border-color: var(--accent); }
.faq summary { cursor: pointer; list-style: none; padding: 1.05rem 0; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent); font-weight: 400; flex-shrink: 0; transition: transform .25s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { padding-bottom: 1.1rem; color: var(--muted); font-size: .92rem; max-width: 62ch; }

/* ===================== 15. FOOTER ===================== */
.more-tools-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1.6rem; }
.more-tool-card { display: block; padding: 1.1rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .2s var(--ease-out), transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.more-tool-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.more-tool-name { display: block; font-weight: 700; margin-bottom: .3rem; }
.more-tool-desc { display: block; font-size: .85rem; color: var(--muted); }
.more-tool-card.is-self { border-color: var(--accent); background: var(--accent-light); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }
.footer-top { padding-block: clamp(2.5rem, 5vw, 3.5rem) 2rem; }
.footer-grid { display: grid; gap: 2.2rem; grid-template-columns: 1fr; }
.footer-brand p { color: var(--muted); font-size: .88rem; margin-top: .6rem; max-width: 26ch; }
.footer-col h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); margin-bottom: 1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: .65rem; }
.footer-col a { font-size: .9rem; color: var(--muted); transition: color .18s var(--ease-out); }
.footer-col a:hover { color: var(--accent-dark); }
.footer-social { display: flex; gap: .6rem; margin-top: .3rem; }
.footer-social a { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--surface-2); display: flex; align-items: center; justify-content: center; transition: background .18s var(--ease-out), color .18s var(--ease-out); }
.footer-social a:hover { background: var(--accent-light); color: var(--accent-dark); }
.footer-social svg { width: 17px; height: 17px; }
.footer-more { padding-block: 2.2rem; border-top: 1px solid var(--line-2); }
.footer-more h4 { font-size: 1.1rem; margin-bottom: .3rem; }
.footer-more p.footer-more-sub { color: var(--muted); font-size: .88rem; margin-bottom: 0; }
.footer-bottom { padding-block: 1.4rem; border-top: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--muted-2); }
.footer-legal-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.footer-legal-links a:hover { color: var(--accent-dark); }

/* ===================== 16. TOASTS ===================== */
.toast-region { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: .5rem; align-items: center; width: min(92vw, 380px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: .55rem; background: var(--text); color: #fff; padding: .8rem 1.1rem; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px); transition: all .3s var(--ease-out); pointer-events: auto; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast .icon { width: 17px; height: 17px; flex-shrink: 0; color: #4ADE80; }
.toast.is-error .icon { color: #FCA5A5; }

/* ===================== 17. MODALES ===================== */
dialog.modal { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(92vw, 560px); box-shadow: var(--shadow-lg); background: var(--surface); overflow: visible; margin: auto; max-height: min(88vh, 720px); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); animation: fadeIn .2s var(--ease-out); }
dialog.modal[open] { animation: modalIn .28s var(--ease-out); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-scroll { max-height: min(88vh, 720px); overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.5rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; z-index: 1; }
.modal-head h3 { font-size: 1.1rem; }
.modal-close { width: 34px; height: 34px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; background: var(--surface-2); flex-shrink: 0; }
.modal-close:hover { background: var(--line); }
.modal-body { padding: 1.5rem; }
.modal-foot { padding: 1.1rem 1.5rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .6rem; position: sticky; bottom: 0; background: var(--surface); }
.modal-tools-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.qr-preview-box { display: flex; align-items: center; justify-content: center; padding: 1.6rem; background: var(--surface-2); border-radius: var(--radius); margin-bottom: 1.2rem; }
.qr-preview-box canvas, .qr-preview-box img { border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.qr-size-row { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ===================== 18. APP SHELL (dashboard real) ===================== */
.app-shell { min-height: 100svh; display: flex; }
.app-sidebar {
  position: fixed; inset: 0 auto 0 0; width: 264px; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 90; transform: translateX(-100%); transition: transform .28s var(--ease-out);
}
.app-sidebar.is-open { transform: translateX(0); }
.app-sidebar-head { padding: 1.3rem 1.4rem; border-bottom: 1px solid var(--line-2); }
.app-nav { flex: 1; overflow-y: auto; padding: 1rem .9rem; display: flex; flex-direction: column; gap: .2rem; }
.app-nav-link { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: var(--radius-sm); font-weight: 500; font-size: .92rem; color: var(--muted); transition: background .16s var(--ease-out), color .16s var(--ease-out); }
.app-nav-link:hover { background: var(--surface-2); color: var(--text); }
.app-nav-link.is-active { background: var(--accent-light); color: var(--accent-dark); font-weight: 700; }
.app-nav-link .icon { width: 19px; height: 19px; flex-shrink: 0; }
.app-sidebar-foot { padding: 1rem 1.4rem; border-top: 1px solid var(--line-2); }
.plan-card { background: var(--accent-light); border-radius: var(--radius); padding: 1rem; }
.plan-card p { font-size: .8rem; color: var(--accent-dark); margin-bottom: .6rem; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 89; display: none; }
.sidebar-overlay.is-visible { display: block; animation: fadeIn .2s var(--ease-out); }

.app-main { flex: 1; min-width: 0; width: 100%; }
.app-topbar { height: 68px; position: sticky; top: 0; z-index: 60; background: rgba(248,250,252,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 1rem; padding-inline: 1.2rem; }
.app-content { padding: 1.4rem 1.2rem clamp(3rem, 6vw, 4rem); max-width: 1180px; }
.app-greeting h1 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
.app-greeting p { color: var(--muted); margin-top: .25rem; font-size: .92rem; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; margin: 1.6rem 0; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; }
.stat-card .stat-label { font-size: .78rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.stat-card .stat-label .icon { width: 15px; height: 15px; }
.stat-card .stat-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin-top: .35rem; }
.stat-card .stat-delta { font-size: .78rem; font-weight: 700; color: var(--success); margin-top: .3rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.panel-head { padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.02rem; }

.toolbar { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; padding: 1rem 1.3rem; border-bottom: 1px solid var(--line-2); }
.search-box { position: relative; flex: 1; min-width: 180px; }
.search-box input { padding-left: 2.4rem; }
.search-box .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); }
.filter-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.filter-chip { padding: .5rem .85rem; border-radius: var(--radius-full); font-size: .82rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); }
.filter-chip.is-active { background: var(--text); color: #fff; border-color: var(--text); }

/* ===================== 19. TABLAS ===================== */
.table-wrap { overflow-x: auto; }
table.links-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.links-table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); font-weight: 700; padding: .8rem 1.3rem; border-bottom: 1px solid var(--line); }
.links-table td { padding: 1rem 1.3rem; border-bottom: 1px solid var(--line-2); font-size: .9rem; vertical-align: middle; }
.links-table tr:last-child td { border-bottom: 0; }
.links-table tbody tr { transition: background .15s var(--ease-out); }
.links-table tbody tr:hover { background: var(--surface-2); }
.link-cell .short { font-weight: 700; color: var(--accent-dark); display: block; }
.link-cell .orig { font-size: .8rem; color: var(--muted); display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: .15rem; }
.row-actions { display: flex; gap: .3rem; justify-content: flex-end; }
.empty-state { padding: 3.5rem 1.5rem; text-align: center; color: var(--muted); }
.empty-state .icon { width: 44px; height: 44px; color: var(--muted-2); margin: 0 auto 1rem; }

/* Cards móviles para la tabla */
.links-cards { display: none; flex-direction: column; gap: .8rem; padding: 1rem 1.1rem; }
.link-mobile-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; background: var(--surface); }
.link-mobile-card .lmc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .7rem; }
.link-mobile-card .short { font-weight: 700; color: var(--accent-dark); }
.link-mobile-card .orig { font-size: .82rem; color: var(--muted); margin-top: .25rem; word-break: break-all; }
.link-mobile-card .lmc-meta { display: flex; gap: 1rem; margin-top: .8rem; font-size: .8rem; color: var(--muted); }
.link-mobile-card .lmc-actions { display: flex; gap: .4rem; margin-top: .9rem; flex-wrap: wrap; }

@media (max-width: 719px) {
  .table-wrap { display: none; }
  .links-cards { display: flex; }
}

/* ===================== 20. AUTH ===================== */
.auth-wrap { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; position: relative; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(1.6rem, 4vw, 2.4rem); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 1.4rem; }
.auth-title { text-align: center; font-size: 1.5rem; margin-bottom: .4rem; }
.auth-sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.8rem; }
.auth-divider { display: flex; align-items: center; gap: .8rem; margin: 1.3rem 0; color: var(--muted-2); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; }
.auth-foot { text-align: center; margin-top: 1.5rem; font-size: .88rem; color: var(--muted); }
.auth-foot a { color: var(--accent-dark); font-weight: 600; }
.auth-back { position: absolute; top: 1.5rem; left: 1.5rem; }

/* ===================== 21. API ===================== */
.code-card { background: #0F172A; color: #E2E8F0; border-radius: var(--radius); padding: 1.3rem 1.4rem; font-family: var(--mono); font-size: .84rem; overflow-x: auto; position: relative; line-height: 1.65; }
.code-card .tok-key { color: #93C5FD; }
.code-card .tok-str { color: #86EFAC; }
.code-card .tok-comment { color: #64748B; }
.code-card .tok-method { color: #FCA5A5; font-weight: 700; }
.code-copy { position: absolute; top: .9rem; right: .9rem; background: rgba(255,255,255,.08); color: #fff; padding: .4rem .7rem; border-radius: var(--radius-sm); font-size: .78rem; font-weight: 600; font-family: var(--sans); }
.code-copy:hover { background: rgba(255,255,255,.16); }
.api-endpoint-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.method-tag { font-family: var(--mono); font-size: .78rem; font-weight: 700; padding: .25rem .6rem; border-radius: var(--radius-sm); }
.method-tag.post { background: #DBEAFE; color: #1D4ED8; }
.method-tag.get { background: var(--success-light); color: var(--success); }
.method-tag.delete { background: var(--danger-light); color: var(--danger); }
.api-section { margin-bottom: 2.6rem; }
.api-section h3 { font-size: 1.15rem; margin-bottom: .8rem; }
.limits-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.limits-table th, .limits-table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.limits-table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; }

/* ===================== 22. QR ===================== */
.qr-download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1rem; }

/* ===================== 23. ADS ===================== */
.ad-slot { border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted-2); font-size: .78rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; margin-block: 2.2rem; min-height: 100px; }
.ad-slot.leaderboard { min-height: 90px; }
.ad-slot.incontent { min-height: 250px; }

/* ===================== 24. LEGAL ===================== */
.legal-page { padding-block: clamp(2.5rem, 5vw, 4rem) 5rem; }
.legal-content { max-width: 760px; margin-inline: auto; }
.legal-content h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: .5rem; }
.legal-updated { color: var(--muted); font-size: .88rem; margin-bottom: 2.2rem; }
.legal-content h2 { font-size: 1.2rem; margin-top: 2rem; margin-bottom: .7rem; }
.legal-content p, .legal-content li { color: var(--muted); font-size: .95rem; margin-bottom: .9rem; }
.legal-content ul { list-style: disc; padding-left: 1.3rem; }
.legal-content ul li { margin-bottom: .5rem; }
.legal-content a { color: var(--accent-dark); font-weight: 600; }

/* ===================== 25. REDIRECT ===================== */
.redirect-screen { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 2rem; text-align: center; }
.redirect-box { max-width: 380px; }
.redirect-spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--accent-light); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 0 auto 1.4rem; }
.redirect-box h1 { font-size: 1.2rem; margin-bottom: .5rem; }
.redirect-box p { color: var(--muted); font-size: .9rem; word-break: break-all; }
.redirect-box .redirect-dest { font-weight: 600; color: var(--text); margin-top: .4rem; }

/* ===================== KEYFRAMES ===================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes skeletonPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.skeleton { background: var(--surface-2); border-radius: var(--radius-sm); animation: skeletonPulse 1.4s ease-in-out infinite; }

/* Reveal on scroll (below-the-fold only) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* ===================== 26. RESPONSIVE GLOBALS ===================== */
@media (min-width: 540px) {
  .shorten-row { flex-direction: row; }
  .traffic-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .metric-grid { grid-template-columns: repeat(4, 1fr); }
  .qr-download-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .more-tools-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
  .price-card.is-featured { transform: scale(1.03); }
  .advanced-grid { grid-template-columns: 1fr 1fr; }
  .app-content { padding-inline: 2rem; }
}
@media (min-width: 960px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
  .analytics-cols { grid-template-columns: 1fr 1fr; }
  .app-sidebar { transform: translateX(0); position: sticky; top: 0; height: 100svh; }
  .app-topbar .app-sidebar-toggle { display: none; }
  .sidebar-overlay { display: none !important; }
  .app-content { padding-inline: 2.6rem; }
  .more-tools-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
  .container { padding-inline: 2rem; }
  .more-tools-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===================== 27. REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  .hero-bg::before { animation: none; }
}
