:root {
  --app-swal-primary: #0f5bd8;
  --app-swal-primary-hover: #0b47ab;
  --app-swal-surface: #ffffff;
  --app-swal-surface-muted: #f4f7fb;
  --app-swal-border: rgba(15, 23, 42, 0.08);
  --app-swal-title: #10213a;
  --app-swal-body: #556277;
  --app-swal-success: #1f8c53;
  --app-swal-warning: #d97706;
  --app-swal-error: #d14343;
  --app-swal-info: #0f5bd8;
}

.app-swal-container {
  padding: 18px;
}

.app-swal-popup {
  width: min(34rem, calc(100vw - 24px));
  border: 1px solid var(--app-swal-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(15, 91, 216, 0.08), transparent 38%),
    linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
  padding: 1.5rem 1.5rem 1.35rem;
}

.app-swal-title {
  margin: 0;
  color: var(--app-swal-title);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
}

.app-swal-html {
  margin-top: 0.85rem;
  color: var(--app-swal-body);
  font-size: 0.98rem;
  line-height: 1.65;
}

.app-swal-actions {
  width: 100%;
  gap: 0.75rem;
  margin-top: 1.3rem;
}

.app-swal-confirm,
.app-swal-cancel,
.app-swal-deny {
  min-height: 46px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  padding: 0.82rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  touch-action: manipulation;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.app-swal-confirm {
  color: #ffffff;
  background: linear-gradient(135deg, var(--app-swal-primary), #3b82f6);
  box-shadow: 0 14px 28px rgba(15, 91, 216, 0.24);
}

.app-swal-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(15, 91, 216, 0.3);
}

.app-swal-cancel {
  color: var(--app-swal-title);
  background: var(--app-swal-surface-muted);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.app-swal-cancel:hover {
  transform: translateY(-1px);
  background: #eaf0f8;
}

.app-swal-deny {
  color: #ffffff;
  background: linear-gradient(135deg, var(--app-swal-error), #ef4444);
  box-shadow: 0 14px 28px rgba(209, 67, 67, 0.24);
}

.app-swal-confirm:focus-visible,
.app-swal-cancel:focus-visible,
.app-swal-deny:focus-visible,
.swal2-close:focus-visible {
  outline: 3px solid rgba(15, 91, 216, 0.2);
  outline-offset: 2px;
}

.swal2-popup .swal2-close {
  color: #8794ab;
  transition:
    color 0.18s ease,
    background-color 0.18s ease;
}

.swal2-popup .swal2-close:hover {
  color: var(--app-swal-title);
  background-color: rgba(15, 23, 42, 0.04);
}

.app-swal-popup .swal2-icon {
  margin: 0.25rem auto 0.5rem;
  transform: scale(0.92);
}

.app-swal-popup .swal2-icon.swal2-success {
  border-color: rgba(31, 140, 83, 0.22);
  color: var(--app-swal-success);
}

.app-swal-popup .swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(31, 140, 83, 0.18);
}

.app-swal-popup .swal2-icon.swal2-success [class^="swal2-success-line"] {
  background-color: var(--app-swal-success);
}

.app-swal-popup .swal2-icon.swal2-warning {
  border-color: rgba(217, 119, 6, 0.22);
  color: var(--app-swal-warning);
}

.app-swal-popup .swal2-icon.swal2-error {
  border-color: rgba(209, 67, 67, 0.22);
  color: var(--app-swal-error);
}

.app-swal-popup .swal2-icon.swal2-error [class^="swal2-x-mark-line"] {
  background-color: var(--app-swal-error);
}

.app-swal-popup .swal2-icon.swal2-info,
.app-swal-popup .swal2-icon.swal2-question {
  border-color: rgba(15, 91, 216, 0.18);
  color: var(--app-swal-info);
}

.app-swal-toast {
  width: min(28rem, calc(100vw - 24px));
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(12px);
}

.app-swal-toast .swal2-title {
  margin: 0;
  color: var(--app-swal-title);
  font-size: 0.96rem;
  font-weight: 700;
}

.app-swal-toast .swal2-html-container {
  margin: 0.2rem 0 0;
  color: var(--app-swal-body);
  font-size: 0.88rem;
  line-height: 1.5;
}

.swal2-container.swal2-backdrop-show.app-swal-container {
  background: rgba(9, 18, 34, 0.42);
  backdrop-filter: blur(6px);
}

@media (max-width: 576px) {
  .app-swal-container {
    padding: 12px;
  }

  .app-swal-popup {
    width: calc(100vw - 24px);
    border-radius: 20px;
    padding: 1.2rem 1rem 1rem;
  }

  .app-swal-title {
    font-size: 1.18rem;
  }

  .app-swal-html {
    font-size: 0.93rem;
    line-height: 1.58;
  }

  .app-swal-actions {
    flex-direction: column-reverse;
  }

  .app-swal-confirm,
  .app-swal-cancel,
  .app-swal-deny {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-swal-confirm,
  .app-swal-cancel,
  .app-swal-deny,
  .swal2-popup .swal2-close {
    transition: none;
  }

  .swal2-show,
  .swal2-hide {
    animation: none !important;
  }
}
