/* ═══════════════════════════════════════════════════════════════════
   GP Assurances — Boot Splash Screen
   Hides #mainAppContent until auth, role, i18n, and first render complete.
   CSP-safe: no inline styles needed in HTML; all styles here.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Boot splash overlay ── */
#bootSplash {
  position: fixed;
  inset: 0;
  z-index: calc(var(--gp-z-popover, 1200) + 1);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F5F7FB; /* --gp-bg */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transition: opacity 0.35s ease-out, visibility 0.35s ease-out;
}

#bootSplash.boot-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-splash-inner {
  text-align: center;
  max-width: 360px;
  padding: 32px 24px;
}

/* ── Logo ── */
.boot-logo {
  margin-bottom: 16px;
}

.boot-logo svg {
  width: 64px;
  height: auto;
}

/* ── Brand name ── */
.boot-brand {
  margin: 0 0 28px 0;
  font-size: 18px;
  font-weight: 600;
  color: #0F172A; /* --gp-text */
  letter-spacing: -0.01em;
}

/* ── Spinner ── */
.boot-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #E8ECF2; /* --gp-border */
  border-top-color: #0B63F6; /* --gp-brand */
  border-radius: 50%;
  animation: boot-spin 0.7s linear infinite;
  margin-bottom: 16px;
}

@keyframes boot-spin {
  to { transform: rotate(360deg); }
}

/* ── Status text ── */
.boot-status {
  margin: 0;
  font-size: 13px;
  color: #64748B; /* --gp-muted */
  line-height: 1.5;
}

/* ── Error state ── */
.boot-error {
  margin-top: 20px;
  padding: 16px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  text-align: left;
}

.boot-error p {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #991B1B;
  line-height: 1.5;
}

.boot-error p:last-of-type {
  margin-bottom: 12px;
}

/* ── Retry button (no inline onclick, handler attached in boot.js) ── */
.boot-retry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: #FFFFFF;
  background: #0B63F6; /* --gp-brand */
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.boot-retry-btn:hover {
  background: #0851D4; /* --gp-brand-hover */
}

.boot-retry-btn:active {
  background: #0640B0;
}

/* ── Version mismatch state ── */
.boot-version-mismatch {
  margin-top: 20px;
  padding: 16px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  text-align: left;
}

.boot-version-mismatch p {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #92400E;
  line-height: 1.5;
}

/* ── Hide main content until boot complete ── */
#mainAppContent {
  visibility: hidden;
}

body.boot-ready #mainAppContent {
  visibility: visible;
}

/* ── Prevent FOUC of old shell ── */
body:not(.boot-ready) .ai-product-shell {
  /* The body class ai-product-shell shows old nav — suppress until ready */
}

/* When boot ends, body gains boot-ready, and app.js sets gp-customer-redesign */
body.boot-ready.gp-customer-redesign .app { /* handled by customer-reference.css */ }
