/* =============================================================================
   PROXXI · SISTEMA DE DISEÑO · style.css
   -----------------------------------------------------------------------------
   Marketplace hiperlocal de servicios de confianza.
   CSS puro y vanilla · sin frameworks · sin build step · mobile-first.
   Todo valor sale de un token (--px-*). Sin !important. Baja especificidad.

   ÍNDICE (orden exigido)
     1. TOKENS (:root)
     2. RESET / NORMALIZE
     3. ELEMENTOS BASE
     4. LAYOUT (contenedor · navbar · footer · grids)
     5. COMPONENTES (átomos → moléculas → organismos)
     6. UTILIDADES
     7. RESPONSIVE (media queries)
     8. TEMA OSCURO (overrides de tokens)
   ========================================================================== */


/* =============================================================================
   1 · TOKENS  ·  :root
   ========================================================================== */
:root {
  /* ---- Marca · escala primaria (derivada de #0066cc / #0a4ea3) ----------- */
  --px-primary-50:  #eef4ff;
  --px-primary-100: #d8e6fb;
  --px-primary-200: #aecdf5;
  --px-primary-300: #7fb0ec;
  --px-primary-400: #3d86dd;
  --px-primary-500: #0a72d6;
  --px-primary-600: #0066cc;   /* BASE   */
  --px-primary-700: #0052a3;   /* hover  */
  --px-primary-800: #0a4ea3;   /* active · azul oscuro de marca */
  --px-primary-900: #083d80;   /* deepest */

  /* ---- Acento cian ------------------------------------------------------- */
  --px-accent-400:  #4cc6e6;
  --px-accent-500:  #00a3cc;   /* BASE acento */
  --px-accent-600:  #0089ab;

  /* ---- Gradiente de marca (hero / escrow) -------------------------------- */
  --px-gradient-brand: linear-gradient(120deg, #0a4ea3 0%, #0066cc 55%, #00a3cc 100%);

  /* ---- Escala de grises (real del producto, normalizada) ----------------- */
  --px-gray-0:   #ffffff;
  --px-gray-50:  #fafafa;
  --px-gray-100: #f7f7f7;
  --px-gray-200: #ececec;
  --px-gray-300: #e8e8e8;
  --px-gray-400: #dddddd;
  --px-gray-500: #999999;
  --px-gray-600: #888888;
  --px-gray-700: #666666;
  --px-gray-800: #555555;
  --px-gray-900: #222222;

  /* ---- Semánticos de estado · cuartetos (solid / text / bg / border) ----- */
  /* success → pago liberado · perfil guardado · cuenta verificada */
  --px-success-solid:  #1b6b38;
  --px-success-text:   #1b6b38;   /* AA sobre bg/blanco */
  --px-success-bg:     #e7f6ec;
  --px-success-border: #aadcbb;

  /* danger → denuncia · bloqueo · pago cancelado · error */
  --px-danger-solid:   #c62828;
  --px-danger-text:    #a12020;
  --px-danger-bg:      #fdecec;
  --px-danger-border:  #f1b6b6;
  --px-danger-badge:   #d32f2f;   /* badge numérico no leídos · blanco encima = 4.98:1 (AA) */

  /* warning → fondos retenidos en escrow · pago en proceso · moderación */
  --px-warning-solid:  #f0a500;
  --px-warning-text:   #8a5a00;   /* AA sobre bg/blanco */
  --px-warning-bg:     #fff6e0;
  --px-warning-border: #f3d594;
  --px-warning-star:   #f0c040;   /* estrella favorito */

  /* info → mensajes informativos (azul neutro) */
  --px-info-solid:     #0066cc;
  --px-info-text:      #0052a3;
  --px-info-bg:        #eef4ff;
  --px-info-border:    #cfe0f5;

  /* ---- Tokens semánticos de superficie y texto (tematizables) ------------ */
  --px-text:         var(--px-gray-900);   /* #222 sobre #fff → 15.9:1 AAA  */
  --px-text-muted:   var(--px-gray-800);   /* #555 sobre #fff →  7.5:1 AAA  */
  --px-text-subtle:  var(--px-gray-700);   /* #666 sobre #fff →  5.7:1 AA   */
  --px-text-faint:   var(--px-gray-600);   /* #888 → texto auxiliar grande  */
  --px-text-on-brand: #ffffff;             /* sobre azul-600 → 5.1:1 AA     */

  --px-bg:           #f5f8fc;   /* fondo de página, azul casi imperceptible */
  --px-surface:      var(--px-gray-0);      /* tarjetas / paneles            */
  --px-surface-2:    var(--px-gray-50);     /* superficie hundida / filas    */
  --px-surface-3:    var(--px-gray-100);

  --px-border:       var(--px-gray-300);    /* borde por defecto */
  --px-border-soft:  var(--px-gray-200);
  --px-border-strong:var(--px-gray-400);

  --px-category-bg:     #eef4ff;            /* pill de categoría */
  --px-category-text:   #0052a3;
  --px-category-border: #cfe0f5;

  /* ---- Foco accesible ---------------------------------------------------- */
  /* Alfa 0.75: compuesto sobre blanco ≈ #3f8cd9 → ~3.5:1 contra el fondo,
     por encima del 3:1 que exige WCAG 1.4.11 para indicadores de foco.
     (Con 0.40 quedaba en ~1.9:1, casi invisible.) */
  --px-focus-ring: 0 0 0 3px rgba(0, 102, 204, 0.75);
  --px-focus-color: var(--px-primary-600);

  /* ---- Objetivo táctil mínimo (WCAG) -------------------------------------- */
  --px-tap-target: 44px;

  /* ---- Tipografía -------------------------------------------------------- */
  --px-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --px-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Escala modular ~1.2 en rem */
  --px-text-xs:   0.75rem;    /* 12 */
  --px-text-sm:   0.875rem;   /* 14 */
  --px-text-base: 1rem;       /* 16 */
  --px-text-md:   1.125rem;   /* 18 */
  --px-text-lg:   1.333rem;   /* ~21 */
  --px-text-xl:   1.602rem;   /* ~26 */
  --px-text-2xl:  1.953rem;   /* ~31 */
  --px-text-3xl:  2.488rem;   /* ~40 */

  --px-weight-regular: 400;
  --px-weight-semibold: 600;
  --px-weight-bold: 700;
  --px-weight-extrabold: 800;

  --px-leading-body:  1.55;
  --px-leading-tight: 1.15;
  --px-tracking-tight: -0.011em;
  --px-tracking-wide:  0.04em;

  /* ---- Espaciado · base 4px --------------------------------------------- */
  --px-space-1:  0.25rem;   /* 4 */
  --px-space-2:  0.5rem;    /* 8 */
  --px-space-3:  0.75rem;   /* 12 */
  --px-space-4:  1rem;      /* 16 */
  --px-space-5:  1.25rem;   /* 20 */
  --px-space-6:  1.5rem;    /* 24 */
  --px-space-8:  2rem;      /* 32 */
  --px-space-10: 2.5rem;    /* 40 */
  --px-space-12: 3rem;      /* 48 */
  --px-space-16: 4rem;      /* 64 */

  /* ---- Radios (Más suaves y modernos) ------------------------------------- */
  --px-radius-sm:   8px;
  --px-radius-md:   12px;
  --px-radius-lg:   20px;
  --px-radius-pill: 999px;

  /* ---- Sombras / elevación (Premium, amplias y con tono azulado) --------- */
  --px-shadow-sm: 0 2px 8px rgba(10, 78, 163, 0.08), 0 1px 2px rgba(10, 78, 163, 0.04);
  --px-shadow-md: 0 12px 32px -4px rgba(10, 78, 163, 0.12), 0 4px 12px -2px rgba(10, 78, 163, 0.08);
  --px-shadow-lg: 0 24px 48px -12px rgba(10, 78, 163, 0.18), 0 12px 24px -8px rgba(10, 78, 163, 0.12);

  /* ---- Motion ------------------------------------------------------------ */
  --px-transition: 160ms cubic-bezier(0.2, 0, 0.2, 1);
  --px-transition-slow: 280ms cubic-bezier(0.2, 0, 0.2, 1);

  /* ---- z-index con nombre ------------------------------------------------ */
  --px-z-base:     1;
  --px-z-sticky:   100;   /* navbar */
  --px-z-dropdown: 200;   /* autocompletado */
  --px-z-overlay:  300;   /* modales / overlays */
  --px-z-toast:    400;

  /* ---- Layout ------------------------------------------------------------ */
  --px-container: 1080px;        /* ancho de contenido: navbar, main y footer lo comparten */
  --px-container-wide: 1200px;
}


/* =============================================================================
   2 · RESET / NORMALIZE  (mínimo)
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

img, picture, svg, video { display: block; max-width: 100%; }

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

ul[class], ol[class] { list-style: none; padding: 0; }

a { color: inherit; text-decoration: none; }


/* =============================================================================
   3 · ELEMENTOS BASE
   ========================================================================== */
body {
  font-family: var(--px-font-sans);
  font-size: var(--px-text-base);
  line-height: var(--px-leading-body);
  color: var(--px-text);
  background: var(--px-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Sticky footer: el body se apila en columna y ocupa al menos toda la altura
     de la ventana. Con `body > main { flex: 1 }`, el footer queda siempre pegado
     abajo aunque la página tenga poco contenido. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  line-height: var(--px-leading-tight);
  font-weight: var(--px-weight-bold);
  letter-spacing: var(--px-tracking-tight);
  text-wrap: balance;
}
h1 { font-size: var(--px-text-2xl); font-weight: var(--px-weight-extrabold); } /* móvil; ≥560px sube a 3xl (§7) */
h2 { font-size: var(--px-text-2xl); }
h3 { font-size: var(--px-text-xl); }
h4 { font-size: var(--px-text-lg); }

p { text-wrap: pretty; }

a:not([class]) {
  color: var(--px-primary-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:not([class]):hover { color: var(--px-primary-800); }

small { font-size: var(--px-text-sm); }
strong { font-weight: var(--px-weight-bold); }

hr { border: 0; border-top: 1px solid var(--px-border); }

/* Foco accesible global: nunca quitar outline sin reemplazo */
:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--px-focus-ring);
  border-radius: var(--px-radius-sm);
}
/* El <main id="main" tabindex="-1"> recibe foco programático desde el
   skip-link: sin anillo (rodearía la página entera). */
body > main:focus-visible { box-shadow: none; }

/* Enlace "Saltar al contenido" (WCAG 2.4.1): invisible hasta recibir foco
   con Tab; entonces aparece sobre la navbar. */
.skip-link {
  position: fixed;
  top: var(--px-space-2);
  left: var(--px-space-2);
  z-index: calc(var(--px-z-sticky) + 1);
  padding: var(--px-space-2) var(--px-space-4);
  background: var(--px-primary-600);
  color: var(--px-text-on-brand);
  font-weight: var(--px-weight-semibold);
  border-radius: var(--px-radius-sm);
  text-decoration: none;
  transform: translateY(-200%);     /* fuera de pantalla, pero enfocable */
}
.skip-link:focus { transform: none; }


/* =============================================================================
   4 · LAYOUT
   ========================================================================== */

/* Contenedor / main -------------------------------------------------------
   Scoped a `body > main` (el <main> del layout público, hijo directo del body).
   Así NO afecta al <main class="admin-main">, que vive dentro de .admin-shell y
   tiene su propia rejilla. max-width + margin-inline:auto = contenedor centrado;
   flex:1 empuja el footer al fondo (sticky footer). */
body > main {
  display: block;
  flex: 1;
  width: 100%;             /* en un flex column, sin esto el item encoge al contenido
                              en vez de llenar hasta max-width → main se descentraba */
  max-width: var(--px-container);
  margin-inline: auto;
  padding: var(--px-space-8) var(--px-space-6) var(--px-space-12);
}
/* Ritmo vertical por defecto entre los bloques de cada página (evita el aspecto
   "apretado"). Las utilidades .px-mt-* siguen mandando por especificidad donde se
   usan; y el primer bloque visible NO recibe margen aunque haya un <style> oculto
   por delante (varias vistas empiezan con un <style> propio). */
body > main > * + * { margin-top: var(--px-space-5); }
body > main > style:first-child + * { margin-top: 0; }

.px-container { width: 100%; max-width: var(--px-container); margin-inline: auto; padding-inline: var(--px-space-6); }
.px-container--wide { max-width: var(--px-container-wide); }

/* Navbar · header nav ----------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: var(--px-z-sticky);
  background: color-mix(in srgb, var(--px-surface) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--px-border);
}
header nav {
  display: flex;
  flex-wrap: wrap;                  /* móvil (base): el panel salta a su propia fila */
  align-items: center;
  gap: var(--px-space-4);
  max-width: var(--px-container);   /* mismo ancho que main → la marca alinea con el contenido */
  margin-inline: auto;
  padding: var(--px-space-3) var(--px-space-6);
}
/* Botón hamburguesa · base MÓVIL (mobile-first); se oculta en ≥900px (§7).
   Sin JS sería un control muerto → solo existe bajo html.js (la clase la
   añade un script inline en el layout). */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: var(--px-tap-target);
  height: var(--px-tap-target);
  margin-left: auto;
  padding: 0;
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius-sm);
  cursor: pointer;
}
html:not(.js) .nav-toggle { display: none; }
.nav-toggle:hover { background: var(--px-surface-2); }
.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--px-text);
  transition: transform var(--px-transition), opacity var(--px-transition);
}
/* Hamburguesa → X cuando el panel está abierto */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Panel de navegación · base MÓVIL: columna a lo ancho bajo la barra.
   La fila inline de escritorio vive en el §7 (min-width: 900px). */
header nav .px-nav-links {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  margin: var(--px-space-2) 0 0;
  padding: var(--px-space-2) 0 var(--px-space-3);
  border-top: 1px solid var(--px-border);
}
/* Con JS, el panel arranca plegado y nav.is-open lo despliega. Sin JS
   (html sin .js) queda siempre visible → degradación elegante: la
   navegación y el logout nunca dependen de que nav.js cargue. */
html.js header nav .px-nav-links { display: none; }
html.js header nav.is-open .px-nav-links {
  display: flex;
  animation: px-nav-in var(--px-transition);
  /* El header es sticky (no scrollea con la página): si el panel supera el
     alto del viewport (móvil apaisado, sesión iniciada), scroll interno
     para que "Salir" nunca quede inalcanzable. */
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
}
@keyframes px-nav-in {
  from { opacity: 0; transform: translateY(calc(-1 * var(--px-space-1))); }
  to   { opacity: 1; transform: none; }
}

/* :not(.btn): los CTA tipo botón ("Crear cuenta") conservan SUS colores.
   Sin esta exclusión, la especificidad de esta regla pisaba el color blanco
   de .btn-primary y el texto del botón quedaba ilegible sobre azul. */
header nav .px-nav-links a:not(.btn) {
  display: inline-flex;
  align-items: center;
  gap: var(--px-space-2);
  width: 100%;
  min-height: var(--px-tap-target);
  padding: var(--px-space-2) var(--px-space-3);
  border-radius: var(--px-radius-sm);
  color: var(--px-text-muted);
  font-weight: var(--px-weight-semibold);
  font-size: var(--px-text-base);
  text-decoration: none;   /* anula el subrayado de a:not([class]) */
  transition: background var(--px-transition), color var(--px-transition);
}
header nav .px-nav-links a:not(.btn):hover { background: var(--px-surface-2); color: var(--px-text); }
header nav .px-nav-links a[aria-current="page"]:not(.btn) { color: var(--px-primary-700); background: var(--px-primary-50); }
header nav .px-nav-links .btn { width: 100%; min-height: var(--px-tap-target); margin-top: var(--px-space-2); }

/* Bloque de sesión · base móvil: fila a lo ancho al pie del panel */
.nav-session {
  display: flex;
  align-items: center;
  gap: var(--px-space-2);
  width: 100%;
  margin-top: var(--px-space-2);
  padding: var(--px-space-3) var(--px-space-3) 0;
  border-top: 1px solid var(--px-border);
}
.nav-session .logout-form { margin-left: auto; }
.nav-user { font-weight: var(--px-weight-semibold); font-size: var(--px-text-sm); color: var(--px-text); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--px-space-2);
  font-weight: var(--px-weight-extrabold);
  font-size: var(--px-text-md);
  letter-spacing: var(--px-tracking-tight);
  color: var(--px-text);
}
/* Logotipo O_O (SVG inline de Core\Brand): escala por altura */
.brand__logo { height: 26px; width: auto; display: block; flex: none; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--px-gradient-brand);
  color: #fff;
  font-weight: var(--px-weight-extrabold);
  font-size: var(--px-text-base);
  box-shadow: var(--px-shadow-sm);
}

.logout-form { display: inline-flex; }

/* Footer ------------------------------------------------------------------
   Marca + tagline a la izquierda, columnas de enlaces a la derecha y una
   barra inferior con el copyright y la nota de pagos. Mobile-first. */
footer {
  border-top: 1px solid var(--px-border);
  background: var(--px-surface);
  color: var(--px-text-muted);
  font-size: var(--px-text-sm);
}
footer .px-footer__inner {
  display: grid;
  grid-template-columns: 1fr;       /* móvil: bloques apilados */
  gap: var(--px-space-8);
  max-width: var(--px-container);   /* alineado con nav y main */
  margin-inline: auto;
  padding: var(--px-space-10) var(--px-space-6) var(--px-space-8);
}
.footer-tagline {
  margin-top: var(--px-space-3);
  max-width: 38ch;
  color: var(--px-text-muted);
  line-height: var(--px-leading-body);
}
.footer-col { display: grid; gap: var(--px-space-2); align-content: start; }
.footer-col__title {
  font-size: var(--px-text-xs);
  font-weight: var(--px-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--px-tracking-wide);
  color: var(--px-text-faint);
  margin-bottom: var(--px-space-1);
}
/* :not(.btn) sube la especificidad por encima de a:not([class]) (0,1,1),
   que de otro modo subrayaría y teñiría los enlaces sin clase del footer. */
footer a:not(.btn) { color: var(--px-text-muted); text-decoration: none; }
footer a:not(.btn):hover { color: var(--px-primary-700); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--px-border-soft); }
.footer-bottom__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--px-space-2) var(--px-space-6);
  align-items: center;
  justify-content: space-between;
  max-width: var(--px-container);
  margin-inline: auto;
  padding: var(--px-space-4) var(--px-space-6);
  color: var(--px-text-faint);
}

/* Grids ------------------------------------------------------------------- */
.provider-grid,
.oficios-grid {
  display: grid;
  gap: var(--px-space-4);
}
.provider-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.oficios-grid  { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }


/* =============================================================================
   5 · COMPONENTES
   ========================================================================== */

/* -----------------------------------------------------------------------------
   5.1 ÁTOMOS
   -------------------------------------------------------------------------- */

/* Botones ----------------------------------------------------------------- */
.btn {
  --_btn-bg: var(--px-surface);
  --_btn-fg: var(--px-text);
  --_btn-bd: var(--px-border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--px-space-2);
  min-height: 48px;                 /* Más altura para mejor tacto en móvil */
  padding: var(--px-space-2) var(--px-space-6); /* Más respiro lateral */
  border: 1px solid var(--_btn-bd);
  border-radius: var(--px-radius-pill); /* Botones redondeados tipo premium */
  background: var(--_btn-bg);
  color: var(--_btn-fg);
  font-size: var(--px-text-base);
  font-weight: var(--px-weight-bold);
  line-height: 1;
  cursor: pointer;
  user-select: none;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); /* Animación más elástica */
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--px-shadow-md); }
.btn:active { transform: translateY(0); box-shadow: none; transition-duration: 0.1s; }
.btn:focus-visible { box-shadow: var(--px-focus-ring); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none;
}

/* primary */
.btn-primary, .cta-btn {
  --_btn-bg: var(--px-primary-600);
  --_btn-fg: var(--px-text-on-brand);
  --_btn-bd: var(--px-primary-600);
}
.btn-primary:hover, .cta-btn:hover { --_btn-bg: var(--px-primary-700); --_btn-bd: var(--px-primary-700); }
.btn-primary:active, .cta-btn:active { --_btn-bg: var(--px-primary-800); --_btn-bd: var(--px-primary-800); }

/* secondary (outline) */
.btn-secondary {
  --_btn-bg: var(--px-surface);
  --_btn-fg: var(--px-primary-700);
  --_btn-bd: var(--px-primary-200);
}
.btn-secondary:hover { --_btn-bg: var(--px-primary-50); --_btn-bd: var(--px-primary-300); }
.btn-secondary:active { --_btn-bg: var(--px-primary-100); }

/* ghost */
.btn-ghost {
  --_btn-bg: transparent;
  --_btn-fg: var(--px-text-muted);
  --_btn-bd: transparent;
}
.btn-ghost:hover { --_btn-bg: var(--px-surface-2); --_btn-fg: var(--px-text); box-shadow: none; }

/* danger */
.btn-danger {
  --_btn-bg: var(--px-danger-solid);
  --_btn-fg: #fff;
  --_btn-bd: var(--px-danger-solid);
}
.btn-danger:hover { --_btn-bg: #a81f1f; --_btn-bd: #a81f1f; }

/* tamaños */
.btn--sm { min-height: 36px; padding: var(--px-space-1) var(--px-space-3); font-size: var(--px-text-xs); border-radius: var(--px-radius-sm); }
.btn--lg { min-height: 52px; padding: var(--px-space-3) var(--px-space-8); font-size: var(--px-text-md); }
.btn--block { width: 100%; }

/* con spinner / loading */
.btn.is-loading { color: transparent; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: var(--px-text-on-brand);
  animation: px-spin 0.7s linear infinite;
}
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after { color: var(--px-primary-700); }
@keyframes px-spin { to { transform: rotate(360deg); } }

/* Inputs ------------------------------------------------------------------ */
.input, input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  min-height: var(--px-tap-target);
  padding: var(--px-space-2) var(--px-space-3);
  background: var(--px-surface);
  color: var(--px-text);
  border: 1px solid var(--px-border-strong);
  border-radius: var(--px-radius-md);
  font-size: var(--px-text-base);
  transition: border-color var(--px-transition), box-shadow var(--px-transition);
}
textarea { min-height: 96px; resize: vertical; line-height: var(--px-leading-body); }
.input::placeholder, input::placeholder, textarea::placeholder { color: var(--px-text-faint); }
.input:hover, input:hover, select:hover, textarea:hover { border-color: var(--px-primary-300); }
.input:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid transparent;
  border-color: var(--px-primary-500);
  box-shadow: var(--px-focus-ring);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--px-space-3) center;
  padding-right: var(--px-space-8);
}
.input[disabled], input[disabled], select[disabled], textarea[disabled] {
  background: var(--px-surface-2); color: var(--px-text-faint); cursor: not-allowed;
}
/* estado de error */
.input.is-error, input.is-error, select.is-error, textarea.is-error,
[aria-invalid="true"] { border-color: var(--px-danger-border); }
.input.is-error:focus-visible, input.is-error:focus-visible,
[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px rgba(226, 59, 59, 0.30); border-color: var(--px-danger-solid); }

/* Badges / chips ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  background: var(--px-danger-badge);
  color: #fff;
  font-size: var(--px-text-xs);
  font-weight: var(--px-weight-bold);
  line-height: 1;
  border-radius: var(--px-radius-pill);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--px-space-1);
  padding: 3px var(--px-space-2);
  font-size: var(--px-text-xs);
  font-weight: var(--px-weight-semibold);
  line-height: 1.4;
  border-radius: var(--px-radius-pill);
  border: 1px solid var(--px-border);
  background: var(--px-surface-2);
  color: var(--px-text-muted);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.9; }
/* estados (no comunicar solo por color → punto + texto, e iconos en uso) */
.chip--held      { background: var(--px-warning-bg); color: var(--px-warning-text); border-color: var(--px-warning-border); }
.chip--released  { background: var(--px-success-bg); color: var(--px-success-text); border-color: var(--px-success-border); }
.chip--cancelled { background: var(--px-danger-bg);  color: var(--px-danger-text);  border-color: var(--px-danger-border); }
.chip--verified  { background: var(--px-success-bg); color: var(--px-success-text); border-color: var(--px-success-border); }
.chip--pro       { background: var(--px-info-bg);     color: var(--px-info-text);     border-color: var(--px-info-border); }
.chip--blocked   { background: var(--px-danger-bg);  color: var(--px-danger-text);  border-color: var(--px-danger-border); }
.chip--reported  { background: var(--px-danger-bg);  color: var(--px-danger-text);  border-color: var(--px-danger-border); }
.chip--pending   { background: var(--px-warning-bg); color: var(--px-warning-text); border-color: var(--px-warning-border); }
.chip--info      { background: var(--px-info-bg);    color: var(--px-info-text);    border-color: var(--px-info-border); }

/* pill de categoría */
.category {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--px-space-3);
  font-size: var(--px-text-xs);
  font-weight: var(--px-weight-semibold);
  border-radius: var(--px-radius-pill);
  background: var(--px-category-bg);
  color: var(--px-category-text);
  border: 1px solid var(--px-category-border);
}

/* rating (estrellas) */
.rating { display: inline-flex; align-items: center; gap: 4px; color: var(--px-warning-solid); font-weight: var(--px-weight-bold); font-size: var(--px-text-sm); }
.rating__stars { letter-spacing: 1px; }
.rating-count { color: var(--px-text-faint); font-weight: var(--px-weight-regular); font-size: var(--px-text-xs); }
.rating-new { color: var(--px-text-faint); font-weight: var(--px-weight-semibold); font-size: var(--px-text-xs); }

/* Avatar ------------------------------------------------------------------ */
.avatar {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--px-gradient-brand);
  color: #fff;
  font-weight: var(--px-weight-bold);
  font-size: var(--px-text-base);
  overflow: hidden;
  object-fit: cover;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 32px; height: 32px; font-size: var(--px-text-sm); }
.avatar--lg { width: 72px; height: 72px; font-size: var(--px-text-xl); }
.avatar--xl { width: 96px; height: 96px; font-size: var(--px-text-2xl); }


/* -----------------------------------------------------------------------------
   5.2 MOLÉCULAS
   -------------------------------------------------------------------------- */

/* Campo de formulario (label + control + hint + error) -------------------- */
.field { display: grid; gap: var(--px-space-2); margin-bottom: var(--px-space-4); }
.field__label { font-size: var(--px-text-sm); font-weight: var(--px-weight-semibold); color: var(--px-text); }
.field__label .px-req { color: var(--px-danger-solid); }
.field__hint { font-size: var(--px-text-xs); color: var(--px-text-faint); }
.field__error {
  display: none;
  align-items: center;
  gap: var(--px-space-1);
  font-size: var(--px-text-xs);
  font-weight: var(--px-weight-semibold);
  color: var(--px-danger-text);
}
.field__error::before { content: "⚠"; }
.field.is-error .field__error { display: inline-flex; }
.field.is-error .field__hint { display: none; }

/* Barra de búsqueda del hero --------------------------------------------- */
.hero-search {
  display: flex;
  flex-direction: column;             /* móvil; fila + pill en ≥560px (§7) */
  gap: var(--px-space-2);
  background: var(--px-surface);
  padding: var(--px-space-2);
  border-radius: var(--px-radius-lg);
  box-shadow: var(--px-shadow-lg);
  max-width: 560px;
}
.hero-search input { border: 0; box-shadow: none; background: transparent; flex: 1; min-width: 0; }
.hero-search input:focus-visible { box-shadow: none; }
.hero-search .btn { white-space: nowrap; width: 100%; }

/* Barra de filtros del directorio ---------------------------------------- */
.dir-search {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--px-space-3);
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius-lg);
  padding: var(--px-space-4);
  box-shadow: var(--px-shadow-sm);
}

/* Tarjeta de oficio ------------------------------------------------------- */
.oficio-card {
  display: grid;
  place-items: center;
  gap: var(--px-space-3);
  text-align: center;
  padding: var(--px-space-6) var(--px-space-4); /* Más aire interno */
  background: var(--px-surface);
  border: 1px solid transparent; /* Quitamos borde duro, usamos sombra suave */
  border-radius: var(--px-radius-lg);
  color: var(--px-text);
  font-weight: var(--px-weight-bold);
  font-size: var(--px-text-base);
  box-shadow: var(--px-shadow-sm); /* Sombra base por defecto */
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.oficio-card:hover { 
  transform: translateY(-6px); /* Se eleva más */
  box-shadow: var(--px-shadow-lg); /* Sombra gigante y suave */
  border-color: var(--px-primary-100); 
  color: var(--px-primary-700); /* El texto se tiñe del color de marca al hacer hover */
}
.oficio-card:focus-visible { box-shadow: var(--px-focus-ring); }
.oficio-card__icon {
  display: grid; place-items: center;
  width: 64px; height: 64px; /* Iconos más grandes */
  color: var(--px-primary-600);
  font-size: var(--px-text-2xl);
  transition: transform 0.3s ease;
}
.oficio-card:hover .oficio-card__icon { transform: scale(1.1); } /* El icono crece un poco */

/* Alertas / flash --------------------------------------------------------- */
.flash {
  display: flex;
  align-items: flex-start;
  gap: var(--px-space-3);
  padding: var(--px-space-3) var(--px-space-4);
  border: 1px solid var(--px-border);
  border-left-width: 4px;
  border-radius: var(--px-radius-md);
  background: var(--px-surface-2);
  color: var(--px-text);
  font-size: var(--px-text-sm);
}
.flash__icon { flex: none; font-weight: var(--px-weight-bold); }
.flash-success { background: var(--px-success-bg); border-color: var(--px-success-border); border-left-color: var(--px-success-solid); color: var(--px-success-text); }
.flash-error   { background: var(--px-danger-bg);  border-color: var(--px-danger-border);  border-left-color: var(--px-danger-solid);  color: var(--px-danger-text); }
.flash-warning { background: var(--px-warning-bg); border-color: var(--px-warning-border); border-left-color: var(--px-warning-solid); color: var(--px-warning-text); }
.flash-info    { background: var(--px-info-bg);    border-color: var(--px-info-border);    border-left-color: var(--px-info-solid);    color: var(--px-info-text); }

/* Autocompletado ---------------------------------------------------------- */
.ac-wrap { position: relative; }
.ac-box {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: var(--px-z-dropdown);
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius-md);
  box-shadow: var(--px-shadow-lg);
  padding: var(--px-space-1);
  max-height: 280px;
  overflow-y: auto;
}
.ac-item {
  display: flex; align-items: center; gap: var(--px-space-2);
  padding: var(--px-space-2) var(--px-space-3);
  border-radius: var(--px-radius-sm);
  font-size: var(--px-text-sm);
  color: var(--px-text);
  cursor: pointer;
}
.ac-item:hover, .ac-item[aria-selected="true"] { background: var(--px-primary-50); color: var(--px-primary-800); }

/* Estrella de favorito ---------------------------------------------------- */
.fav-star, .fav-btn {
  display: inline-grid;
  place-items: center;
  width: var(--px-tap-target); height: var(--px-tap-target);
  border: 0;
  background: transparent;
  color: var(--px-text-faint);
  font-size: var(--px-text-lg);
  cursor: pointer;
  border-radius: 50%;
  transition: color var(--px-transition), background var(--px-transition), transform var(--px-transition);
}
.fav-star:hover, .fav-btn:hover { color: var(--px-warning-solid); background: var(--px-warning-bg); }
.fav-star:active, .fav-btn:active { transform: scale(0.9); }
.fav-star.is-fav, .fav-btn.is-fav, .is-fav .fav-star { color: var(--px-warning-solid); }
.fav-corner {
  position: absolute;
  top: var(--px-space-2); right: var(--px-space-2);
  z-index: var(--px-z-base);
  background: color-mix(in srgb, var(--px-surface) 88%, transparent);
  box-shadow: var(--px-shadow-sm);
}


/* -----------------------------------------------------------------------------
   5.3 ORGANISMOS
   -------------------------------------------------------------------------- */

/* Tarjeta de proveedor ---------------------------------------------------- */
.provider-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--px-space-4);
  padding: var(--px-space-6); /* Más aire interno */
  background: var(--px-surface);
  border: 1px solid transparent; /* Sin borde duro */
  border-radius: var(--px-radius-lg);
  box-shadow: var(--px-shadow-sm);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.provider-card:hover { 
  transform: translateY(-4px); 
  box-shadow: var(--px-shadow-lg); 
}
.provider-card__head { display: flex; align-items: center; gap: var(--px-space-3); }
.provider-card__name { font-weight: var(--px-weight-bold); font-size: var(--px-text-md); line-height: 1.2; }
.provider-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--px-space-2); }
.provider-card__actions { display: flex; gap: var(--px-space-2); margin-top: auto; padding-top: var(--px-space-2); }
.provider-card__actions .btn { flex: 1; }

/* Ficha de proveedor (perfil) -------------------------------------------- */
.profile {
  display: grid;
  gap: var(--px-space-5);
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius-lg);
  padding: var(--px-space-6);
  box-shadow: var(--px-shadow-sm);
}
.profile__head { display: flex; align-items: center; gap: var(--px-space-4); flex-wrap: wrap; }
.profile__name { font-size: var(--px-text-2xl); font-weight: var(--px-weight-extrabold); }
.profile__meta { display: flex; flex-wrap: wrap; gap: var(--px-space-2); align-items: center; }

/* Hero -------------------------------------------------------------------- */
.hero {
  position: relative;
  color: #fff;
  background: var(--px-gradient-brand);
  border-radius: var(--px-radius-lg);
  padding: var(--px-space-8) var(--px-space-4); /* móvil; crece en ≥560 y ≥768 (§7) */
  overflow: hidden;
  box-shadow: var(--px-shadow-md);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(60% 120% at 85% 10%, rgba(255,255,255,0.18), transparent 60%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero h1 { 
  color: #fff; 
  max-width: 18ch; 
  letter-spacing: -0.03em; /* Letras un poco más juntas, aspecto muy moderno */
}
.hero p { color: rgba(255,255,255,0.88); font-size: var(--px-text-md); max-width: 48ch; margin-top: var(--px-space-3); }
.hero .hero-search { margin-top: var(--px-space-6); }

/* Hero con ilustración de fondo (opcional) -------------------------------- *
 * Se activa añadiendo la clase .hero--art al <section class="hero">. La
 * imagen va en un ::before (DEBAJO del contenido) y encima lleva un velo de
 * marca semitransparente (scrim) que garantiza el contraste del texto.
 *   · Intensidad del velo → --px-hero-scrim (0 = imagen nítida / 1 = velo opaco).
 *   · La URL es relativa a ESTE archivo (/css), así funciona en WAMP y en raíz.
 *   · Si el archivo no existe, el ::before solo pinta el velo sobre el
 *     gradiente de .hero → la portada se ve como antes (degradación elegante).
 * Para quitarlo, basta con borrar la clase hero--art del <section>. */
.hero--art { --px-hero-scrim: 0.70; }
.hero--art::before {
  content: "";
  position: absolute; inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(120deg,
      rgba(10,78,163, var(--px-hero-scrim)) 0%,
      rgba(0,102,204, var(--px-hero-scrim)) 55%,
      rgba(0,163,204, calc(var(--px-hero-scrim) * 0.85)) 100%),
    url("../img/hero.png");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  pointer-events: none;
}
.hero--art::after { z-index: 1; }   /* el brillo sutil queda sobre la imagen */
.hero--art > * { position: relative; z-index: 2; }  /* texto y buscador, arriba */

/* Cómo funciona ----------------------------------------------------------- */
.how-step {
  display: grid;
  gap: var(--px-space-2);
  padding: var(--px-space-5);
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius-lg);
}
.how-step__num {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--px-primary-50);
  color: var(--px-primary-700);
  font-weight: var(--px-weight-extrabold);
}

/* Caja CTA / escrow ------------------------------------------------------- */
.cta-box {
  display: grid;
  gap: var(--px-space-4);
  padding: var(--px-space-8);
  border-radius: var(--px-radius-lg);
  background: var(--px-gradient-brand);
  color: #fff;
  text-align: center;
  box-shadow: var(--px-shadow-md);
}
.cta-box h2 { color: #fff; }
.cta-box p { color: rgba(255,255,255,0.9); }
.cta-box .cta-btn {
  --_btn-bg: #fff; --_btn-fg: var(--px-primary-800); --_btn-bd: #fff;
  justify-self: center;
}
.cta-box .cta-btn:hover { --_btn-bg: var(--px-primary-50); }

/* Nota informativa de contacto (Proxxi = intermediario) */
.contact-note {
  display: flex; align-items: center; gap: var(--px-space-3);
  padding: var(--px-space-3) var(--px-space-4);
  background: var(--px-surface-2);
  border: 1px solid var(--px-border);
  border-radius: var(--px-radius-md);
  color: var(--px-text-muted);
  font-size: var(--px-text-sm);
}
.contact-note__icon { flex: none; font-size: var(--px-text-lg); }

/* Reseñas ----------------------------------------------------------------- */
.review-item {
  display: grid;
  gap: var(--px-space-2);
  padding: var(--px-space-4) 0;
  border-bottom: 1px solid var(--px-border);
}
.review-item__head { display: flex; align-items: center; gap: var(--px-space-3); }

/* Burbujas de chat -------------------------------------------------------- */
.chat { display: flex; flex-direction: column; gap: var(--px-space-3); }
.chat__bubble {
  max-width: 78%;
  padding: var(--px-space-3) var(--px-space-4);
  border-radius: var(--px-radius-lg);
  font-size: var(--px-text-sm);
  line-height: var(--px-leading-body);
  box-shadow: var(--px-shadow-sm);
}
.chat__bubble time { display: block; margin-top: 4px; font-size: var(--px-text-xs); opacity: 0.7; }
.chat__bubble--them { align-self: flex-start; background: var(--px-surface); border: 1px solid var(--px-border); border-bottom-left-radius: var(--px-radius-sm); }
.chat__bubble--me { align-self: flex-end; background: var(--px-primary-600); color: #fff; border-bottom-right-radius: var(--px-radius-sm); }
.chat__bubble--me time { opacity: 0.85; }
/* burbuja-oferta (oferta/pago dentro del chat) */
.chat__offer {
  align-self: center;
  width: min(100%, 360px);
  background: var(--px-surface);
  border: 1px solid var(--px-warning-border);
  border-radius: var(--px-radius-lg);
  box-shadow: var(--px-shadow-md);
  overflow: hidden;
}
.chat__offer header { position: static; background: var(--px-warning-bg); border: 0; padding: var(--px-space-2) var(--px-space-4); color: var(--px-warning-text); font-weight: var(--px-weight-bold); font-size: var(--px-text-xs); display: flex; gap: var(--px-space-2); align-items: center; }
.chat__offer__body { padding: var(--px-space-4); display: grid; gap: var(--px-space-3); }
.chat__offer__price { font-size: var(--px-text-2xl); font-weight: var(--px-weight-extrabold); color: var(--px-text); }

/* Estados vacíos ---------------------------------------------------------- */
.dir-empty, .fav-empty, .px-empty {
  display: grid;
  justify-items: center;
  gap: var(--px-space-3);
  text-align: center;
  padding: var(--px-space-12) var(--px-space-6);
  background: var(--px-surface);
  border: 1px dashed var(--px-border-strong);
  border-radius: var(--px-radius-lg);
  color: var(--px-text-muted);
}
.px-empty__icon {
  display: grid; place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--px-primary-50);
  color: var(--px-primary-600);
  font-size: var(--px-text-2xl);
}
.px-empty__title { font-size: var(--px-text-lg); font-weight: var(--px-weight-bold); color: var(--px-text); }


/* =============================================================================
   6 · UTILIDADES
   ========================================================================== */
.px-stack > * + * { margin-top: var(--px-space-4); }
.px-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--px-space-2); }
.px-row { display: flex; align-items: center; gap: var(--px-space-3); }
.px-grow { flex: 1; min-width: 0; }
.px-center { text-align: center; }
.px-muted { color: var(--px-text-muted); }
.px-subtle { color: var(--px-text-faint); }
.px-mono { font-family: var(--px-font-mono); }

.px-mt-0 { margin-top: 0; }
.px-mt-2 { margin-top: var(--px-space-2); }
.px-mt-4 { margin-top: var(--px-space-4); }
.px-mt-6 { margin-top: var(--px-space-6); }
.px-mt-8 { margin-top: var(--px-space-8); }
.px-mb-4 { margin-bottom: var(--px-space-4); }

.px-hidden { display: none; }
.px-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;
}
.px-divider { height: 1px; background: var(--px-border); border: 0; margin-block: var(--px-space-4); }
.px-section-label {
  font-size: var(--px-text-xs); font-weight: var(--px-weight-bold);
  text-transform: uppercase; letter-spacing: var(--px-tracking-wide);
  color: var(--px-text-faint);
}


/* =============================================================================
   7 · RESPONSIVE  (mobile-first → min-width)
   ========================================================================== */

@media (min-width: 560px) {
  h1 { font-size: var(--px-text-3xl); }
  .hero { padding: var(--px-space-16) var(--px-space-8); }
  .hero-search { flex-direction: row; border-radius: var(--px-radius-pill); }
  .hero-search .btn { width: auto; }
  .dir-search { grid-template-columns: 2fr 1fr auto; align-items: end; }
}

/* Navbar escritorio (≥900px): fila inline, sin hamburguesa. El grupo de
   selectores html.js iguala la especificidad del plegado móvil. */
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  header nav { flex-wrap: nowrap; }
  header nav .px-nav-links,
  html.js header nav .px-nav-links,
  html.js header nav.is-open .px-nav-links {
    display: flex;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: var(--px-space-1);
    margin: 0 0 0 auto;
    padding: 0;
    border-top: 0;
    max-height: none;
    overflow: visible;
    animation: none;
  }
  header nav .px-nav-links a:not(.btn) {
    width: auto;
    min-height: 0;
    font-size: var(--px-text-sm);
    white-space: nowrap;
  }
  header nav .px-nav-links .btn { width: auto; min-height: 36px; margin-top: 0; } /* = .btn--sm */
  .nav-session {
    width: auto;
    margin: 0 0 0 var(--px-space-2);
    padding: 0 0 0 var(--px-space-3);
    border-top: 0;
    border-left: 1px solid var(--px-border);
  }
  .nav-session .logout-form { margin-left: 0; }
  /* El nombre se oculta SOLO visualmente (patrón clip): sigue en el árbol de
     accesibilidad — el avatar-inicial va aria-hidden y sin él un lector de
     pantalla no sabría con qué cuenta está logueado. */
  .nav-user {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (min-width: 768px) {
  /* En escritorio, padding lateral más generoso. nav, main y footer lo comparten
     para que el contenido siga alineado de arriba a abajo. */
  body > main { padding: var(--px-space-8) var(--px-space-8) var(--px-space-16); }
  header nav { padding-inline: var(--px-space-8); }
  footer .px-footer__inner {
    padding-inline: var(--px-space-8);
    grid-template-columns: 2fr 1fr 1fr;   /* marca+tagline · Explora · Legal */
  }
  .footer-bottom__inner { padding-inline: var(--px-space-8); }
  .hero { padding: var(--px-space-16) var(--px-space-12); }
  h1 { font-size: var(--px-text-3xl); }
}


/* =============================================================================
   8 · TEMA OSCURO  ·  overrides de tokens (panel admin aislado)
   -----------------------------------------------------------------------------
   Mismas clases, distinto valor de variables. Activar con
   <body data-theme="dark"> o <div class="admin"> ... </div>
   También responde a prefers-color-scheme cuando se opta con [data-theme="auto"].
   ========================================================================== */
[data-theme="dark"], .admin {
  --px-bg:        #0d1421;
  --px-surface:   #141d2e;
  --px-surface-2: #1b2738;
  --px-surface-3: #233143;

  --px-text:        #e8edf5;
  --px-text-muted:  #aeb9c9;
  --px-text-subtle: #8d99ab;
  --px-text-faint:  #6f7c8f;

  --px-border:        #283449;
  --px-border-soft:   #202c3e;
  --px-border-strong: #354459;

  /* la marca aclara un paso para mantener contraste sobre fondo oscuro */
  --px-primary-600: #3d86dd;
  --px-primary-700: #5a9ce8;
  --px-primary-800: #7fb0ec;
  --px-primary-50:  #16243a;
  --px-primary-100: #1c2f4c;
  --px-primary-200: #2a4a72;
  --px-primary-300: #34598c;
  --px-text-on-brand: #08182e;

  /* superficies tintadas de estado, recalibradas */
  --px-success-bg: #112a1c; --px-success-border: #1f5236; --px-success-text: #74d99b;
  --px-danger-bg:  #2c1414; --px-danger-border:  #5a2626; --px-danger-text:  #f1a3a3;
  --px-warning-bg: #2c2410; --px-warning-border: #5a4a1c; --px-warning-text: #f0c873;
  --px-info-bg:    #14233a; --px-info-border:    #294a72; --px-info-text: #8fc0f5;

  --px-category-bg: #16243a; --px-category-text: #8fc0f5; --px-category-border: #294a72;

  --px-focus-ring: 0 0 0 3px rgba(90, 156, 232, 0.75); /* ≥3:1 sobre superficies oscuras */

  --px-shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --px-shadow-md: 0 4px 14px rgba(0,0,0,0.45);
  --px-shadow-lg: 0 14px 36px rgba(0,0,0,0.55);

  color: var(--px-text);
  background: var(--px-bg);
}


/* =============================================================================
   · ACCESIBILIDAD · prefers-reduced-motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}