/* ==========================================================================
   luckyrabbit. — NEO-TOKYO BOUTIQUE · Design Tokens + Base
   Archivo compartido por index / rastreo / politicas / cuenta.
   Regla de oro: el acento magenta y el cian SOLO en CTA, estados activos y foco.
   ========================================================================== */

:root {
  /* ==========================================================================
     PASO 1: PALETA DE COLORES CYBERPUNK (VARIABLES CSS :root)
     ========================================================================== */
  --bg-primary: #0D0714;                        /* Fondo principal nocturno profundo */
  --bg-card: rgba(26, 14, 46, 0.85);            /* Fondo de tarjetas y paneles con glassmorphism */
  --bg-accent-green: #1E5E3A;                   /* Verde oscuro para etiquetas secundarias */
  --neon-green: #39FF88;                        /* Acento principal, bordes activos, luces neón y botones principales */
  --neon-purple: #B829E3;                       /* Acento secundario, bordes de tarjetas y resplandores */
  --gold-accent: #F0B840;                       /* Precios, títulos destacados y badges importantes */
  --text-primary: #F5F5F7;                      /* Texto blanco humo de alta legibilidad */
  --text-muted: #B0A3C4;                        /* Texto secundario y descripciones */

  /* ---- Color: superficies y capas glassmorphism ---- */
  --c-bg: var(--bg-primary);
  --c-surface-1: var(--bg-card);                /* tarjetas, paneles */
  --c-surface-2: rgba(36, 18, 62, 0.85);        /* inputs, elementos elevados */
  --c-surface-3: rgba(48, 24, 82, 0.90);        /* hover */
  --c-overlay: rgba(13, 7, 20, 0.88);
  --c-glass: rgba(13, 7, 20, 0.88);

  /* ---- Color: líneas HUD & bordes neón ---- */
  --c-line: rgba(184, 41, 227, 0.22);
  --c-line-strong: rgba(184, 41, 227, 0.45);

  /* ---- Color: acentos Cyberpunk ---- */
  --c-accent: var(--neon-green);                /* Neón verde · CTA / activo */
  --c-accent-hover: #5eff9f;
  --c-accent-soft: rgba(57, 255, 136, 0.14);
  --c-accent-line: rgba(57, 255, 136, 0.55);
  --c-accent-ink: #07190e;                      /* texto sobre verde neón */
  --c-cyan: var(--neon-green);
  --c-cyan-soft: rgba(57, 255, 136, 0.15);

  /* ---- Color: texto con alta legibilidad ---- */
  --c-text: var(--text-primary);
  --c-text-2: var(--text-muted);
  --c-text-3: #8a7c9f;

  /* ---- Color: semánticos ---- */
  --c-success: var(--neon-green);
  --c-success-soft: rgba(57, 255, 136, 0.15);
  --c-danger: #FB7185;
  --c-danger-soft: rgba(251, 113, 133, 0.12);
  --c-warning: var(--gold-accent);

  /* ---- Tipografía ---- */
  --f-display: 'Orbitron', 'Rajdhani', 'Space Grotesk', sans-serif;
  --f-cyber: 'Orbitron', 'Rajdhani', sans-serif;
  --f-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --fs-2xs: 0.6875rem;                          /* 11px · etiquetas mono */
  --fs-xs: 0.75rem;                             /* 12px */
  --fs-sm: 0.875rem;                            /* 14px */
  --fs-md: 1rem;                                /* 16px */
  --fs-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --fs-xl: clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
  --fs-2xl: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-body: 1.55;
  --tracking-label: 0.14em;

  /* ---- Espaciado (escala 4px) ---- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;
  --s-10: 72px;

  /* ---- Radios ---- */
  --r-0: 0;
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 8px;
  --r-card: 14px;
  --r-full: 999px;

  /* ---- Sombras / glow neón ---- */
  --sh-1: 0 1px 0 rgba(184, 41, 227, 0.08) inset, 0 8px 24px rgba(0, 0, 0, 0.45);
  --sh-2: 0 24px 64px rgba(0, 0, 0, 0.75);
  --glow-accent: 0 0 0 1px var(--c-accent-line), 0 0 20px rgba(57, 255, 136, 0.35);
  --glow-purple: 0 0 0 1px rgba(184, 41, 227, 0.5), 0 0 22px rgba(184, 41, 227, 0.35);
  --glow-green: 0 0 18px rgba(57, 255, 136, 0.55);
  --glow-gold: 0 0 16px rgba(240, 184, 64, 0.45);
  --glow-cyan: var(--glow-green);

  /* ---- Capas ---- */
  --z-base: 1;
  --z-header: 100;
  --z-floating: 90;
  --z-drawer: 1000;
  --z-toast: 1200;
  --z-gate: 2500;

  /* ---- Movimiento ---- */
  --t-fast: 200ms;
  --t-base: 280ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* ---- Layout ---- */
  --w-shell: 1280px;
  --h-header: 60px;
  --tap: 44px;

  /* ---- Compatibilidad con tokens legacy ---- */
  --bg-secondary: rgba(26, 14, 46, 0.95);
  --bg-surface: var(--bg-card);
  --bg-surface-elevated: var(--c-surface-2);
  --bg-jacket-accent: var(--bg-accent-green);
  --text-secondary: var(--text-muted);
  --lime-accent: var(--neon-green);
  --emerald: var(--neon-green);
  --emerald-soft: rgba(57, 255, 136, 0.15);
  --danger: var(--c-danger);
  --font-heading: var(--f-display);
  --font-cyber: var(--f-cyber);
  --font-body: var(--f-body);
  --radius-card: var(--r-card);
  --radius-pill: var(--r-full);

  color-scheme: dark;
}

/* ==========================================================================
   RESET
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Grid HUD de fondo: capa fija compuesta (no repinta al hacer scroll) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(184, 41, 227, 0.15), transparent 70%),
    linear-gradient(rgba(237, 233, 242, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 233, 242, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}

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

svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  -webkit-appearance: none;
  appearance: none;
}

button {
  cursor: pointer;
  user-select: none;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.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;
}

::selection {
  background: var(--c-accent);
  color: var(--c-accent-ink);
}

/* ==========================================================================
   FOCO VISIBLE (cian) — accesibilidad teclado
   ========================================================================== */
:focus {
  outline: none;
}

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

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: 0;
}

.skip-link {
  position: absolute;
  left: var(--s-3);
  top: -100px;
  z-index: calc(var(--z-gate) + 1);
  padding: var(--s-2) var(--s-4);
  background: var(--c-accent);
  color: var(--c-accent-ink);
  font-weight: 600;
  border-radius: var(--r-2);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--s-3);
}

/* ==========================================================================
   PRIMITIVAS COMPARTIDAS
   ========================================================================== */

/* Etiqueta HUD mono */
.hud-label {
  font-family: var(--f-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--c-text-3);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap);
  padding: 0 var(--s-5);
  border-radius: var(--r-2);
  border: 1px solid var(--c-line-strong);
  color: var(--c-text);
  font-family: var(--f-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.btn:hover {
  border-color: var(--c-accent-line);
  box-shadow: var(--glow-accent);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-accent-ink);
}

.btn--primary:hover {
  background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
}

.btn--primary:disabled {
  background: var(--c-surface-3);
  border-color: var(--c-line);
  color: var(--c-text-3);
  box-shadow: none;
  transform: none;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 36px;
  padding: 0 var(--s-3);
  font-size: var(--fs-xs);
}

/* Inputs */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.field-label,
.form-label {
  font-family: var(--f-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-2);
}

.dark-input,
.input {
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--s-3);
  background: var(--c-surface-2);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-2);
  color: var(--c-text);
  font-size: var(--fs-md); /* 16px evita zoom en iOS */
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

select.dark-input,
select.input {
  padding-right: var(--s-7);
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-text-2) 50%),
    linear-gradient(135deg, var(--c-text-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

select.dark-input:disabled {
  cursor: default;
  color: var(--c-text-2);
  opacity: 0.8;
}

.dark-input::placeholder,
.input::placeholder {
  color: var(--c-text-3);
}

.dark-input:focus,
.input:focus {
  border-color: var(--c-cyan);
  box-shadow: 0 0 0 3px var(--c-cyan-soft);
}

.dark-input.error,
.input.error,
.dark-input.is-invalid {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 3px var(--c-danger-soft);
}

/* Panel con esquinas HUD */
.hud-frame {
  position: relative;
}

.hud-frame::before,
.hud-frame::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  border-color: var(--c-line-strong);
  border-style: solid;
}

.hud-frame::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.hud-frame::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 1px 1px 0;
}

/* Marca */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--tap);
  text-decoration: none;
  color: var(--c-text);
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-text-logo,
.brand-title {
  font-family: var(--f-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-text);
}

.brand-text-logo .brand-lucky,
.brand-title .brand-lucky {
  color: var(--c-text);
}

.brand-text-logo .brand-dot,
.brand-title .brand-dot {
  color: var(--c-accent);
}

/* Header compartido */
.site-header,
.sticky-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--c-glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--c-line);
}

.site-header::after,
.sticky-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 72px;
  height: 1px;
  background: var(--c-accent);
  opacity: 0.8;
}

/* Footer compartido */
.site-footer {
  margin-top: auto;
  padding: var(--s-8) var(--s-4) calc(var(--s-9) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--c-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-5);
  text-align: center;
}

.footer-links-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-2);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--tap);
  padding: 0 var(--s-4);
  border: 1px solid var(--c-line);
  border-radius: var(--r-2);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}

.footer-link svg {
  width: 16px;
  height: 16px;
}

.footer-link:hover {
  color: var(--c-text);
  border-color: var(--c-accent-line);
  box-shadow: var(--glow-accent);
}

.footer-legal {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  font-size: var(--fs-xs);
  color: var(--c-text-3);
  max-width: 520px;
}

.footer-legal a {
  color: var(--c-text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-legal a:hover {
  color: var(--c-accent);
}

/* ==========================================================================
   MOVIMIENTO REDUCIDO
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
