/* ==========================================================================
   RELEVANZIA · Sistema de diseño v2.1 — Fucsia & Negro (colores extraídos de logos/logo.png)
   Tokens + componentes. Reutilizable en la web y cualquier soporte digital.
   Tipografía web: Space Grotesk (local, assets/fonts, licencia OFL) · logotipo: logos/logo.png
   Pesos: 600 titulares · 400 todo lo demás
   Fondo blanco liso · tema oscuro opcional con [data-theme="dark"]
   ========================================================================== */

/* ---------- 0a. Space Grotesk (variable 300–700, alojada en local) ---------- */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/SpaceGrotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/SpaceGrotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 0. Propiedades registradas (permiten animar gradientes) ---------- */
@property --rz-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --rz-shine { syntax: "<percentage>"; inherits: false; initial-value: -30%; }

/* ---------- 1. Tokens de marca ---------- */
:root {
  /* Negros «tinta» */
  --rz-tinta: #020101;            /* negro del logo */
  --rz-carbon: #0F0E0E;
  --rz-grafito: #1A1919;
  --rz-pizarra: #2A2828;
  --rz-humo: #A3A0A0;
  --rz-niebla: #F7F6F6;
  --rz-blanco: #FFFFFF;

  /* Fucsia */
  --rz-fucsia: #EE0478;           /* fucsia del logo */
  --rz-fucsia-luz: #FF3D97;       /* derivado: texto fucsia sobre oscuro */
  --rz-fucsia-hondo: #B8035C;     /* derivado: texto fucsia sobre claro */
  --rz-fucsia-tinte: #FDE6F1;     /* derivado: fondos suaves */

  /* Estados */
  --rz-verde: #1E9E6E;
  --rz-ambar: #D9901A;
  --rz-rojo: #E0484E;
  --rz-azul: #3B74E8;

  /* Degradado de firma */
  --rz-gradient: linear-gradient(115deg, var(--rz-fucsia-luz) 0%, var(--rz-fucsia) 50%, var(--rz-fucsia-hondo) 100%);

  /* Tipografía */
  --rz-font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --rz-font-logo: Georgia, "Times New Roman", serif;   /* solo referencia: el logo va en trazados */
  --rz-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --rz-fs-2xs: .72rem;
  --rz-fs-xs: .8rem;
  --rz-fs-sm: .9rem;
  --rz-fs-base: 1.0625rem;
  --rz-fs-lg: 1.25rem;
  --rz-fs-h4: 1.5rem;
  --rz-fs-h3: 1.9rem;
  --rz-fs-h2: clamp(2rem, 4vw, 2.6rem);
  --rz-fs-h1: clamp(2.4rem, 5.5vw, 3.4rem);
  --rz-fs-display: clamp(2.8rem, 7.5vw, 5.6rem);

  /* Forma: curvas sutiles + «esquina firma» (una esquina casi recta) */
  --rz-r-xs: 4px;
  --rz-r-sm: 8px;
  --rz-r-md: 12px;
  --rz-r-lg: 16px;
  --rz-r-xl: 24px;
  --rz-r-firma: 16px 16px 16px 4px;
  --rz-r-firma-lg: 24px 24px 24px 6px;
  --rz-line: 1.5px;               /* grosor de líneas e iconos */

  /* Espaciado (base 4px) */
  --rz-s-1: 4px;  --rz-s-2: 8px;  --rz-s-3: 12px; --rz-s-4: 16px;
  --rz-s-5: 24px; --rz-s-6: 32px; --rz-s-7: 48px; --rz-s-8: 64px; --rz-s-9: 96px;

  /* Movimiento */
  --rz-ease: cubic-bezier(.2, .8, .2, 1);
  --rz-ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --rz-spring: cubic-bezier(.34, 1.56, .64, 1);
  --rz-dur-fast: .16s;
  --rz-dur: .28s;
  --rz-dur-slow: .6s;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --rz-spring: linear(0, .009, .035 2.1%, .141 4.4%, .281 6.7%, .723 12.9%, .938 16.7%, 1.017, 1.077 20.4%, 1.121, 1.149 24.3%, 1.159, 1.163 27%, 1.154, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1);
  }
}

/* ---------- 2. Tema claro (por defecto) ---------- */
:root, :root[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-soft: var(--rz-niebla);
  --surface: #FFFFFF;
  --surface-2: #F1F0F0;
  --surface-3: #E7E5E5;
  --line: rgba(2, 1, 1, .08);
  --line-strong: rgba(2, 1, 1, .16);
  --text: var(--rz-tinta);
  --text-muted: #6B6767;
  --primary: var(--rz-fucsia);
  --primary-hover: #FF2A8E;
  --primary-text: var(--rz-fucsia-hondo);
  --primary-soft: var(--rz-fucsia-tinte);
  --on-primary: var(--rz-tinta);  /* negro sobre fucsia: 4,9:1 AA */
  --success: var(--rz-verde); --warning: #B9760C; --danger: #D23A40; --info: var(--rz-azul);
  --glow: 0 0 0 1px rgba(238, 4, 120, .3), 0 10px 30px -12px rgba(238, 4, 120, .45);
  --shadow: 0 1px 2px rgba(2, 1, 1, .05), 0 12px 32px -14px rgba(2, 1, 1, .18);
  --focus: 0 0 0 3px rgba(238, 4, 120, .25);
  --grain-opacity: 0;
  color-scheme: light;
}

/* ---------- 3. Tema oscuro (y bloques .theme-ink, siempre oscuros) ---------- */
:root[data-theme="dark"], .theme-ink {
  --bg: var(--rz-tinta);
  --bg-soft: var(--rz-carbon);
  --surface: #121111;
  --surface-2: var(--rz-grafito);
  --surface-3: #262424;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #F5F4F4;
  --text-muted: var(--rz-humo);
  --primary: var(--rz-fucsia);
  --primary-hover: #FF2A8E;
  --primary-text: var(--rz-fucsia-luz);
  --primary-soft: rgba(238, 4, 120, .14);
  --on-primary: var(--rz-tinta);  /* negro sobre fucsia: 4,9:1 AA */
  --success: #3CC08E; --warning: #EDAA3A; --danger: #F0686D; --info: #6E9BF5;
  --glow: 0 0 0 1px rgba(255, 61, 151, .35), 0 10px 34px -10px rgba(238, 4, 120, .6);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 32px -12px rgba(0, 0, 0, .7);
  --focus: 0 0 0 3px rgba(255, 61, 151, .35);
  --grain-opacity: .045;
  color-scheme: dark;
}

/* ---------- 4. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--rz-fs-base)/1.6 var(--rz-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Grano sutil sobre toda la página */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--rz-fucsia); color: var(--rz-tinta); }
h1, h2, h3, h4, h5, h6, .display {
  font-family: var(--rz-font);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.025em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: var(--rz-fs-h1); }
h2 { font-size: var(--rz-fs-h2); }
h3 { font-size: var(--rz-fs-h3); }
h4 { font-size: var(--rz-fs-h4); }
h5 { font-size: var(--rz-fs-lg); }
h6 { font-size: var(--rz-fs-base); }
.display { font-size: var(--rz-fs-display); letter-spacing: -.045em; line-height: .98; }
p { margin: 0 0 1em; text-wrap: pretty; }
b, strong { font-weight: 400; color: var(--text); }
em { font-style: normal; color: var(--primary-text); }   /* Space Grotesk no tiene cursiva: el énfasis va en color */
.lead { font-size: var(--rz-fs-lg); color: var(--text-muted); line-height: 1.55; }
small, .small { font-size: var(--rz-fs-sm); }
.muted { color: var(--text-muted); }
.mono, .eyebrow, .badge, .kbd, code { font-family: var(--rz-font-mono); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-size: var(--rz-fs-2xs); letter-spacing: .14em; text-transform: uppercase;
  color: var(--primary-text);
}
.eyebrow::before { content: ""; width: 18px; height: var(--rz-line); background: currentColor; border-radius: 2px; }
.text-gradient { background: var(--rz-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
a { color: var(--primary-text); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size var(--rz-dur) var(--rz-ease); }
a:hover { background-size: 100% 1px; }
code { font-size: .85em; background: var(--surface-2); border: 1px solid var(--line); padding: .1em .4em; border-radius: var(--rz-r-xs); }
.kbd { display: inline-block; font-size: .78em; padding: .1em .5em; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface-2); }
hr { border: 0; height: 1px; background: var(--line); margin: var(--rz-s-6) 0; }
:focus-visible { outline: none; box-shadow: var(--focus); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--rz-fucsia); }

/* ---------- 5. Fondos técnicos ---------- */
.bg-grid {
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, #000 20%, transparent 80%);
}

/* ---------- 6. Botones ---------- */
.btn {
  --b-bg: var(--surface-2); --b-fg: var(--text); --b-bd: var(--line-strong);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .78em 1.35em;
  font: 400 var(--rz-fs-base)/1.1 var(--rz-font);
  color: var(--b-fg); background: var(--b-bg);
  border: 1px solid var(--b-bd); border-radius: 10px;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform var(--rz-dur) var(--rz-spring), box-shadow var(--rz-dur) var(--rz-ease), background-color var(--rz-dur), border-color var(--rz-dur), color var(--rz-dur);
  background-size: auto;
}
.btn:hover { border-color: var(--primary); background-size: auto; }
.btn:active { transform: scale(.97); }
.btn .ic { transition: transform var(--rz-dur) var(--rz-spring); }
.btn:hover .ic-move { transform: translateX(4px); }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; }
/* barrido de brillo */
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, transparent calc(var(--rz-shine) - 12%), rgba(255, 255, 255, .28) var(--rz-shine), transparent calc(var(--rz-shine) + 12%));
  transition: --rz-shine .7s var(--rz-ease);
}
.btn:hover::after { --rz-shine: 130%; }
.btn-primary { --b-bg: var(--primary); --b-fg: var(--on-primary); --b-bd: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover { --b-bg: var(--primary-hover); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), var(--glow); }
.btn-dark { --b-bg: var(--rz-tinta); --b-fg: #fff; --b-bd: rgba(255, 255, 255, .14); }
.btn-light { --b-bg: #fff; --b-fg: var(--rz-tinta); --b-bd: transparent; }
.btn-outline { --b-bg: transparent; --b-fg: var(--text); }
.btn-outline:hover { --b-bg: var(--primary-soft); --b-fg: var(--primary-text); }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--primary-text); }
.btn-ghost:hover { --b-bg: var(--primary-soft); border-color: transparent; }
.btn-danger { --b-bg: transparent; --b-fg: var(--danger); --b-bd: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger:hover { --b-bg: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }
.btn-sm { padding: .55em 1em; font-size: var(--rz-fs-sm); border-radius: 8px; }
.btn-lg { padding: .95em 1.7em; font-size: var(--rz-fs-lg); border-radius: 12px; }
.btn-icon { padding: .7em; aspect-ratio: 1; }
/* borde vivo: gradiente cónico que gira */
.btn-live {
  --b-bg: var(--surface); --b-bd: transparent;
  background: linear-gradient(var(--b-bg), var(--b-bg)) padding-box,
              conic-gradient(from var(--rz-angle), var(--line-strong) 0 55%, var(--rz-fucsia-luz) 70%, var(--rz-fucsia-hondo) 85%, var(--line-strong) 100%) border-box;
  animation: rz-rotate 4s linear infinite;
}
.btn-live:hover { box-shadow: var(--glow); }
@keyframes rz-rotate { to { --rz-angle: 360deg; } }

/* Grupo segmentado */
.segmented { display: inline-flex; padding: 4px; gap: 2px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; position: relative; }
.segmented button { position: relative; z-index: 1; font: inherit; font-size: var(--rz-fs-sm); color: var(--text-muted); background: none; border: 0; padding: .5em 1em; border-radius: 8px; cursor: pointer; transition: color var(--rz-dur); }
.segmented button[aria-pressed="true"] { color: var(--text); }
.segmented .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 8px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-strong); transition: left var(--rz-dur) var(--rz-spring), width var(--rz-dur) var(--rz-spring); }

/* ---------- 7. Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .32em .7em; border-radius: 6px;
  font-size: var(--rz-fs-2xs); letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--line);
  line-height: 1.3;
}
.badge-primary { color: var(--primary-text); background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.badge-solid { color: var(--on-primary); background: var(--primary); border-color: transparent; }
.badge-success { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.badge-warning { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.badge-danger  { color: var(--danger);  background: color-mix(in srgb, var(--danger) 12%, transparent);  border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.badge-info    { color: var(--info);    background: color-mix(in srgb, var(--info) 12%, transparent);    border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: rz-pulse 2s var(--rz-ease) infinite; }
@keyframes rz-pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- 8. Alertas ---------- */
.alert {
  --a: var(--primary-text);
  position: relative; display: flex; gap: var(--rz-s-3); align-items: flex-start;
  padding: var(--rz-s-4) var(--rz-s-5) var(--rz-s-4) calc(var(--rz-s-5) + 4px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--rz-r-firma);
  overflow: hidden;
}
.alert::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--a); }
.alert::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 140% at 0% 50%, color-mix(in srgb, var(--a) 10%, transparent), transparent 55%); pointer-events: none; }
.alert .ic { color: var(--a); margin-top: 3px; }
.alert strong { color: var(--a); }
.alert-close { margin-left: auto; position: relative; z-index: 1; background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; line-height: 1; width: 28px; height: 28px; border-radius: 8px; }
.alert-close:hover { background: var(--surface-3); color: var(--text); }
.alert-success { --a: var(--success); }
.alert-warning { --a: var(--warning); }
.alert-danger  { --a: var(--danger); }
.alert-info    { --a: var(--info); }

/* ---------- 9. Tarjetas ---------- */
.card {
  --mx: 50%; --my: 50%;
  position: relative; isolation: isolate;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--rz-r-firma); overflow: hidden;
  transition: transform var(--rz-dur) var(--rz-ease), border-color var(--rz-dur), opacity var(--rz-dur);
}
/* spotlight que sigue al cursor (JS actualiza --mx / --my) */
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--rz-fucsia) 16%, transparent), transparent 45%);
  transition: opacity var(--rz-dur);
}
.card:hover { border-color: var(--line-strong); }
.card:hover::before { opacity: 1; }
.card-lift:hover { transform: translateY(-4px); }
/* al pasar sobre una tarjeta, las demás se atenúan */
.cards:has(.card:hover) .card:not(:hover) { opacity: .55; }
.card-body { padding: var(--rz-s-5); }
.card-title { font-size: var(--rz-fs-lg); margin-bottom: .35em; }
.card-meta { font-family: var(--rz-font-mono); font-size: var(--rz-fs-2xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.card-footer { padding: var(--rz-s-3) var(--rz-s-5); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: var(--rz-fs-sm); color: var(--text-muted); }
.card-live {
  border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              conic-gradient(from var(--rz-angle), var(--line) 0 60%, var(--rz-fucsia-luz) 75%, var(--rz-fucsia-hondo) 88%, var(--line) 100%) border-box;
  animation: rz-rotate 6s linear infinite;
}
.card-ink { background: var(--rz-tinta); color: #F4F2F6; border-color: rgba(255, 255, 255, .08); }
.card-fucsia { background: var(--rz-fucsia); color: var(--rz-tinta); border-color: transparent; }
.card-fucsia .card-meta { color: rgba(2, 1, 1, .7); }
.icon-chip { width: 44px; height: 44px; border-radius: 12px 12px 12px 3px; display: grid; place-items: center; color: var(--primary-text); background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); }

/* ---------- 10. Formularios ---------- */
.field { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: var(--rz-s-4); }
.field label { font-size: var(--rz-fs-sm); color: var(--text-muted); transition: color var(--rz-dur); }
.field:has(:focus-visible) label { color: var(--primary-text); }
.field:has(.input:user-invalid) label, .field.is-invalid label { color: var(--danger); }
.hint { font-family: var(--rz-font-mono); font-size: var(--rz-fs-2xs); color: var(--text-muted); letter-spacing: .02em; }
.input, .select, .textarea {
  width: 100%; padding: .8em 1em;
  font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color var(--rz-dur), box-shadow var(--rz-dur), background-color var(--rz-dur);
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); opacity: .7; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); background: var(--surface); }
.input:user-invalid, .input.is-invalid { border-color: var(--danger); }
.input.is-valid { border-color: var(--success); }
.textarea { min-height: 120px; resize: vertical; field-sizing: content; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23EE0478' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1em center; padding-right: 2.6em;
}
/* etiqueta flotante */
.float { position: relative; }
.float .input { padding-top: 1.35em; padding-bottom: .45em; }
.float label { position: absolute; left: 1em; top: 50%; translate: 0 -50%; pointer-events: none; color: var(--text-muted); transition: all var(--rz-dur) var(--rz-ease); }
.float .input:focus + label, .float .input:not(:placeholder-shown) + label { top: .85em; font-family: var(--rz-font-mono); font-size: var(--rz-fs-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--primary-text); }
/* búsqueda con botón */
.search { display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; transition: border-color var(--rz-dur), box-shadow var(--rz-dur); }
.search:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.search .ic { color: var(--text-muted); }
.search input { flex: 1; min-width: 0; font: inherit; color: var(--text); background: none; border: 0; outline: none; padding: .5em .2em; }
/* casillas y radios */
.check { display: flex; align-items: center; gap: .65em; cursor: pointer; margin-bottom: .6em; }
.check input { appearance: none; margin: 0; width: 20px; height: 20px; flex: none; border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 6px; display: grid; place-items: center; cursor: pointer; transition: background-color var(--rz-dur), border-color var(--rz-dur); }
.check input[type="radio"] { border-radius: 50%; }
.check input::after { content: ""; transform: scale(0); transition: transform var(--rz-dur) var(--rz-spring); }
.check input[type="checkbox"]::after { width: 10px; height: 10px; background: var(--on-primary); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
.check input[type="radio"]::after { width: 8px; height: 8px; border-radius: 50%; background: var(--on-primary); }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { transform: scale(1); }
.check input:focus-visible { box-shadow: var(--focus); }
/* interruptor con rebote */
.switch { display: flex; align-items: center; gap: .75em; cursor: pointer; margin-bottom: .6em; }
.switch input { appearance: none; margin: 0; flex: none; width: 44px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; cursor: pointer; transition: background-color var(--rz-dur); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: translate var(--rz-dur-slow) var(--rz-spring), background-color var(--rz-dur); }
.switch input:checked { background: var(--primary); border-color: transparent; }
.switch input:checked::after { translate: 20px 0; background: #fff; }
.switch input:focus-visible { box-shadow: var(--focus); }
/* rango con relleno (JS actualiza --val) */
.range { --val: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--rz-fucsia-luz), var(--rz-fucsia)) 0 / var(--val) 100% no-repeat, var(--surface-3); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 5px solid var(--rz-fucsia); box-shadow: 0 0 0 6px var(--primary-soft); cursor: grab; transition: box-shadow var(--rz-dur); }
.range::-webkit-slider-thumb:hover { box-shadow: 0 0 0 9px var(--primary-soft); }
.range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 5px solid var(--rz-fucsia); cursor: grab; }
input, textarea, select { accent-color: var(--rz-fucsia); }

/* ---------- 11. Navegación ---------- */
.navbar { display: flex; align-items: center; gap: var(--rz-s-5); padding: 10px 10px 10px 18px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 75%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-radius: 14px; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-link { position: relative; display: block; padding: .5em .9em; color: var(--text-muted); font-size: var(--rz-fs-sm); border-radius: 8px; background: none; transition: color var(--rz-dur), background-color var(--rz-dur); }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--text); }
.nav-link.active::after { content: ""; position: absolute; left: .9em; right: .9em; bottom: 2px; height: 2px; border-radius: 2px; background: var(--rz-gradient); }
.tabs { display: flex; gap: var(--rz-s-5); border-bottom: 1px solid var(--line); list-style: none; margin: 0; padding: 0; }
.tabs a { display: block; padding: .7em 0; color: var(--text-muted); background: none; position: relative; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); }
.tabs a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--rz-gradient); border-radius: 2px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .6em; list-style: none; margin: 0; padding: 0; font-family: var(--rz-font-mono); font-size: var(--rz-fs-xs); color: var(--text-muted); }
.breadcrumb li + li::before { content: "/"; margin-right: .6em; opacity: .5; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary-text); }
.breadcrumb [aria-current] { color: var(--text); }
.pagination { display: inline-flex; gap: 4px; list-style: none; margin: 0; padding: 0; font-family: var(--rz-font-mono); font-size: var(--rz-fs-sm); }
.pagination a { display: grid; place-items: center; min-width: 38px; height: 38px; border-radius: 10px 10px 10px 3px; color: var(--text-muted); border: 1px solid var(--line); background: none; transition: all var(--rz-dur); }
.pagination a:hover { color: var(--text); border-color: var(--line-strong); }
.pagination a.active { color: var(--on-primary); background: var(--primary); border-color: transparent; }

/* ---------- 12. Datos ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--rz-r-firma); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--rz-fs-sm); }
.table th { text-align: left; font: 400 var(--rz-fs-2xs)/1 var(--rz-font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); padding: 1.1em 1.25em; border-bottom: 1px solid var(--line); }
.table td { padding: .95em 1.25em; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--rz-dur-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.num { font-family: var(--rz-font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.up { color: var(--success); }
.down { color: var(--danger); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress-bar { position: relative; height: 100%; border-radius: inherit; background: var(--rz-gradient); overflow: hidden; }
.progress-bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); translate: -100% 0; animation: rz-shimmer 2.2s var(--rz-ease-in-out) infinite; }
@keyframes rz-shimmer { to { translate: 100% 0; } }
.progress-bar.success { background: var(--success); }
.stat { font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--rz-r-firma); background: var(--surface); overflow: hidden; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 1em; padding: .9em 1.2em; border-bottom: 1px solid var(--line); transition: background-color var(--rz-dur-fast), padding var(--rz-dur) var(--rz-ease); }
.list li:last-child { border-bottom: 0; }
.list li:hover { background: var(--surface-2); padding-left: 1.5em; }

/* Acordeón que anima su altura (interpolate-size) */
.accordion { border: 1px solid var(--line); border-radius: var(--rz-r-firma); background: var(--surface); overflow: hidden; interpolate-size: allow-keywords; }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion details:last-child { border-bottom: 0; }
.accordion summary { display: flex; justify-content: space-between; align-items: center; gap: 1em; padding: 1.05em 1.25em; cursor: pointer; list-style: none; transition: color var(--rz-dur); }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: ""; width: 10px; height: 10px; flex: none; border-right: var(--rz-line) solid var(--primary-text); border-bottom: var(--rz-line) solid var(--primary-text); rotate: 45deg; translate: 0 -3px; transition: rotate var(--rz-dur) var(--rz-spring); }
.accordion details[open] summary::after { rotate: 225deg; translate: 0 2px; }
.accordion summary:hover { color: var(--primary-text); }
.accordion details::details-content { block-size: 0; overflow: hidden; transition: block-size var(--rz-dur) var(--rz-ease), content-visibility var(--rz-dur) allow-discrete; }
.accordion details[open]::details-content { block-size: auto; }
.accordion .panel { padding: 0 1.25em 1.1em; color: var(--text-muted); }

/* Tooltip (CSS puro) */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 10px);
  translate: -50% 4px; opacity: 0; pointer-events: none; white-space: nowrap;
  font: 400 var(--rz-fs-2xs)/1.3 var(--rz-font-mono); letter-spacing: .04em;
  color: #fff; background: var(--rz-tinta); border: 1px solid rgba(255, 255, 255, .14);
  padding: .55em .8em; border-radius: 8px 8px 8px 2px;
  transition: opacity var(--rz-dur), translate var(--rz-dur) var(--rz-spring);
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; translate: -50% 0; }

/* Diálogo modal nativo con animación de entrada (@starting-style) */
.dialog {
  width: min(460px, calc(100vw - 32px)); padding: 0; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--rz-r-firma-lg);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
  opacity: 0; scale: .96; translate: 0 12px;
  transition: opacity var(--rz-dur), scale var(--rz-dur) var(--rz-spring), translate var(--rz-dur) var(--rz-spring), overlay var(--rz-dur) allow-discrete, display var(--rz-dur) allow-discrete;
}
.dialog[open] { opacity: 1; scale: 1; translate: 0 0; }
@starting-style { .dialog[open] { opacity: 0; scale: .96; translate: 0 12px; } }
.dialog::backdrop { background: rgba(2, 1, 1, 0); backdrop-filter: blur(0); transition: all var(--rz-dur) allow-discrete; }
.dialog[open]::backdrop { background: rgba(2, 1, 1, .6); backdrop-filter: blur(6px); }
@starting-style { .dialog[open]::backdrop { background: rgba(2, 1, 1, 0); backdrop-filter: blur(0); } }
.dialog-body { padding: var(--rz-s-6); }

/* Marquesina con bordes difuminados */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 3rem; width: max-content; animation: rz-marquee 28s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes rz-marquee { to { translate: -50% 0; } }

/* Spinner orbital */
.spinner { width: 28px; height: 28px; border-radius: 50%; background: conic-gradient(from var(--rz-angle), transparent 0 40%, var(--rz-fucsia) 100%); mask: radial-gradient(circle, transparent 58%, #000 60%); animation: rz-rotate 1s linear infinite; }

/* Avatares */
.avatar { width: 40px; height: 40px; border-radius: 12px 12px 12px 3px; display: grid; place-items: center; font-family: var(--rz-font-mono); font-size: var(--rz-fs-xs); color: var(--primary-text); background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); flex: none; }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -10px; transition: translate var(--rz-dur) var(--rz-spring); }
.avatars .avatar:first-child { margin-left: 0; }
.avatars .avatar:hover { translate: 0 -4px; }

/* ---------- 13. Movimiento ligado al scroll (sin JS) ---------- */
@supports (animation-timeline: view()) {
  .reveal { animation: rz-reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
  @keyframes rz-reveal { from { opacity: 0; translate: 0 28px; filter: blur(6px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }
  .scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 100; background: var(--rz-gradient); transform-origin: 0 50%; animation: rz-grow linear both; animation-timeline: scroll(root); }
  @keyframes rz-grow { from { scale: 0 1; } to { scale: 1 1; } }
}

/* Transición de tema (View Transitions API) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; translate: none !important; filter: none !important; }
}

/* Bloques «tinta»: fondo negro dentro de cualquier tema */
.theme-ink { background: var(--bg); color: var(--text); }
