/* ============================================================================
   Nido Salud — LOS AVISOS EMERGENTES, en TODAS las páginas: la web pública (layouts/site_head.php, DELANTE de la hoja
   del tema: un tema puede cambiar cómo se ven) y las privadas (layouts/head.php). La ÚNICA copia (hasta el 2026-11-24
   estaba también al final de app.css). Primero, lo que los avisos heredaban de app.css (la caja, la letra del botón de
   cerrar).
   ============================================================================ */
.toast-host, .toast-host * { box-sizing: border-box; }
.toast__close { font: inherit; cursor: pointer; }

/* ============================================================================
   AVISOS EMERGENTES (toasts), en todas las páginas: abajo a la derecha, cada tipo con su color, como los de DuDoctor
   (lo pidió Pablo el 2026-11-24). Un cristal claro teñido del color de su tipo, con su borde fino y su símbolo en un
   círculo de ese color (✓, !, ✕, i: el tipo no lo dice solo el color). Los crea Nido.toast() (ui.js) y los de un solo
   uso del servidor, layouts/flash.php, en #toastHost.
   ============================================================================ */
.toast-host {
  position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 2000;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  width: min(440px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  --toast-c: #1d4ed8;
  display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box;
  padding: 12px; border: 1px solid color-mix(in srgb, var(--toast-c) 28%, transparent); border-radius: 14px;
  background: color-mix(in srgb, var(--toast-c) 10%, rgba(255, 255, 255, .9));
  color: #262d3f; font: 500 14px/1.45 'DM Sans', sans-serif;
  box-shadow: 0 10px 30px rgba(38, 45, 63, .16), 0 2px 6px rgba(38, 45, 63, .06);
  -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
  pointer-events: auto; animation: nido-toast .3s ease; transition: opacity .3s ease, transform .3s ease;
}
.toast::before {
  content: "i"; flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--toast-c); color: #fff; font-size: 13px; font-weight: 800; line-height: 1;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--toast-c) 14%, transparent);
}
.toast--ok   { --toast-c: #15803d; }
.toast--warn { --toast-c: #b45309; }
.toast--err  { --toast-c: #b91c1c; }
.toast--info { --toast-c: #1d4ed8; }
.toast--ok::before   { content: "\2713"; }
.toast--warn::before { content: "!"; }
.toast--err::before  { content: "\2715"; font-size: 12px; }
.toast__msg { flex: 1; min-width: 0; padding: 4px 0; overflow-wrap: anywhere; }
.toast__close {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  margin: -8px -8px -8px 0; padding: 0; border: 0; border-radius: 8px; background: none; color: inherit;
  font-size: 22px; line-height: 1; opacity: .7; cursor: pointer;
}
.toast__close:hover { opacity: 1; background: color-mix(in srgb, var(--toast-c) 12%, transparent); }
.toast__close:focus-visible { outline: 2px solid var(--toast-c); outline-offset: -2px; }
html:not(.js) .toast__close { display: none; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
@keyframes nido-toast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .toast-host { right: 16px; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: auto; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; transition: none; } }
