/* =========================================================================
 * SWEETALERT - MODERNIZED DESIGN SYSTEM
 * Ultra-Modern, Clean & Premium Modal Styling
 * ========================================================================= */

:root {
  --swal-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  --swal-bg: #ffffff;
  --swal-overlay: rgba(15, 23, 42, 0.65);
  --swal-title: #0f172a;
  --swal-text: #475569;
  --swal-radius: 20px;
  --swal-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 35px 60px -15px rgba(15, 23, 42, 0.25);
  
  --swal-success: #10b981;
  --swal-success-glow: rgba(16, 185, 129, 0.16);
  --swal-error: #ef4444;
  --swal-error-glow: rgba(239, 68, 68, 0.16);
  --swal-warning: #f59e0b;
  --swal-warning-glow: rgba(245, 158, 11, 0.16);
  --swal-info: #3b82f6;
  --swal-info-glow: rgba(59, 130, 246, 0.16);

  --swal-btn-primary: #2563eb;
  --swal-btn-primary-hover: #1d4ed8;
  --swal-btn-cancel: #f1f5f9;
  --swal-btn-cancel-text: #475569;
  --swal-btn-cancel-border: #cbd5e1;
}

body.stop-scrolling {
  height: 100%;
  overflow: hidden;
}

/* =========================================================================
 * 1. BACKDROP OVERLAY
 * ========================================================================= */
.sweet-overlay {
  background-color: var(--swal-overlay, rgba(15, 23, 42, 0.65)) !important;
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: none;
  z-index: 99998;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================================================
 * 2. MODAL CONTAINER
 * ========================================================================= */
.sweet-alert {
  background-color: var(--swal-bg, #ffffff);
  font-family: var(--swal-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif);
  width: 460px;
  padding: 30px 28px 26px;
  border-radius: var(--swal-radius, 20px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 35px 60px -15px rgba(15, 23, 42, 0.22);
  text-align: center;
  position: fixed;
  left: 50%;
  top: 50%;
  margin-left: -230px;
  margin-top: -200px;
  overflow: hidden;
  display: none;
  z-index: 99999;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media all and (max-width: 540px) {
  .sweet-alert {
    width: auto !important;
    left: 16px !important;
    right: 16px !important;
    margin-left: 0 !important;
    padding: 24px 18px 20px !important;
    border-radius: 16px !important;
  }
}

/* =========================================================================
 * 3. TYPOGRAPHY
 * ========================================================================= */
.sweet-alert h2 {
  color: var(--swal-title, #0f172a);
  font-size: 21px;
  text-align: center;
  font-weight: 700;
  text-transform: none;
  position: relative;
  margin: 16px 0 8px 0;
  padding: 0;
  line-height: 1.35;
  letter-spacing: -0.02em;
  display: block;
}

.sweet-alert p {
  color: var(--swal-text, #475569);
  font-size: 14.5px;
  text-align: center;
  font-weight: 400;
  position: relative;
  float: none;
  margin: 0;
  padding: 0 4px;
  line-height: 1.55;
  word-break: break-word;
}

/* =========================================================================
 * 4. INPUT FIELD (PROMPTS)
 * ========================================================================= */
.sweet-alert fieldset {
  border: none;
  position: relative;
  padding: 0;
  margin: 14px 0 6px 0;
}

.sweet-alert input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background-color: #f8fafc;
  height: 44px;
  margin-top: 8px;
  margin-bottom: 12px;
  font-size: 15px;
  color: #0f172a;
  padding: 0 14px;
  display: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.sweet-alert input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.18);
}

.sweet-alert input::-moz-placeholder {
  color: #94a3b8;
  opacity: 1;
}
.sweet-alert input:-ms-input-placeholder {
  color: #94a3b8;
}
.sweet-alert input::-webkit-input-placeholder {
  color: #94a3b8;
}

.sweet-alert.show-input input {
  display: block;
}

/* Validation errors */
.sweet-alert .sa-error-container {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  margin-left: 0;
  margin-right: 0;
  margin-top: 8px;
  overflow: hidden;
  padding: 0 12px;
  max-height: 0;
  transition: padding 0.2s ease, max-height 0.2s ease;
}

.sweet-alert .sa-error-container.show {
  padding: 8px 12px;
  max-height: 100px;
}

.sweet-alert .sa-error-container .icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  margin-right: 6px;
  vertical-align: middle;
}

.sweet-alert .sa-error-container p {
  display: inline-block;
  color: #991b1b;
  font-size: 13px;
  font-weight: 500;
  line-height: normal;
  margin: 0;
  vertical-align: middle;
}

.sweet-alert .sa-input-error {
  position: absolute;
  top: 22px;
  right: 14px;
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: scale(0.5);
  transform-origin: 50% 50%;
  transition: all 0.15s ease;
}

.sweet-alert .sa-input-error::before,
.sweet-alert .sa-input-error::after {
  content: "";
  width: 16px;
  height: 3px;
  background-color: #ef4444;
  border-radius: 2px;
  position: absolute;
  top: 50%;
  margin-top: -1.5px;
  left: 50%;
  margin-left: -8px;
}

.sweet-alert .sa-input-error::before {
  transform: rotate(-45deg);
}
.sweet-alert .sa-input-error::after {
  transform: rotate(45deg);
}

.sweet-alert .sa-input-error.show {
  opacity: 1;
  transform: scale(1);
}

/* =========================================================================
 * 5. BUTTONS & ACTIONS
 * ========================================================================= */
.sweet-alert .sa-button-container {
  margin-top: 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sweet-alert .sa-confirm-button-container {
  display: inline-block;
  position: relative;
  margin: 0;
}

.sweet-alert button {
  background-color: var(--swal-btn-primary, #2563eb);
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 10px;
  padding: 10px 22px;
  margin: 0;
  cursor: pointer;
  min-height: 40px;
  min-width: 95px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.18s ease,
              background-color 0.18s ease;
}

.sweet-alert button:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.06);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.sweet-alert button:active {
  transform: translateY(0.5px);
  filter: brightness(0.96);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.sweet-alert button:focus {
  outline: none;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.25);
}

.sweet-alert button.cancel {
  background-color: var(--swal-btn-cancel, #f1f5f9);
  color: var(--swal-btn-cancel-text, #475569);
  border: 1.5px solid var(--swal-btn-cancel-border, #cbd5e1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sweet-alert button.cancel:hover {
  background-color: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.sweet-alert button.cancel:active {
  background-color: #cbd5e1;
}

.sweet-alert button.cancel:focus {
  box-shadow: 0 0 0 3.5px rgba(148, 163, 184, 0.3) !important;
}

.sweet-alert button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.sweet-alert button.confirm[disabled] {
  color: transparent;
}

.sweet-alert button.confirm[disabled] ~ .la-ball-fall {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.sweet-alert button::-moz-focus-inner {
  border: 0;
}

.sweet-alert[data-has-cancel-button=false] button {
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
}

.sweet-alert[data-has-confirm-button=false][data-has-cancel-button=false] {
  padding-bottom: 28px;
}

/* =========================================================================
 * 6. MODERN ANIMATED ICONS
 * ========================================================================= */
.sweet-alert .sa-icon,
.sweet-alert .icon {
  width: 80px;
  height: 80px;
  border: 4px solid #cbd5e1;
  border-radius: 50%;
  margin: 10px auto 16px;
  padding: 0;
  position: relative;
  box-sizing: content-box;
}

/* --- ERROR ICON --- */
.sweet-alert .sa-icon.sa-error,
.sweet-alert .icon.error {
  border-color: var(--swal-error, #ef4444);
  box-shadow: 0 0 0 8px var(--swal-error-glow, rgba(239, 68, 68, 0.14));
}

.sweet-alert .sa-icon.sa-error .sa-x-mark,
.sweet-alert .icon.error .x-mark {
  position: relative;
  display: block;
}

.sweet-alert .sa-icon.sa-error .sa-line,
.sweet-alert .icon.error .line {
  position: absolute;
  height: 5px;
  width: 47px;
  background-color: var(--swal-error, #ef4444);
  display: block;
  top: 37px;
  border-radius: 3px;
}

.sweet-alert .sa-icon.sa-error .sa-line.sa-left,
.sweet-alert .icon.error .line.left {
  transform: rotate(45deg);
  left: 17px;
}

.sweet-alert .sa-icon.sa-error .sa-line.sa-right,
.sweet-alert .icon.error .line.right {
  transform: rotate(-45deg);
  right: 16px;
}

/* --- WARNING ICON --- */
.sweet-alert .sa-icon.sa-warning,
.sweet-alert .icon.warning {
  border-color: var(--swal-warning, #f59e0b);
  box-shadow: 0 0 0 8px var(--swal-warning-glow, rgba(245, 158, 11, 0.14));
}

.sweet-alert .sa-icon.sa-warning .sa-body,
.sweet-alert .icon.warning .body {
  position: absolute;
  width: 5px;
  height: 47px;
  left: 50%;
  top: 10px;
  border-radius: 3px;
  margin-left: -2.5px;
  background-color: var(--swal-warning, #f59e0b);
}

.sweet-alert .sa-icon.sa-warning .sa-dot,
.sweet-alert .icon.warning .dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: -3.5px;
  left: 50%;
  bottom: 10px;
  background-color: var(--swal-warning, #f59e0b);
}

/* --- INFO ICON --- */
.sweet-alert .sa-icon.sa-info,
.sweet-alert .icon.info {
  border-color: var(--swal-info, #3b82f6);
  box-shadow: 0 0 0 8px var(--swal-info-glow, rgba(59, 130, 246, 0.14));
}

.sweet-alert .sa-icon.sa-info::before,
.sweet-alert .icon.info::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 29px;
  left: 50%;
  bottom: 17px;
  border-radius: 3px;
  margin-left: -2.5px;
  background-color: var(--swal-info, #3b82f6);
}

.sweet-alert .sa-icon.sa-info::after,
.sweet-alert .icon.info::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: -3.5px;
  top: 19px;
  background-color: var(--swal-info, #3b82f6);
  left: 50%;
}

/* --- SUCCESS ICON --- */
.sweet-alert .sa-icon.sa-success,
.sweet-alert .icon.success {
  border-color: var(--swal-success, #10b981);
  box-shadow: 0 0 0 8px var(--swal-success-glow, rgba(16, 185, 129, 0.14));
}

.sweet-alert .sa-icon.sa-success::before,
.sweet-alert .sa-icon.sa-success::after,
.sweet-alert .icon.success::before,
.sweet-alert .icon.success::after {
  content: '';
  border-radius: 50%;
  position: absolute;
  width: 60px;
  height: 120px;
  background: #ffffff;
  transform: rotate(45deg);
}

.sweet-alert .sa-icon.sa-success::before,
.sweet-alert .icon.success::before {
  border-radius: 120px 0 0 120px;
  top: -7px;
  left: -33px;
  transform: rotate(-45deg);
  transform-origin: 60px 60px;
}

.sweet-alert .sa-icon.sa-success::after,
.sweet-alert .icon.success::after {
  border-radius: 0 120px 120px 0;
  top: -11px;
  left: 30px;
  transform: rotate(-45deg);
  transform-origin: 0px 60px;
}

.sweet-alert .sa-icon.sa-success .sa-placeholder,
.sweet-alert .icon.success .placeholder {
  width: 80px;
  height: 80px;
  border: 4px solid rgba(16, 185, 129, 0.2);
  border-radius: 50%;
  box-sizing: content-box;
  position: absolute;
  left: -4px;
  top: -4px;
  z-index: 2;
}

.sweet-alert .sa-icon.sa-success .sa-fix,
.sweet-alert .icon.success .fix {
  width: 5px;
  height: 90px;
  background-color: #ffffff;
  position: absolute;
  left: 28px;
  top: 8px;
  z-index: 1;
  transform: rotate(-45deg);
}

.sweet-alert .sa-icon.sa-success .sa-line,
.sweet-alert .icon.success .line {
  height: 5px;
  background-color: var(--swal-success, #10b981);
  display: block;
  border-radius: 3px;
  position: absolute;
  z-index: 2;
}

.sweet-alert .sa-icon.sa-success .sa-line.sa-tip,
.sweet-alert .icon.success .line.tip {
  width: 25px;
  left: 14px;
  top: 46px;
  transform: rotate(45deg);
}

.sweet-alert .sa-icon.sa-success .sa-line.sa-long,
.sweet-alert .icon.success .line.long {
  width: 47px;
  right: 8px;
  top: 38px;
  transform: rotate(-45deg);
}

/* --- CUSTOM ICON --- */
.sweet-alert .sa-icon.sa-custom,
.sweet-alert .icon.custom {
  background-size: contain;
  border-radius: 0;
  border: none;
  background-position: center center;
  background-repeat: no-repeat;
}

/* =========================================================================
 * 7. SMOOTH MODERN ANIMATIONS
 * ========================================================================= */
@keyframes showSweetAlert {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(-6px);
  }
  65% {
    transform: scale(1.015) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes hideSweetAlert {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.92) translateY(6px);
  }
}

@keyframes slideFromTop {
  0% {
    opacity: 0;
    top: 40%;
  }
  100% {
    opacity: 1;
    top: 50%;
  }
}

@keyframes slideToTop {
  0% {
    opacity: 1;
    top: 50%;
  }
  100% {
    opacity: 0;
    top: 40%;
  }
}

@keyframes slideFromBottom {
  0% {
    opacity: 0;
    top: 60%;
  }
  100% {
    opacity: 1;
    top: 50%;
  }
}

@keyframes slideToBottom {
  0% {
    opacity: 1;
    top: 50%;
  }
  100% {
    opacity: 0;
    top: 60%;
  }
}

.showSweetAlert[data-animation=pop] {
  animation: showSweetAlert 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.showSweetAlert[data-animation=none] {
  animation: none;
}

.showSweetAlert[data-animation=slide-from-top] {
  animation: slideFromTop 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.showSweetAlert[data-animation=slide-from-bottom] {
  animation: slideFromBottom 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hideSweetAlert[data-animation=pop] {
  animation: hideSweetAlert 0.18s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.hideSweetAlert[data-animation=none] {
  animation: none;
}

.hideSweetAlert[data-animation=slide-from-top] {
  animation: slideToTop 0.22s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.hideSweetAlert[data-animation=slide-from-bottom] {
  animation: slideToBottom 0.22s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

/* Checkmark Drawing Animations */
@keyframes animateSuccessTip {
  0% {
    width: 0;
    left: 1px;
    top: 19px;
  }
  54% {
    width: 0;
    left: 1px;
    top: 19px;
  }
  70% {
    width: 50px;
    left: -8px;
    top: 37px;
  }
  84% {
    width: 17px;
    left: 21px;
    top: 48px;
  }
  100% {
    width: 25px;
    left: 14px;
    top: 45px;
  }
}

@keyframes animateSuccessLong {
  0% {
    width: 0;
    right: 46px;
    top: 54px;
  }
  65% {
    width: 0;
    right: 46px;
    top: 54px;
  }
  84% {
    width: 55px;
    right: 0px;
    top: 35px;
  }
  100% {
    width: 47px;
    right: 8px;
    top: 38px;
  }
}

@keyframes rotatePlaceholder {
  0% {
    transform: rotate(-45deg);
  }
  5% {
    transform: rotate(-45deg);
  }
  12% {
    transform: rotate(-405deg);
  }
  100% {
    transform: rotate(-405deg);
  }
}

.animateSuccessTip {
  animation: animateSuccessTip 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.animateSuccessLong {
  animation: animateSuccessLong 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.sa-icon.sa-success.animate::after,
.icon.success.animate::after {
  animation: rotatePlaceholder 4.25s ease-in;
}

/* Error X Animations */
@keyframes animateErrorIcon {
  0% {
    transform: rotateX(100deg);
    opacity: 0;
  }
  100% {
    transform: rotateX(0deg);
    opacity: 1;
  }
}

@keyframes animateXMark {
  0% {
    transform: scale(0.3);
    margin-top: 26px;
    opacity: 0;
  }
  50% {
    transform: scale(0.3);
    margin-top: 26px;
    opacity: 0;
  }
  80% {
    transform: scale(1.12);
    margin-top: -4px;
  }
  100% {
    transform: scale(1);
    margin-top: 0;
    opacity: 1;
  }
}

.animateErrorIcon {
  animation: animateErrorIcon 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.animateXMark {
  animation: animateXMark 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Warning Pulse Animations */
@keyframes pulseWarning {
  0% {
    border-color: #fde68a;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
  }
  100% {
    border-color: #f59e0b;
    box-shadow: 0 0 0 9px rgba(245, 158, 11, 0.16);
  }
}

.pulseWarning {
  animation: pulseWarning 0.85s infinite alternate ease-in-out;
}

@keyframes pulseWarningIns {
  0% {
    background-color: #fde68a;
  }
  100% {
    background-color: #f59e0b;
  }
}

.pulseWarningIns {
  animation: pulseWarningIns 0.85s infinite alternate ease-in-out;
}

/* =========================================================================
 * 8. LOADING SPINNER (LOAD AWESOME)
 * ========================================================================= */
.la-ball-fall,
.la-ball-fall > div {
  position: relative;
  box-sizing: border-box;
}

.la-ball-fall {
  display: block;
  font-size: 0;
  color: #ffffff;
  width: 54px;
  height: 18px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -27px;
  margin-top: -9px;
  opacity: 0;
  visibility: hidden;
}

.la-ball-fall.la-dark {
  color: #334155;
}

.la-ball-fall > div {
  display: inline-block;
  float: none;
  background-color: currentColor;
  border: 0 solid currentColor;
  width: 8px;
  height: 8px;
  margin: 4px;
  border-radius: 100%;
  opacity: 0;
  animation: ball-fall 1s ease-in-out infinite;
}

.la-ball-fall > div:nth-child(1) {
  animation-delay: -200ms;
}
.la-ball-fall > div:nth-child(2) {
  animation-delay: -100ms;
}
.la-ball-fall > div:nth-child(3) {
  animation-delay: 0ms;
}

@keyframes ball-fall {
  0% {
    opacity: 0;
    transform: translateY(-130%);
  }
  20% {
    opacity: 1;
    transform: translateY(0);
  }
  80% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(130%);
  }
}
