.noroko-toast-root {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(100vw - 2rem, 22rem);
  pointer-events: none;
}

@media (max-width: 640px) {
  .noroko-toast-root {
    left: 1rem;
    right: 1rem;
    width: auto;
  }
}

.noroko-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(calc(100% + 1.5rem));
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
  overflow: hidden;
  position: relative;
}

.noroko-toast--visible {
  transform: translateX(0);
  opacity: 1;
}

.noroko-toast--leaving {
  transform: translateX(calc(100% + 1.5rem));
  opacity: 0;
}

.noroko-toast__icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.noroko-toast__icon svg {
  width: 1rem;
  height: 1rem;
}

.noroko-toast__body {
  flex: 1;
  min-width: 0;
  padding-top: 0.125rem;
}

.noroko-toast__message {
  font-size: 0.875rem;
  line-height: 1.45;
  color: #1a1a1a;
  font-weight: 500;
}

.noroko-toast__close {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  margin: -0.125rem -0.25rem 0 0;
}

.noroko-toast__close:hover {
  color: #374151;
  background: rgba(0, 0, 0, 0.05);
}

.noroko-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  animation: noroko-toast-progress linear forwards;
}

@keyframes noroko-toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.noroko-toast--success .noroko-toast__icon {
  background: #ecfdf5;
  color: #059669;
}

.noroko-toast--success .noroko-toast__progress {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.noroko-toast--error .noroko-toast__icon {
  background: #fef2f2;
  color: #dc2626;
}

.noroko-toast--error .noroko-toast__progress {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.noroko-toast--warning .noroko-toast__icon {
  background: #fffbeb;
  color: #d97706;
}

.noroko-toast--warning .noroko-toast__progress {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.noroko-toast--info .noroko-toast__icon {
  background: #f5f0e6;
  color: #92700c;
}

.noroko-toast--info .noroko-toast__progress {
  background: linear-gradient(90deg, #b8860b, #c9a227);
}

@media (prefers-reduced-motion: reduce) {
  .noroko-toast {
    transition: opacity 0.2s ease;
    transform: none;
  }

  .noroko-toast--visible,
  .noroko-toast--leaving {
    transform: none;
  }

  .noroko-toast__progress {
    display: none;
  }
}

/* ——— Diálogo confirm / alert ——— */

body.noroko-dialog-open {
  overflow: hidden;
}

.noroko-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.noroko-dialog-root--visible {
  opacity: 1;
  visibility: visible;
}

.noroko-dialog {
  width: min(100%, 24rem);
  background: #faf8f4;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1rem;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.18),
    0 8px 16px rgba(0, 0, 0, 0.08);
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;
  overflow: hidden;
}

.noroko-dialog-root--visible .noroko-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.noroko-dialog__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 0.5rem;
}

.noroko-dialog__icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.noroko-dialog__icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.noroko-dialog__titles {
  flex: 1;
  min-width: 0;
  padding-top: 0.125rem;
}

.noroko-dialog__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.35;
}

.noroko-dialog__message {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #64748b;
}

.noroko-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.25rem;
}

.noroko-dialog__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.noroko-dialog__btn--cancel {
  background: #fff;
  border-color: #e2e8f0;
  color: #475569;
}

.noroko-dialog__btn--cancel:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.noroko-dialog__btn--confirm {
  background: #1a1a1a;
  color: #f2efe9;
}

.noroko-dialog__btn--confirm:hover {
  background: #333;
}

.noroko-dialog__btn--danger {
  background: #dc2626;
  color: #fff;
}

.noroko-dialog__btn--danger:hover {
  background: #b91c1c;
}

.noroko-dialog--warning .noroko-dialog__icon {
  background: #fffbeb;
  color: #d97706;
}

.noroko-dialog--danger .noroko-dialog__icon {
  background: #fef2f2;
  color: #dc2626;
}

.noroko-dialog--info .noroko-dialog__icon {
  background: #f5f0e6;
  color: #92700c;
}

@media (prefers-reduced-motion: reduce) {
  .noroko-dialog {
    transform: none;
    transition: opacity 0.2s ease;
  }

  .noroko-dialog-root--visible .noroko-dialog {
    transform: none;
  }
}
