/* =========================================================================
   SweetAlert2 — Ledger Override (Global)
   Editorial fintech styling for all SweetAlert popups across the app.
   Fraunces + Albert Sans + JetBrains Mono, ink/indigo/coral palette.
   ========================================================================= */

/* ---------- Backdrop ---------- */
.swal2-container {
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    background: rgba(14, 11, 46, 0.45) !important;
}

/* ---------- Popup card ---------- */
.swal2-popup {
    font-family: "Albert Sans", "Helvetica Neue", Arial, sans-serif !important;
    border-radius: 2px !important;
    padding: 2.75rem 2.5rem 2rem !important;
    border: 1px solid rgba(14, 11, 46, 0.14) !important;
    background: #ffffff !important;
    box-shadow:
        0 50px 120px -40px rgba(14, 11, 46, 0.35),
        0 20px 50px -20px rgba(69, 58, 148, 0.15) !important;
    overflow: hidden;
    position: relative;
    max-width: 440px;
}

/* Top rule — ink with coral accent */
.swal2-popup::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0e0b2e 0%, #453a94 40%, #f43b47 100%);
}

/* Subtle corner glow */
.swal2-popup::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(69, 58, 148, 0.06), transparent 65%);
    pointer-events: none;
}

/* ---------- Title ---------- */
.swal2-title {
    font-family: "Fraunces", Georgia, serif !important;
    font-weight: 300 !important;
    font-style: italic !important;
    font-size: 1.55rem !important;
    letter-spacing: -0.02em !important;
    color: #0e0b2e !important;
    padding-top: 0.4rem !important;
    font-variation-settings: "SOFT" 50, "opsz" 144;
}

/* ---------- Body text ---------- */
.swal2-html-container {
    font-family: "Albert Sans", "Helvetica Neue", Arial, sans-serif !important;
    font-size: 0.95rem !important;
    color: rgba(14, 11, 46, 0.70) !important;
    line-height: 1.65 !important;
    margin-top: 0.6rem !important;
}

.swal2-html-container strong {
    color: #453a94 !important;
    font-weight: 600 !important;
}

/* ---------- Icons ---------- */
.swal2-icon {
    border-width: 2px !important;
    margin: 1rem auto 0.5rem !important;
}

/* Success — verdant */
.swal2-icon.swal2-success {
    border-color: rgba(15, 108, 68, 0.3) !important;
    color: #0f6c44 !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #0f6c44 !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(15, 108, 68, 0.2) !important;
}

/* Error — coral */
.swal2-icon.swal2-error {
    border-color: rgba(244, 59, 71, 0.3) !important;
    color: #f43b47 !important;
}

.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: #f43b47 !important;
}

/* Warning — amber */
.swal2-icon.swal2-warning {
    border-color: rgba(184, 110, 0, 0.35) !important;
    color: #b86e00 !important;
}

/* Info & question — indigo */
.swal2-icon.swal2-info,
.swal2-icon.swal2-question {
    border-color: rgba(69, 58, 148, 0.35) !important;
    color: #453a94 !important;
}

/* ---------- Buttons ---------- */
.swal2-actions {
    gap: 0.6rem !important;
    margin-top: 1.5rem !important;
}

.swal2-styled {
    font-family: "JetBrains Mono", ui-monospace, Menlo, monospace !important;
    font-weight: 500 !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    padding: 0.85rem 1.5rem !important;
    border-radius: 2px !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    transition:
        transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
        background 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
        box-shadow 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) !important;
}

/* Confirm — ink fill */
.swal2-styled.swal2-confirm {
    background: #0e0b2e !important;
    color: #fbf9f4 !important;
    border-color: #0e0b2e !important;
}

.swal2-styled.swal2-confirm:hover {
    transform: translateY(-2px) !important;
    background: #453a94 !important;
    border-color: #453a94 !important;
    box-shadow: 0 18px 40px -22px rgba(69, 58, 148, 0.6) !important;
}

/* Cancel — ghost */
.swal2-styled.swal2-cancel {
    background: transparent !important;
    border-color: #0e0b2e !important;
    color: #0e0b2e !important;
}

.swal2-styled.swal2-cancel:hover {
    background: #0e0b2e !important;
    color: #fbf9f4 !important;
}

/* Deny — coral */
.swal2-styled.swal2-deny {
    background: #f43b47 !important;
    color: #fff !important;
    border-color: #f43b47 !important;
}

.swal2-styled.swal2-deny:hover {
    transform: translateY(-2px) !important;
    background: #b8202a !important;
    border-color: #b8202a !important;
    box-shadow: 0 18px 40px -22px rgba(244, 59, 71, 0.55) !important;
}

/* Focus ring */
.swal2-styled:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(69, 58, 148, 0.25) !important;
}

/* ---------- Close button ---------- */
.swal2-close {
    color: rgba(14, 11, 46, 0.35) !important;
    font-weight: 300 !important;
    font-size: 1.8rem !important;
    transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1) !important;
}

.swal2-close:hover {
    color: #0e0b2e !important;
    transform: rotate(90deg) !important;
}

/* ---------- Input (for Swal input prompts) ---------- */
.swal2-input,
.swal2-textarea,
.swal2-select {
    font-family: "Albert Sans", "Helvetica Neue", Arial, sans-serif !important;
    font-size: 1rem !important;
    color: #0e0b2e !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(14, 11, 46, 0.14) !important;
    border-radius: 0 !important;
    padding: 0.7rem 0 !important;
    box-shadow: none !important;
    transition: border-color 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
    border-bottom-color: #453a94 !important;
    box-shadow: none !important;
}

/* ---------- Timer bar ---------- */
.swal2-timer-progress-bar {
    background: linear-gradient(90deg, #453a94, #f43b47) !important;
    height: 3px !important;
}

/* ---------- Entrance animation ---------- */
.swal2-show {
    animation: swalLedgerIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes swalLedgerIn {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

/* Exit animation */
.swal2-hide {
    animation: swalLedgerOut 0.25s cubic-bezier(0.22, 0.61, 0.36, 1) !important;
}

@keyframes swalLedgerOut {
    0% {
        opacity: 1;
        transform: none;
    }
    100% {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
    .swal2-popup {
        padding: 2rem 1.5rem 1.5rem !important;
        margin: 0 12px !important;
    }
    .swal2-title {
        font-size: 1.3rem !important;
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .swal2-show { animation: none !important; }
    .swal2-hide { animation: none !important; }
    .swal2-styled:hover { transform: none !important; }
    .swal2-close:hover { transform: none !important; }
}
