/* SMAU FILE
 * Path: css/smau-bootErrorCard.css
 * Owns: Boot error card visuals (loader failure summary UI)
 * Touches: #boot-error-card subtree only
 * No: JS state/logic, routing, overlays, notifications
 * Truth:
 *   - data-state="open" shows
 *   - anything else is closed
 * Safety:
 *   - [aria-hidden="true"] always wins (force hidden)
 * Gesture safety:
 *   - when closed, must not create dead zones (touch-action pan/pinch)
 */

:root{
  --boot-err-radius: 18px;
  --boot-err-pad: 14px;
  --boot-err-gap: 10px;

  --boot-err-surface: rgba(12, 14, 22, 0.86);
  --boot-err-surface-2: rgba(18, 20, 30, 0.92);
  --boot-err-stroke: rgba(255, 255, 255, 0.10);
  --boot-err-stroke-2: rgba(255, 255, 255, 0.16);

  --boot-err-text: rgba(255,255,255,0.92);
  --boot-err-muted: rgba(255,255,255,0.68);

  --boot-err-critical: rgba(255, 79, 102, 0.95);
  --boot-err-warn: rgba(255, 196, 79, 0.95);

  --boot-err-shadow: 0 18px 40px rgba(0,0,0,0.50);
  --boot-err-shadow-2: 0 6px 16px rgba(0,0,0,0.35);

  --boot-err-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --boot-err-sans: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;

  --boot-err-glow: 0 0 0 1px rgba(255,255,255,0.04), 0 0 40px rgba(255, 79, 102, 0.08);
}

#boot-error-card{
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--boot-err-gap);
  padding: var(--boot-err-pad);
  border-radius: var(--boot-err-radius);
  background: linear-gradient(180deg, var(--boot-err-surface), var(--boot-err-surface-2));
  border: 1px solid var(--boot-err-stroke);
  box-shadow: var(--boot-err-shadow), var(--boot-err-glow);
  color: var(--boot-err-text);
  font-family: var(--boot-err-sans);

  transform: translateY(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  /* closed must not block gestures */
  touch-action: pan-x pan-y pinch-zoom;
}

#boot-error-card[data-state="open"]{
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  /* open is an interactive surface */
  touch-action: manipulation;
}

#boot-error-card[aria-hidden="true"]{
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  touch-action: pan-x pan-y pinch-zoom !important;
}

@media (prefers-reduced-motion: no-preference){
  #boot-error-card{
    transition:
      transform 240ms ease,
      opacity 240ms ease,
      visibility 0ms linear 240ms;
  }
  #boot-error-card[data-state="open"]{
    transition:
      transform 240ms ease,
      opacity 240ms ease,
      visibility 0ms linear 0ms;
  }
}

#boot-error-card .boot-error-head{
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

#boot-error-card .boot-error-badge{
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--boot-err-stroke-2);
  background: rgba(255,255,255,0.06);
  box-shadow: var(--boot-err-shadow-2);
}

#boot-error-card[data-severity="critical"] .boot-error-badge{
  border-color: rgba(255, 79, 102, 0.35);
  background: rgba(255, 79, 102, 0.12);
}

#boot-error-card[data-severity="warn"] .boot-error-badge{
  border-color: rgba(255, 196, 79, 0.35);
  background: rgba(255, 196, 79, 0.12);
}

#boot-error-card .boot-error-titlewrap{
  display: grid;
  gap: 3px;
  min-width: 0;
}

#boot-error-card .boot-error-title{
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 14px;
  line-height: 1.2;
}

#boot-error-card .boot-error-subtitle{
  font-size: 12px;
  color: var(--boot-err-muted);
  line-height: 1.35;
}

#boot-error-card .boot-error-divider{
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.00), rgba(255,255,255,0.14), rgba(255,255,255,0.00));
}

#boot-error-card .boot-error-details{
  margin: 0;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  font-family: var(--boot-err-mono);
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255,255,255,0.84);
  white-space: pre-wrap;
  word-break: break-word;

  /* keep report readable without making this a gesture trap */
  overflow: auto;
  max-height: 240px;
  overscroll-behavior: contain;
}

#boot-error-card .boot-error-details .line{
  display: block;
  padding: 2px 0;
}

#boot-error-card .boot-error-details .tag{
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.86);
  font-size: 10px;
  letter-spacing: 0.2px;
  vertical-align: 1px;
}

#boot-error-card .boot-error-details .tag.critical{
  border-color: rgba(255, 79, 102, 0.35);
  background: rgba(255, 79, 102, 0.12);
  color: rgba(255, 188, 198, 0.98);
}

#boot-error-card .boot-error-details .tag.optional{
  border-color: rgba(255, 196, 79, 0.35);
  background: rgba(255, 196, 79, 0.12);
  color: rgba(255, 225, 170, 0.98);
}

#boot-error-card .boot-error-actions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

#boot-error-card .boot-error-btn{
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.15px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#boot-error-card .boot-error-btn:active{
  transform: translateY(1px);
}

#boot-error-card .boot-error-btn.primary{
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
}

#boot-error-card[data-severity="critical"] .boot-error-btn.primary{
  border-color: rgba(255, 79, 102, 0.45);
  background: rgba(255, 79, 102, 0.14);
}

#boot-error-card .boot-error-btn:focus{
  outline: none;
}

#boot-error-card .boot-error-btn:focus-visible{
  box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
}

@media (max-width: 420px){
  #boot-error-card{
    --boot-err-pad: 12px;
    --boot-err-radius: 16px;
  }
  #boot-error-card .boot-error-actions{
    justify-content: stretch;
  }
  #boot-error-card .boot-error-btn{
    flex: 1 1 0;
    text-align: center;
  }
}