/* Modals and toasts (public/assets/js/ui-dialogs.js). Self-contained colours, so they
   look the same on the public site and the dashboard. */

.ui-modal {
  width: min(27rem, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #1f1416;
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  box-shadow: 0 24px 60px -20px rgba(43, 6, 9, 0.55), 0 0 0 1px rgba(43, 6, 9, 0.06);
}
.ui-modal[open] { animation: ui-pop 160ms ease-out; }
.ui-modal::backdrop { background: rgba(31, 20, 22, 0.5); }
.ui-modal__body { display: flex; gap: 0.9rem; padding: 1.4rem 1.4rem 1rem; }
.ui-modal__icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fbf1dc; color: #8a5300; }
.ui-modal--danger .ui-modal__icon { background: #fbe6e6; color: #9b2226; }
.ui-modal__text { min-width: 0; }
.ui-modal__title { margin: 0.35rem 0 0; font-size: 1.05rem; font-weight: 700; line-height: 1.35; color: #1f1416; overflow-wrap: anywhere; }
.ui-modal__message { margin: 0.4rem 0 0; font-size: 0.92rem; line-height: 1.5; color: #5d4f52; }
.ui-modal__actions { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 0.9rem 1.4rem 1.2rem; }

.ui-btn { min-height: 42px; padding: 0 1.1rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.ui-btn:focus-visible { outline: 3px solid rgba(217, 161, 43, 0.6); outline-offset: 2px; }
.ui-btn--ghost { background: #fff; border-color: #ece3dd; color: #3b2b2e; }
.ui-btn--ghost:hover { background: #f7f3ef; }
.ui-btn--primary { background: #4a0a10; color: #fff; }
.ui-btn--primary:hover { background: #64141c; }
.ui-btn--danger { background: #9b2226; }
.ui-btn--danger:hover { background: #7f1b1f; }

.ui-toasts { position: fixed; top: 76px; right: 20px; z-index: 2000; display: grid; gap: 0.5rem; width: min(24rem, calc(100vw - 32px)); pointer-events: none; }
.ui-toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.8rem 0.6rem 0.8rem 0.9rem; border-radius: 12px; background: #fff; color: #1f1416; font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); font-size: 0.9rem; line-height: 1.45; box-shadow: 0 18px 40px -18px rgba(43, 6, 9, 0.45), 0 0 0 1px #ece3dd; animation: ui-slide 200ms ease-out; }
.ui-toast.is-leaving { opacity: 0; transform: translateX(12px); transition: opacity 160ms ease, transform 160ms ease; }
.ui-toast__icon { flex: none; margin-top: 1px; }
.ui-toast--success .ui-toast__icon { color: #1f6a3a; }
.ui-toast--error .ui-toast__icon { color: #9b2226; }
.ui-toast--info .ui-toast__icon { color: #8a5300; }
.ui-toast__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ui-toast__close { flex: none; width: 28px; height: 28px; margin: -4px 0 -4px 0; border: 0; border-radius: 8px; background: transparent; color: #75676a; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.ui-toast__close:hover { background: #f3ece7; color: #1f1416; }

@keyframes ui-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes ui-slide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .ui-toasts { top: auto; bottom: 16px; right: 16px; }
  .ui-modal__actions { flex-direction: column-reverse; }
  .ui-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ui-modal[open], .ui-toast { animation: none; }
  .ui-toast.is-leaving { transition: none; }
}
