/* ============================================================
   base.css — Design tokens (colores, tipografía, espacios)
   y estilos generales de MZ ADpersonam.
   Cambiar un color aquí lo cambia en toda la app.
   ============================================================ */

/* ---------- Paleta 1 (por defecto): "Tinta + Oro sastre" ---------- */
:root,
:root[data-paleta="oro"] {
  --fondo: #0C0D14;
  --superficie: #161825;
  --superficie-2: #1E2132;
  --borde: #262938;
  --borde-fuerte: #363A4E;
  --texto: #F4F1EA;
  --texto-2: #A29E95;
  --acento: #E8B04B;
  --acento-hover: #F0C06A;
  --acento-texto: #1A1405;          /* texto encima del acento */
  --acento-suave: rgb(232 176 75 / .14);
  --info: #6E7BFF;
  --exito: #4CC38A;
  --error: #FF6B6B;
  --brillo: rgb(232 176 75 / .18); /* halos sutiles */
}

/* ---------- Paleta 2: "Grafito + Lima eléctrica" ---------- */
:root[data-paleta="lima"] {
  --fondo: #0E0F12;
  --superficie: #17191F;
  --superficie-2: #1F2229;
  --borde: #272B34;
  --borde-fuerte: #383D48;
  --texto: #F2F3F5;
  --texto-2: #9AA0AB;
  --acento: #C6F24E;
  --acento-hover: #D4F76F;
  --acento-texto: #141A05;
  --acento-suave: rgb(198 242 78 / .13);
  --info: #7AA2FF;
  --exito: #4CC38A;
  --error: #FF6B6B;
  --brillo: rgb(198 242 78 / .16);
}

/* ---------- Tokens que no cambian con la paleta ---------- */
:root {
  color-scheme: dark;

  --fuente: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Escala de espacios (múltiplos de 4px) */
  --esp-1: 4px;  --esp-2: 8px;  --esp-3: 12px; --esp-4: 16px;
  --esp-5: 20px; --esp-6: 24px; --esp-8: 32px; --esp-10: 40px; --esp-12: 48px;

  /* Tamaños de texto */
  --txt-xs: .75rem; --txt-sm: .875rem; --txt-md: 1rem;
  --txt-lg: 1.125rem; --txt-xl: 1.375rem; --txt-2xl: 1.75rem; --txt-3xl: 2.25rem;

  /* Bordes redondeados */
  --radio-sm: 8px; --radio-md: 12px; --radio-lg: 18px; --radio-xl: 24px; --radio-total: 999px;

  /* Sombras */
  --sombra-1: 0 1px 2px rgb(0 0 0 / .35);
  --sombra-2: 0 8px 24px rgb(0 0 0 / .35);
  --sombra-3: 0 18px 48px rgb(0 0 0 / .5);

  /* Movimiento */
  --curva: cubic-bezier(.2, .8, .2, 1);
  --rapido: 150ms;
  --medio: 260ms;

  /* Medidas de la navegación */
  --alto-nav: 64px;
  --ancho-lateral: 248px;
  --alto-cabecera: 56px;

  /* Zonas seguras del iPhone (muesca y barra de inicio) */
  --seguro-arriba: env(safe-area-inset-top, 0px);
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: var(--txt-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.01em; font-weight: 700; }

/* Foco visible solo con teclado (accesibilidad) */
:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
  border-radius: var(--radio-sm);
}

/* "hidden" siempre oculta, aunque el elemento tenga otro display (ej. .boton) */
[hidden] { display: none !important; }

/* Texto solo para lectores de pantalla */
.solo-lector {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Transición suave al cambiar de paleta */
body, .tarjeta, .nav-principal, .cabecera {
  transition: background-color var(--medio) ease, border-color var(--medio) ease, color var(--medio) ease;
}

/* Respeta a quien pidió menos movimiento en su teléfono */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
