/* Avisos do aplicativo (pwa.js): nova versão e estado da conexão.
 *
 * Mesma pilha e mesmo desenho dos avisos do sino em header-fix.css
 * (`.notification-toast-stack` / `.notification-toast`). Arquivo próprio
 * porque o Portal do Cliente e a página offline não carregam styles.css nem
 * header-fix.css, e os avisos precisam existir em toda tela. */

.pwa-toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  display: grid;
  gap: 8px;
  width: min(330px, calc(100vw - 32px));
  pointer-events: none;
}

.pwa-toast {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(2, 12, 27, 0.34);
  font: inherit;
  text-align: left;
  pointer-events: auto;
}

.pwa-toast svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--cyan);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pwa-toast[data-pwa-toast="offline"] svg { color: var(--warning); }
.pwa-toast[data-pwa-toast="online"] svg { color: var(--green); }

.pwa-toast-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pwa-toast strong { font-size: 12px; }

.pwa-toast small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.pwa-toast-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.pwa-toast-action {
  min-height: 36px;
  padding: 0 14px;
  color: var(--cyan);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--cyan) 45%, var(--line));
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 120ms ease, filter 120ms ease;
}

.pwa-toast-action:hover { background: color-mix(in srgb, var(--cyan) 12%, transparent); }
.pwa-toast-action.is-primary { color: #fff; background: var(--cyan); border-color: var(--cyan); }
.pwa-toast-action.is-primary:hover { filter: brightness(1.08); }

.pwa-toast-action:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.pwa-toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms ease, transform 200ms ease;
}

/* O selo de versão (`.app-version`, em styles.css) é fixo no mesmo canto e um
   aviso que espera resposta ficaria em cima dele. A coluna sobe enquanto o
   aviso existir, e só onde o selo realmente flutua: no toque ele já deixa de
   ser fixo. Mesma regra de `.has-push-prompt` em header-fix.css. */
@media not all and (pointer: coarse) {
  .notification-toast-stack.has-pwa-toast { bottom: 64px; }
}

html[data-theme="light"] .pwa-toast {
  background: #fff;
  border-color: #b9d7e5;
  box-shadow: 0 16px 38px rgba(35, 78, 105, 0.2);
}

@media (max-width: 760px) {
  .pwa-toast-stack {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }
}
