/* css/boot.css — splash de arranque (app.html) + ocultación de ligaduras de iconos.
   Se carga antes que el resto del CSS; trae sus propios tokens porque base.css
   aún no está disponible en el primer pintado. */
:root {
  --boot-bg: #f8fafc;
  --boot-text: #0f172a;
  --boot-muted: #64748b;
  --boot-track: rgba(15, 23, 42, 0.08);
  --boot-accent: #3b82f6;
  --boot-on-accent: #ffffff;
}
html.dark-theme {
  --boot-bg: #07111f;
  --boot-text: #f8fafc;
  --boot-muted: #94a3b8;
  --boot-track: rgba(255, 255, 255, 0.1);
}
html { background: var(--boot-bg); }

.mex-boot {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 16px;
  background: var(--boot-bg); color: var(--boot-text);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  transition: opacity 200ms ease;
}
.mex-boot.is-leaving { opacity: 0; pointer-events: none; }
.mex-boot-logo { display: block; width: 64px; height: 64px; border-radius: 16px; }
/* Anillo que gira alrededor del logo: solo transform → corre en el compositor y no se
   congela mientras el hilo principal carga la app. Un pseudo-elemento no entra en
   `.mex-boot *` de movimiento reducido: indicador de carga esencial, gira igual. */
.mex-boot-mark { position: relative; margin: 8px; }
.mex-boot-mark::after {
  content: ''; position: absolute; inset: -8px; border-radius: 9999px;
  border: 3px solid var(--boot-track); border-top-color: var(--boot-accent);
  animation: mexBootSpin 900ms linear infinite;
}
.mex-boot-title { min-height: 20px; font-size: 13px; font-weight: 600; color: var(--boot-muted); text-align: center; }
.mex-boot-sub { max-width: 320px; font-size: 12px; line-height: 1.4; color: var(--boot-muted); text-align: center; }
.mex-boot-sub:empty { display: none; }
/* Arranque mudo: solo logo con anillo; el texto solo explica un error. */
.mex-boot:not(.is-error) :is(.mex-boot-title, .mex-boot-sub) { display: none; }
.mex-boot-retry {
  display: none; min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 8px;
  background: var(--boot-accent); color: var(--boot-on-accent);
  font: 600 14px Inter, system-ui, sans-serif; cursor: pointer;
}
.mex-boot.is-error .mex-boot-retry { display: inline-flex; align-items: center; }
.mex-boot.is-error .mex-boot-mark::after { display: none; }
.mex-boot.is-error .mex-boot-title { font-size: 15px; color: var(--boot-text); }

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

/* Movimiento reducido: sin animación ni fundido (documentado: gana a todo). */
html.reduce-motion .mex-boot, html.reduce-motion .mex-boot * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .mex-boot, .mex-boot * { animation: none !important; transition: none !important; }
}

/* Ligaduras de iconos ocultas hasta que SU fuente cargó (boot-prefs.js marca
   html.ms-ready / html.mi-ready). Si la fuente falla, nunca se ve el texto.
   Sin cambiar display → sin saltos de layout cuando la fuente llega.
   Lista = selectores con font-family Material Symbols / Material Icons en css/ (grep).
   !important documentado: debe ganar a colores inline de las vistas. */
html:not(.ms-ready) :is(
  .material-symbols-outlined,
  .mex-sheet-tile-icon, .mex-nav-item-icon, .mex-nav-item-arrow, .mex-profile-avatar-icon,
  .mex-logout-icon, .mex-header-search-icon, .mex-header-menu-btn-icon, .mex-plaza-picker-caret,
  .mex-plaza-pick-check, .mex-hdr-icon, .mex-header-avatar-icon, .mex-bottomnav-icon,
  .mex-nav-group-chevron
) {
  max-width: 1em; overflow: hidden; white-space: nowrap; color: transparent !important;
}
html:not(.mi-ready) :is(.material-icons, .app-mapa-search-ic) {
  max-width: 1em; overflow: hidden; white-space: nowrap; color: transparent !important;
}
html:not(.ms-ready) .mex-sidebar .mex-nav-item:not(:has(.mex-nav-item-arrow))::after,
html:not(.ms-ready) .quote-card.is-selected::after,
html:not(.ms-ready) .tu-gate-facescan__intro-card li::before { color: transparent !important; }

/* App instalada (PWA): sin rebote ni pull-to-refresh accidental. En el navegador
   normal se conserva. En algunas versiones de iOS WebKit puede ignorarlo. */
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }
}
