/* ====================================================================
   SweetAlert2 — global modern theme (Thai Dental / Bootstrap forms + admin)
   Load after sweetalert2.min.css on every page that uses Swal.fire()
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700&display=swap');

:root {
  --swal-brand: #580878;
  --swal-brand-dark: #3f0658;
  --swal-brand-hover: #6b1a8f;
  --swal-brand-mid: #7a2a9e;
  --swal-brand-soft: #9b4fc0;
  --swal-brand-wash: #f3e8f7;
  --swal-text: #0f172a;
  --swal-text-muted: #64748b;
  --swal-border: rgba(226, 232, 240, 0.95);
  --swal-surface: #ffffff;
  --swal-danger: #dc2626;
  --swal-success: #16a34a;
  --swal-warning: #d97706;
  --swal-info: #580878;
}

/* Backdrop */
.swal2-container {
  z-index: 20000 !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(15, 23, 42, 0.42) !important;
  padding: 1rem;
}

body.swal2-shown .select2-container,
body.swal2-shown .select2-dropdown {
  z-index: 1000 !important;
}

body.swal2-shown .select2-container--open .select2-dropdown {
  display: none !important;
}

/* Popup shell */
.swal2-popup {
  position: relative;
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  width: min(100%, 26rem) !important;
  padding: 1.75rem 1.5rem 1.35rem !important;
  border-radius: 20px !important;
  border: 1px solid var(--swal-border) !important;
  background: var(--swal-surface) !important;
  box-shadow:
    0 24px 48px -12px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(15, 23, 42, 0.04) !important;
  overflow: visible;
}

.swal2-popup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--swal-brand-dark) 0%,
    var(--swal-brand) 42%,
    var(--swal-brand-mid) 78%,
    var(--swal-brand-soft) 100%
  );
  pointer-events: none;
}

/* Typography */
.swal2-title {
  padding: 0 0.25rem !important;
  margin: 0 0 0.35rem !important;
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  line-height: 1.45 !important;
  color: var(--swal-text) !important;
  letter-spacing: -0.01em;
}

.swal2-html-container,
.swal2-content {
  margin: 0.25rem 0 0 !important;
  padding: 0 0.25rem !important;
  font-size: 0.9375rem !important;
  font-weight: 400 !important;
  line-height: 1.65 !important;
  color: var(--swal-text-muted) !important;
}

.swal2-html-container:empty {
  display: none !important;
}

/* Icons — keep SWAL2 default geometry (em-based marks); only tint colors */
.swal2-icon {
  box-sizing: content-box !important;
  margin: 0.85rem auto 1.1rem !important;
}

.swal2-icon.swal2-success {
  border-color: rgba(22, 163, 74, 0.35) !important;
  color: var(--swal-success) !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
  background-color: var(--swal-success) !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(22, 163, 74, 0.25) !important;
}

.swal2-icon.swal2-error {
  border-color: rgba(220, 38, 38, 0.35) !important;
  color: var(--swal-danger) !important;
}

.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
  background-color: var(--swal-danger) !important;
}

.swal2-icon.swal2-warning {
  border-color: rgba(217, 119, 6, 0.35) !important;
  color: var(--swal-warning) !important;
}

.swal2-icon.swal2-info,
.swal2-icon.swal2-question {
  border-color: rgba(88, 8, 120, 0.28) !important;
  color: var(--swal-brand) !important;
}

/* Actions */
.swal2-actions {
  gap: 0.65rem !important;
  margin: 1.35rem 0 0 !important;
  width: 100%;
  flex-wrap: wrap;
}

.swal2-styled {
  min-width: 7.5rem;
  margin: 0 !important;
  padding: 0.68rem 1.35rem !important;
  border-radius: 12px !important;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  box-shadow: none !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.swal2-styled:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(88, 8, 120, 0.22) !important;
}

.swal2-styled:active {
  transform: translateY(1px);
}

.swal2-confirm {
  background: linear-gradient(135deg, var(--swal-brand) 0%, var(--swal-brand-hover) 100%) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 10px 22px -8px rgba(88, 8, 120, 0.55) !important;
}

.swal2-confirm:hover,
.swal2-confirm:focus-visible {
  background: linear-gradient(135deg, var(--swal-brand-hover) 0%, var(--swal-brand-mid) 100%) !important;
  box-shadow: 0 12px 26px -8px rgba(88, 8, 120, 0.62) !important;
}

.swal2-cancel,
.swal2-deny {
  background: #fff !important;
  color: var(--swal-text-muted) !important;
  border: 1.5px solid var(--swal-border) !important;
}

.swal2-cancel:hover,
.swal2-deny:hover {
  background: #f8fafc !important;
  color: var(--swal-text) !important;
  border-color: #cbd5e1 !important;
}

/* Close button */
.swal2-close {
  width: 2rem !important;
  height: 2rem !important;
  margin-top: 0.35rem !important;
  margin-right: 0.35rem !important;
  border-radius: 999px !important;
  color: #94a3b8 !important;
  font-size: 1.5rem !important;
  transition: background 0.18s ease, color 0.18s ease;
}

.swal2-close:hover {
  background: #f1f5f9 !important;
  color: var(--swal-text) !important;
}

/* Timer progress */
.swal2-timer-progress-bar-container {
  height: 0.28rem !important;
  border-radius: 0 0 20px 20px !important;
  overflow: hidden;
}

.swal2-timer-progress-bar {
  background: linear-gradient(90deg, var(--swal-brand-dark), var(--swal-brand-mid)) !important;
}

/* Input (prompt dialogs) */
.swal2-input,
.swal2-textarea,
.swal2-select,
.swal2-file {
  margin-top: 0.75rem !important;
  border-radius: 12px !important;
  border: 1.5px solid var(--swal-border) !important;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  box-shadow: none !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
  border-color: var(--swal-brand-soft) !important;
  box-shadow: 0 0 0 3px rgba(88, 8, 120, 0.14) !important;
}

/* Validation message */
.swal2-validation-message {
  margin-top: 0.75rem !important;
  border-radius: 10px !important;
  background: #fef2f2 !important;
  color: var(--swal-danger) !important;
  font-size: 0.875rem !important;
}

/* Footer */
.swal2-footer {
  margin-top: 1rem !important;
  padding-top: 0.85rem !important;
  border-top: 1px solid var(--swal-border) !important;
  color: var(--swal-text-muted) !important;
  font-size: 0.8125rem !important;
}

/* Toast mode (if used) */
.swal2-popup.swal2-toast {
  padding: 0.85rem 1rem !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.28) !important;
}

.swal2-popup.swal2-toast::before {
  display: none;
}

.swal2-popup.swal2-toast .swal2-title {
  font-size: 0.9375rem !important;
  margin: 0 !important;
}

@media (max-width: 575.98px) {
  .swal2-popup {
    width: min(100%, calc(100vw - 1.5rem)) !important;
    padding: 1.5rem 1.15rem 1.15rem !important;
    border-radius: 18px !important;
  }

  .swal2-styled {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .swal2-actions {
    flex-direction: column-reverse;
  }
}
