/* ==========================================================================
   Base: reinicio, tipografía, foco y animaciones compartidas
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  font-size: 100%;
  font-weight: 420;
  line-height: var(--lh-body);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-kerning: normal;
  font-optical-sizing: auto;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 520px at 85% -10%, var(--c-bg-glow), transparent 60%),
    radial-gradient(900px 480px at -10% 110%, var(--c-bg-glow), transparent 60%),
    var(--c-bg);
  background-attachment: fixed;
  font-size: var(--fs-base);
  transition: background-color var(--dur-3) var(--ease-out), color var(--dur-3) var(--ease-out);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

p {
  margin: 0 0 var(--sp-3);
  text-wrap: pretty;
}

a {
  color: var(--c-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: color var(--dur-1) var(--ease-out), text-decoration-color var(--dur-1) var(--ease-out);
}
a:hover {
  color: var(--c-accent-hover);
  text-decoration-color: currentColor;
}

strong,
b {
  font-weight: 600;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-variant-ligatures: none;
}

code {
  padding: 0.12em 0.42em;
  border-radius: var(--r-xs);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  overflow-wrap: anywhere;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.7em;
  height: 1.7em;
  padding: 0 0.45em;
  border-radius: 6px;
  border: 1px solid var(--c-border-strong);
  border-bottom-width: 2px;
  background: var(--c-surface);
  color: var(--c-muted);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
}

img,
svg {
  max-width: 100%;
}

svg.icon {
  flex: none;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: color-mix(in srgb, var(--c-accent) 26%, transparent);
}

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Cifras: siempre tabulares para que las columnas y los contadores no bailen. */
.num,
.kpi-value,
.ring-pct,
.plan-price,
td.num,
th.num,
.chart-axis,
.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.muted {
  color: var(--c-muted);
}
.small {
  font-size: var(--fs-sm);
}
.nowrap {
  white-space: nowrap;
}
.truncate {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.break {
  word-break: break-all;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

/* ---------- Animaciones compartidas ---------- */

@keyframes hm-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes hm-fade {
  from {
    opacity: 0;
  }
}

@keyframes hm-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.965);
  }
}

@keyframes hm-sheet {
  from {
    transform: translateY(100%);
  }
}

@keyframes hm-spin {
  to {
    --hm-angle: 360deg;
  }
}

@keyframes hm-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes hm-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@keyframes hm-rotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes hm-draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes hm-grow {
  from {
    transform: scaleY(0);
  }
}

@keyframes hm-pulse {
  50% {
    opacity: 0.55;
    transform: scale(0.96);
  }
}
