:root {
    --appAlertPrimary: #5d3fd3;
    --appAlertPrimaryHover: #4b2fb8;
    --appAlertPrimarySoft: #f4f1fb;
    --appAlertHeading: #4f2f8f;
    --appAlertText: #1f1f1f;
    --appAlertMuted: #5b5b5b;
    --appAlertBorder: #e8e1f6;
    --appAlertSurface: #ffffff;
    --appAlertBackdrop: rgba(34, 20, 64, 0.42);
    --appAlertShadow: 0 18px 50px rgba(71, 44, 139, 0.18);
    --appAlertRadius: 15px;
    --appAlertButtonRadius: 8px;

    --swal2-icon-zoom: 0.94;
}

body .swal2-container {
    
}

body .swal2-container.swal2-backdrop-show,
body .swal2-container.swal2-noanimation {
    background: var(--appAlertBackdrop);
}

body .swal2-popup {
    width: min(38rem, calc(100% - 2rem));
    padding: 2.25rem 2.25rem 2rem;
    border: 1px solid var(--appAlertBorder);
    border-radius: var(--appAlertRadius);
    background: var(--appAlertSurface);
    box-shadow: var(--appAlertShadow);
}

body .swal2-icon {
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
}

body h2.swal2-title {
    margin: 0;
    padding: 0;
    font-family: 'Lora', Georgia, serif;
    font-size: 23px;
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--appAlertHeading);
}

body .swal2-html-container {
    margin: 1rem 0 0;
    padding: 0;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.8;
    font-weight: 400;
    color: var(--appAlertText);
}

body .swal2-html-container p {
    margin: 0 0 1rem;
}

body .swal2-html-container p:last-child {
    margin-bottom: 0;
}

body .swal2-actions {
    gap: 0.875rem;
    margin: 1.75rem 0 0;
}

body .swal2-styled:focus,
body .swal2-close:focus,
body .swal2-deny:focus,
body .swal2-cancel:focus,
body .swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(93, 63, 211, 0.18) !important;
}

body div:where(.swal2-container) button:where(.swal2-styled) {
    min-height: 3.75rem;
    margin: 0;
    padding: 0.95rem 1.75rem;
    border-radius: var(--appAlertButtonRadius);
    font-family: 'Lora', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body div:where(.swal2-container) button:where(.swal2-styled):hover {
    transform: translateY(-1px);
}

body div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm) {
    background: linear-gradient(90deg, #6c4cf6 0%, #5d3fd3 100%) !important;
    color: #ffffff !important;
    border: 1px solid #5d3fd3 !important;
    box-shadow: 0 12px 24px rgba(93, 63, 211, 0.22);
}

body div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover {
    background: linear-gradient(90deg, #6041e2 0%, #4f33bc 100%) !important;
}

body div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel),
body div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny) {
    background: #ffffff !important;
    color: var(--appAlertPrimary) !important;
    border: 1px solid #8c72f8 !important;
    box-shadow: none;
}

body div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover,
body div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover {
    background: var(--appAlertPrimarySoft) !important;
}

body .swal2-close {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--appAlertPrimary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

body .swal2-close:hover {
    background: var(--appAlertPrimarySoft);
    color: var(--appAlertHeading);
}

body .swal2-loader {
    border-color: var(--appAlertPrimary) transparent var(--appAlertPrimary) transparent;
}

@media (max-width: 767px) {
    
  
    body .swal2-popup {
        padding: 1.75rem 1.25rem 1.5rem;
        border-radius: 10px;
    }

    body h2.swal2-title {
        font-size: 20px;
    }

    body .swal2-html-container {
        font-size: 14px;
        line-height: 1.3;
    }

    body .swal2-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    body div:where(.swal2-container) button:where(.swal2-styled) {
        width: 100%;
        font-size: 15px;
        min-height: 3.5rem;
    }
    
    div:where(.swal2-icon) {
       zoom:0.75 !important;   
    }
}

/* App modal */
html.app-modal-is-open,
html.app-modal-is-open body {
    overflow: hidden;
}

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.app-modal.is-open {
    display: block;
}

.app-modal__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.app-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 657px;
    max-height: 100vh;
    
    padding: 48px;
    border-radius: 15px;
    background: linear-gradient(180deg, rgba(94, 61, 176, 0.06) 3.27%, rgba(76, 44, 130, 0.06) 48.48%), #FFFFFF;
    padding-bottom:26px;
}

.app-modal__close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #000 !important;
    font-family: Arial, sans-serif;
    font-size: 34px;
    font-weight: 300;
    line-height: 28px;
    cursor: pointer;
}

.app-modal__close:hover,
.app-modal__close:focus {
    color: var(--appAlertPrimary);
    outline: none;
}

.app-modal__body {
    width: 100%;
}

@media (max-width: 767px) {
    .app-modal__overlay {
        padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    }

    .app-modal__dialog {
        box-sizing: border-box;
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        padding: 40px 24px 28px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }
}
