/* =====================================================================
   M20 Card — SweetAlert2 Premium Theme
   Matches the dark fintech design language used across the dashboard:
   teal -> purple signature gradient, near-black glass panels,
   Lexend typography, purple glow depth.
   Tokens mirrored from top-up / my-card / welcome views.
   v1.0.0
   ===================================================================== */

:root {
    --swal-mint: #86ECE9;
    --swal-teal: #2DDACD;
    --swal-purple: #967BF8;
    --swal-grad: linear-gradient(180deg, #86ECE9 -4.28%, #967BF8 115.44%);
    --swal-ink: #FFFFFF;
    --swal-muted: #9F9FB2;
    --swal-line: rgba(255, 255, 255, 0.10);
    --swal-field: rgba(0, 0, 0, 0.42);
    --swal-danger: #ff8a8a;
    --swal-warn: #ffce6b;
    --swal-success: #2DDACD;
}

/* ----------------------------- Backdrop ----------------------------- */
.swal2-container.swal2-backdrop-show,
.swal2-container.swal2-noanimation {
    background: radial-gradient(120% 120% at 50% 0%, rgba(150, 123, 248, 0.16) 0%, rgba(5, 5, 7, 0.78) 55%, rgba(0, 0, 0, 0.88) 100%) !important;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* ------------------------------ Popup ------------------------------- */
.swal2-popup {
    background:
        radial-gradient(135% 120% at 0% 0%, rgba(150, 123, 248, 0.16) 0%, rgba(45, 218, 205, 0.05) 32%, rgba(5, 5, 7, 0) 62%),
        linear-gradient(150deg, #16162a 0%, #0b0b14 52%, #050507 100%) !important;
    border: 1px solid var(--swal-line);
    border-radius: 22px !important;
    color: var(--swal-ink);
    box-shadow:
        0 26px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 10px 40px rgba(150, 123, 248, 0.18);
    font-family: 'Lexend', 'Inter', system-ui, -apple-system, sans-serif;
    padding: 1.85rem 1.75rem 1.6rem;
    overflow: hidden;
}

/* Signature gradient hairline at the top edge of the modal */
.swal2-popup::before {
    content: "";
    position: absolute;
    top: 0;
    left: 18%;
    right: 18%;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--swal-mint), var(--swal-purple), transparent);
    opacity: 0.9;
}

/* ------------------------------ Title ------------------------------- */
.swal2-title {
    color: var(--swal-ink) !important;
    font-family: 'Lexend', 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 22px rgba(150, 123, 248, 0.28);
}

/* --------------------------- Body / HTML ---------------------------- */
.swal2-html-container {
    color: var(--swal-muted) !important;
    font-family: 'Lexend', 'Inter', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.6;
}

.swal2-html-container a {
    color: var(--swal-mint);
    text-decoration: none;
    border-bottom: 1px solid rgba(134, 236, 233, 0.35);
}

.swal2-html-container a:hover {
    color: #b4f4f1;
}

/* ----------------------------- Buttons ------------------------------ */
.swal2-actions {
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.swal2-styled {
    border-radius: 11px !important;
    font-family: 'Lexend', 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.72em 1.6em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease;
    box-shadow: none;
}

.swal2-styled:focus {
    box-shadow: 0 0 0 3px rgba(45, 218, 205, 0.30) !important;
    outline: none;
}

/* Primary / confirm — signature teal -> purple gradient */
.swal2-styled.swal2-confirm {
    background: var(--swal-grad) !important;
    background-image: var(--swal-grad) !important;
    color: #0b0b14 !important;
    border: none;
    box-shadow: 0 10px 26px rgba(150, 123, 248, 0.34), 0 2px 8px rgba(45, 218, 205, 0.22);
}

.swal2-styled.swal2-confirm:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(150, 123, 248, 0.42), 0 3px 10px rgba(45, 218, 205, 0.28);
}

.swal2-styled.swal2-confirm:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

/* Secondary / cancel — glass with subtle border */
.swal2-styled.swal2-cancel {
    background: rgba(255, 255, 255, 0.05) !important;
    background-image: none !important;
    color: #e7e8f0 !important;
    border: 1px solid var(--swal-line);
    backdrop-filter: blur(4px);
}

.swal2-styled.swal2-cancel:hover {
    background: rgba(255, 255, 255, 0.10) !important;
    border-color: rgba(134, 236, 233, 0.45);
    transform: translateY(-1px);
}

/* Deny button — soft danger glass */
.swal2-styled.swal2-deny {
    background: rgba(255, 93, 93, 0.12) !important;
    background-image: none !important;
    color: #ffbcbc !important;
    border: 1px solid rgba(255, 93, 93, 0.32);
}

.swal2-styled.swal2-deny:hover {
    background: rgba(255, 93, 93, 0.20) !important;
}

/* --------------------------- Close button --------------------------- */
.swal2-close {
    color: var(--swal-muted);
    font-weight: 300;
    transition: color 0.18s ease, transform 0.18s ease;
}

.swal2-close:hover {
    color: var(--swal-mint);
    transform: scale(1.05);
}

.swal2-close:focus {
    box-shadow: none;
    outline: none;
}

/* ----------------------- Inputs / Select / etc ---------------------- */
.swal2-input,
.swal2-textarea,
.swal2-select,
.swal2-file {
    background: var(--swal-field) !important;
    border: 1px solid var(--swal-line) !important;
    border-radius: 13px !important;
    color: var(--swal-ink) !important;
    font-family: 'Lexend', 'Inter', sans-serif;
    font-size: 1rem;
    box-shadow: none !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.swal2-input::placeholder,
.swal2-textarea::placeholder {
    color: rgba(159, 159, 178, 0.7);
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus,
.swal2-file:focus {
    border-color: rgba(134, 236, 233, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(45, 218, 205, 0.14) !important;
    background: rgba(0, 0, 0, 0.55) !important;
    outline: none;
}

.swal2-select option {
    background: #0b0b14;
    color: var(--swal-ink);
}

/* Range / radio / checkbox accents */
.swal2-range input {
    accent-color: var(--swal-teal);
}

.swal2-radio,
.swal2-checkbox {
    background: transparent !important;
    color: var(--swal-muted) !important;
}

.swal2-radio input,
.swal2-checkbox input {
    accent-color: var(--swal-teal);
}

/* Input label */
.swal2-input-label {
    color: var(--swal-muted);
    font-family: 'Lexend', 'Inter', sans-serif;
}

/* Validation message */
.swal2-validation-message {
    background: rgba(255, 93, 93, 0.10) !important;
    color: var(--swal-danger) !important;
    border-radius: 11px;
    border: 1px solid rgba(255, 93, 93, 0.28);
    font-family: 'Lexend', 'Inter', sans-serif;
}

.swal2-validation-message::before {
    background: var(--swal-danger);
    color: #0b0b14;
}

/* --------------------------- Loader / Timer ------------------------- */
.swal2-loader {
    border-color: var(--swal-teal) transparent var(--swal-purple) transparent;
}

.swal2-timer-progress-bar {
    background: var(--swal-grad) !important;
    height: 0.28em;
}

/* ------------------------------ Footer ------------------------------ */
.swal2-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--swal-muted);
    font-family: 'Lexend', 'Inter', sans-serif;
}

/* ============================ Status Icons =========================== */

/* Success — teal/mint */
.swal2-icon.swal2-success {
    border-color: rgba(45, 218, 205, 0.35);
    color: var(--swal-teal);
}

.swal2-icon.swal2-success [class^='swal2-success-line'],
.swal2-icon.swal2-success .swal2-success-line-tip,
.swal2-icon.swal2-success .swal2-success-line-long {
    background-color: var(--swal-teal);
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(45, 218, 205, 0.35);
}

.swal2-icon.swal2-success [class^='swal2-success-circular-line'],
.swal2-icon.swal2-success .swal2-success-fix {
    background-color: transparent;
}

/* Error — soft danger red */
.swal2-icon.swal2-error {
    border-color: rgba(255, 138, 138, 0.40);
    color: var(--swal-danger);
}

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

/* Warning — gold */
.swal2-icon.swal2-warning {
    border-color: rgba(255, 206, 107, 0.45);
    color: var(--swal-warn);
}

/* Info — mint */
.swal2-icon.swal2-info {
    border-color: rgba(134, 236, 233, 0.45);
    color: var(--swal-mint);
}

/* Question — purple */
.swal2-icon.swal2-question {
    border-color: rgba(150, 123, 248, 0.50);
    color: var(--swal-purple);
}

/* =============================== Toast ============================== */
.swal2-popup.swal2-toast {
    background:
        linear-gradient(150deg, #16162a 0%, #0b0b14 60%, #050507 100%) !important;
    border: 1px solid var(--swal-line);
    border-radius: 14px !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.50), 0 4px 14px rgba(150, 123, 248, 0.20);
    padding: 0.85rem 1rem;
}

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

.swal2-popup.swal2-toast .swal2-title {
    color: #e7e8f0 !important;
    font-size: 0.95rem;
    font-weight: 400;
    text-shadow: none;
    margin: 0;
}

.swal2-popup.swal2-toast .swal2-timer-progress-bar {
    background: var(--swal-grad) !important;
}

.swal2-popup.swal2-toast .swal2-close {
    color: var(--swal-muted);
}

/* Toast icons sized + recolored to match */
.swal2-popup.swal2-toast .swal2-icon.swal2-success {
    border-color: rgba(45, 218, 205, 0.40);
}

.swal2-popup.swal2-toast .swal2-icon.swal2-error {
    border-color: rgba(255, 138, 138, 0.45);
}

/* --------------- Mobile: keep the modal comfortable ----------------- */
@media (max-width: 480px) {
    .swal2-popup {
        border-radius: 18px !important;
        padding: 1.5rem 1.25rem 1.35rem;
        width: calc(100% - 2rem);
    }

    .swal2-title {
        font-size: 1.3rem;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .swal2-styled,
    .swal2-close {
        transition: none;
    }
}
