/* =====================================================================
   ChatzyBot alert theme — styles every SweetAlert2 popup and toast
   (user panel, admin panel, login / sign-up). Load AFTER sweetalert2.
   ===================================================================== */
:root {
  --cza-blue: #4a98d3;
  --cza-blue-dark: #1d6fa8;
  --cza-navy: #0f141e;
  --cza-text: #0f172a;
  --cza-muted: #64748b;
  --cza-line: #e2e8f0;
  --cza-green: #16a34a;
  --cza-red: #dc2626;
  --cza-amber: #d97706;
}

/* Backdrop */
/* Backdrop only for real dialogs — never for toasts (they use a transparent container) */
body:not(.swal2-toast-shown) .swal2-container.swal2-backdrop-show,
body:not(.swal2-toast-shown) .swal2-container.swal2-noanimation {
  background: rgba(15, 20, 30, .55) !important;
  backdrop-filter: blur(4px);
}
body.swal2-toast-shown .swal2-container { background: transparent !important; backdrop-filter: none !important; pointer-events: none; }
body.swal2-toast-shown .swal2-container .swal2-popup { pointer-events: auto; }
.swal2-container { z-index: 99999 !important; }
body:not(.swal2-toast-shown) .swal2-container { padding: 16px !important; }

/* Popup card */
.swal2-popup:not(.swal2-toast) {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif !important;
  width: min(440px, 100%) !important;
  padding: 28px 28px 24px !important;
  border-radius: 20px !important;
  background: #fff !important;
  color: var(--cza-text) !important;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .35), 0 0 0 1px rgba(15, 23, 42, .04) !important;
}
.swal2-popup:not(.swal2-toast) .swal2-title {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: var(--cza-text) !important;
  padding: 4px 0 0 !important;
  margin: 0 !important;
}
.swal2-popup:not(.swal2-toast) .swal2-html-container {
  font-size: .94rem !important;
  line-height: 1.6 !important;
  color: var(--cza-muted) !important;
  margin: 10px 0 0 !important;
  padding: 0 !important;
}

/* Icons: smaller, softer, tinted circle instead of a thin ring */
.swal2-popup:not(.swal2-toast) .swal2-icon {
  width: 64px !important; height: 64px !important;
  margin: 0 auto 14px !important;
  border-width: 0 !important;
  font-size: 13px !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon .swal2-icon-content { font-size: 2.4rem !important; font-weight: 700; }
.swal2-icon.swal2-success { background: #dcfce7 !important; }
.swal2-icon.swal2-success [class^=swal2-success-line] { background-color: var(--cza-green) !important; }
.swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(22, 163, 74, .25) !important; }
.swal2-icon.swal2-success .swal2-success-circular-line-left,
.swal2-icon.swal2-success .swal2-success-circular-line-right,
.swal2-icon.swal2-success .swal2-success-fix { background: transparent !important; }
.swal2-icon.swal2-error { background: #fee2e2 !important; }
.swal2-icon.swal2-error [class^=swal2-x-mark-line] { background-color: var(--cza-red) !important; }
.swal2-icon.swal2-warning { background: #fef3c7 !important; color: var(--cza-amber) !important; }
.swal2-icon.swal2-info { background: #dbeafe !important; color: var(--cza-blue-dark) !important; }
.swal2-icon.swal2-question { background: #e0f2fe !important; color: var(--cza-blue-dark) !important; }

/* Buttons — default (styled) and our own .swal2-btn classes */
.swal2-popup:not(.swal2-toast) .swal2-actions {
  gap: 10px !important;
  margin: 22px 0 0 !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}
.swal2-popup:not(.swal2-toast) .swal2-actions button {
  flex: 1 1 0;
  margin: 0 !important;
  min-height: 44px !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-radius: 12px !important;
  font: 600 .92rem/1 'Inter', system-ui, sans-serif !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, background .15s ease !important;
}
.swal2-popup .swal2-actions button:hover { transform: translateY(-1px); }
.swal2-popup .swal2-actions button:focus-visible { outline: 3px solid rgba(74, 152, 211, .35) !important; outline-offset: 2px; }
.swal2-popup .swal2-confirm,
.swal2-popup .swal2-btn-confirm,
.swal2-popup .confirm-btn-modern {
  background: linear-gradient(135deg, var(--cza-blue) 0%, var(--cza-blue-dark) 100%) !important;
  color: #fff !important;
}
.swal2-popup .swal2-cancel,
.swal2-popup .swal2-btn-cancel,
.swal2-popup .cancel-btn-modern {
  background: #f1f5f9 !important;
  color: #334155 !important;
}
.swal2-popup .swal2-cancel:hover { background: #e2e8f0 !important; }
.swal2-popup .swal2-deny { background: #fee2e2 !important; color: var(--cza-red) !important; }
/* Destructive confirms (warning / error popups with a Cancel button) turn red */
.swal2-popup.swal2-icon-warning .swal2-actions .swal2-cancel ~ .swal2-confirm,
.swal2-popup.swal2-icon-warning .swal2-actions .swal2-confirm:not(:only-child),
.swal2-popup.swal2-icon-error .swal2-actions .swal2-confirm:not(:only-child) {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
}

/* Inputs inside alerts */
.swal2-popup .swal2-input,
.swal2-popup .swal2-textarea,
.swal2-popup .swal2-select {
  width: 100% !important;
  margin: 16px 0 0 !important;
  border: 1.5px solid var(--cza-line) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  font: 400 .95rem 'Inter', system-ui, sans-serif !important;
  height: 46px;
  padding: 0 14px !important;
}
.swal2-popup .swal2-textarea { height: auto; padding: 12px 14px !important; }
.swal2-popup .swal2-input:focus,
.swal2-popup .swal2-textarea:focus { border-color: var(--cza-blue) !important; box-shadow: 0 0 0 4px rgba(74, 152, 211, .15) !important; }
.swal2-popup .swal2-validation-message { background: #fef2f2 !important; color: var(--cza-red) !important; border-radius: 10px; margin: 12px 0 0 !important; font-size: .85rem !important; }

.swal2-popup .swal2-close { color: #94a3b8 !important; font-size: 1.8rem !important; border-radius: 10px; }
.swal2-popup .swal2-close:hover { color: var(--cza-text) !important; background: #f1f5f9 !important; }
.swal2-popup .swal2-loader { border-color: var(--cza-blue) transparent var(--cza-blue) transparent !important; }
.swal2-timer-progress-bar { background: rgba(74, 152, 211, .55) !important; height: 3px !important; }

/* ---------- Toasts ---------- */
.swal2-popup.swal2-toast {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif !important;
  background: #fff !important;
  color: var(--cza-text) !important;
  border-radius: 14px !important;
  padding: 12px 16px 12px 14px !important;
  border: 1px solid var(--cza-line) !important;
  border-left: 4px solid var(--cza-blue) !important;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, .25) !important;
  max-width: 380px;
}
.swal2-popup.swal2-toast.swal2-icon-success { border-left-color: var(--cza-green) !important; }
.swal2-popup.swal2-toast.swal2-icon-error   { border-left-color: var(--cza-red) !important; }
.swal2-popup.swal2-toast.swal2-icon-warning { border-left-color: var(--cza-amber) !important; }
.swal2-popup.swal2-toast .swal2-title {
  font-size: .9rem !important; font-weight: 600 !important; color: var(--cza-text) !important;
  margin: 0 0 0 10px !important;
}
.swal2-popup.swal2-toast .swal2-html-container { font-size: .84rem !important; color: var(--cza-muted) !important; margin: 2px 0 0 10px !important; }
.swal2-popup.swal2-toast .swal2-icon { margin: 0 !important; width: 2em !important; min-width: 2em; height: 2em !important; border-width: 0 !important; }
.swal2-popup.swal2-toast .swal2-icon .swal2-success-ring { border: 0 !important; }
.swal2-popup.swal2-toast .swal2-timer-progress-bar { height: 2px !important; }

/* Motion */
.swal2-show:not(.swal2-toast) { animation: czaIn .22s cubic-bezier(.2, .9, .3, 1.2) !important; }
.swal2-hide:not(.swal2-toast) { animation: czaOut .15s ease-in forwards !important; }
@keyframes czaIn  { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes czaOut { to { opacity: 0; transform: scale(.97); } }
@media (prefers-reduced-motion: reduce) { .swal2-show, .swal2-hide { animation: none !important; } }

@media (max-width: 480px) {
  .swal2-popup:not(.swal2-toast) { padding: 22px 18px 18px !important; }
  .swal2-popup:not(.swal2-toast) .swal2-actions { flex-direction: column-reverse !important; }
  .swal2-popup:not(.swal2-toast) .swal2-actions button { width: 100%; flex: none; }
}
