/* ═══════════════════════════════════════════════════════════
   MODALS & DIALOGS
═══════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  z-index: 1000;
  animation: fade-in 0.2s ease-out;
}

.modal {
  background: var(--bg-1);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slide-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
  transition:
    background-color var(--transition-colors),
    color var(--transition-colors);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--bg-2);
  color: var(--text);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-footer .btn {
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════════════════ */

.alert {
  padding: 12px 16px;
  border-radius: 9px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #1e40af;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-warning {
  background: rgba(251, 146, 60, 0.1);
  color: #92400e;
  border: 1px solid rgba(251, 146, 60, 0.2);
}

.alert-error {
  background: rgba(220, 38, 38, 0.1);
  color: #7f1d1d;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

html[data-theme="dark"] .alert-info {
  color: #93c5fd;
}

html[data-theme="dark"] .alert-success {
  color: #86efac;
}

html[data-theme="dark"] .alert-warning {
  color: #fed7aa;
}

html[data-theme="dark"] .alert-error {
  color: #fca5a5;
}

.alert::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
  background: currentColor;
}

/* ═══════════════════════════════════════════════════════════
   TOAST MESSAGES
═══════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-1);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 300px;
  font-size: 13px;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
  color: var(--t-feature);
}

.toast.error {
  border-color: rgba(220, 38, 38, 0.3);
  background: rgba(220, 38, 38, 0.1);
  color: var(--t-bug);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
