/* =====================================================================
   Cypher Pay — SweetAlert2 (professional fintech theme)
   Loaded after sweetalert2.min.css; pairs with partials/sweetalert-config
   ===================================================================== */

.cp-swal.swal2-container {
    font-family: "Manrope", "Urbanist", system-ui, sans-serif;
}

.cp-swal.swal2-container.swal2-backdrop-show {
    background: rgba(15, 12, 28, 0.42);
    backdrop-filter: blur(2px);
}

.cp-swal-popup.swal2-popup {
    width: 26rem;
    max-width: calc(100vw - 2rem);
    padding: 1.75rem 1.75rem 1.5rem;
    border-radius: 16px;
    border: 1px solid #eaecf1;
    background: #fff;
    box-shadow:
        0 1px 2px rgba(16, 19, 26, 0.04),
        0 16px 40px rgba(16, 19, 26, 0.12);
    color: #1e1254;
}

.cp-swal-title.swal2-title {
    margin: 0 0 0.35rem;
    padding: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.015em;
    color: #1e1254;
    word-break: break-word;
}

.cp-swal-text.swal2-html-container {
    margin: 0;
    padding: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.55;
    color: #6b7280;
    text-align: center;
}

.cp-swal-text.swal2-html-container:has(.cp-swal-list) {
    text-align: left;
}

.cp-swal-list {
    margin: 0.35rem auto 0;
    padding: 0.75rem 0.9rem 0.75rem 1.35rem;
    list-style: disc;
    border-radius: 10px;
    border: 1px solid #f1e4e6;
    background: #fef7f7;
    color: #4b5563;
    text-align: left;
    max-width: 100%;
    display: inline-block;
}

.cp-swal-list li {
    margin: 0.2rem 0;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
    color: #374151;
}

.cp-swal-list li + li {
    margin-top: 0.4rem;
}

.cp-swal-text.swal2-html-container pre {
    margin: 0;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    border: 1px solid #eaecf1;
    background: #f7f8fb;
    color: #374151;
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
}

.cp-swal-info {
    text-align: center;
}

.cp-swal-info-label {
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7c3aed;
}

.cp-swal-info-body {
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.55;
    color: #4b5563;
    text-align: center;
}

/* Status icons — scale via font-size (SWAL uses em for the X/check geometry).
   Do NOT set rem width/height alone; that misplaces the error X into a chevron. */
.cp-swal-icon.swal2-icon {
    width: 5em;
    height: 5em;
    font-size: 0.65rem; /* 5em × 0.65rem ≈ 3.25rem */
    margin: 0.35em auto 1.1rem;
    border-width: 0.25em;
    line-height: 5em;
    box-sizing: content-box;
}

.cp-swal-icon.swal2-icon .swal2-icon-content {
    font-size: 3.75em;
}

.cp-swal-icon.swal2-success {
    border-color: #10b981;
    color: #10b981;
    background: #ecfdf5;
}

.cp-swal-icon.swal2-success [class^="swal2-success-line"] {
    background-color: #10b981;
}

.cp-swal-icon.swal2-success .swal2-success-ring {
    border-color: rgba(16, 185, 129, 0.28);
}

.cp-swal-icon.swal2-error {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

.cp-swal-icon.swal2-error .swal2-x-mark {
    position: relative;
    flex-grow: 1;
}

.cp-swal-icon.swal2-error [class^="swal2-x-mark-line"] {
    background-color: #ef4444;
}

.cp-swal-icon.swal2-warning {
    border-color: #f59e0b;
    color: #f59e0b;
    background: #fffbeb;
}

.cp-swal-icon.swal2-info {
    border-color: #7c3aed;
    color: #7c3aed;
    background: #f5f3ff;
}

.cp-swal-icon.swal2-question {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}

.cp-swal-actions.swal2-actions {
    gap: 0.625rem;
    margin: 1.35rem 0 0;
    width: 100%;
}

.cp-swal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.5rem;
    margin: 0;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.cp-swal-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22);
}

.cp-swal-btn--confirm {
    background: linear-gradient(120deg, #7c3aed 0%, #9333ea 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.24);
}

.cp-swal-btn--confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

.cp-swal-btn--cancel,
.cp-swal-btn--deny {
    background: #fff;
    border-color: #e5e7eb;
    color: #4b5563;
}

.cp-swal-btn--cancel:hover,
.cp-swal-btn--deny:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #1f2937;
}

.cp-swal-btn--deny {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff5f5;
}

.cp-swal-btn--deny:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* Toast variant (copy feedback, etc.) — no dimming overlay */
.cp-swal.swal2-container:has(.cp-swal-popup--toast) {
    background: transparent !important;
    backdrop-filter: none !important;
    pointer-events: none;
}

.cp-swal.swal2-container:has(.cp-swal-popup--toast) > .cp-swal-popup--toast {
    pointer-events: auto;
}

.cp-swal-popup.cp-swal-popup--toast.swal2-popup {
    width: auto;
    min-width: 14rem;
    max-width: min(22rem, calc(100vw - 1.5rem));
    padding: 0.75rem 1rem;
    border-radius: 12px;
    overflow: visible;
    box-shadow:
        0 4px 12px rgba(16, 19, 26, 0.08),
        0 12px 28px rgba(16, 19, 26, 0.1);
}

/* Simple toast glyph — avoids SWAL success animation clipping at small sizes */
.cp-swal-icon.cp-swal-icon--toast.swal2-icon {
    width: 1.35rem !important;
    height: 1.35rem !important;
    min-width: 1.35rem;
    font-size: 0.75rem !important;
    line-height: 1.35rem !important;
    margin: 0 0.625rem 0 0 !important;
    border-width: 1.5px !important;
    box-sizing: border-box;
    overflow: hidden;
}

.cp-swal-icon.cp-swal-icon--toast.swal2-icon .swal2-icon-content {
    font-size: 0.75rem !important;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-swal-icon.cp-swal-icon--toast.swal2-success {
    border-color: #10b981;
    background: #ecfdf5;
    color: #059669;
}

.cp-swal-icon.cp-swal-icon--toast.swal2-error {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

.cp-swal-icon.cp-swal-icon--toast.swal2-warning {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #d97706;
}

.cp-swal-icon.cp-swal-icon--toast.swal2-success [class^="swal2-success-line"],
.cp-swal-icon.cp-swal-icon--toast.swal2-success .swal2-success-ring,
.cp-swal-icon.cp-swal-icon--toast.swal2-error [class^="swal2-x-mark-line"],
.cp-swal-icon.cp-swal-icon--toast.swal2-error .swal2-x-mark {
    display: none !important;
}

.cp-swal-toast-glyph {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.cp-swal-toast-title.swal2-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1e1254;
    text-align: left;
}

.cp-swal-timer.swal2-timer-progress-bar {
    background: linear-gradient(90deg, #7c3aed, #db2777);
}

/* Entry / exit */
@keyframes cp-swal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cp-swal-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
}

.cp-swal-show {
    animation: cp-swal-in 0.2s ease-out both;
}

.cp-swal-hide {
    animation: cp-swal-out 0.15s ease-in both;
}

@media (prefers-reduced-motion: reduce) {
    .cp-swal-show,
    .cp-swal-hide {
        animation: none;
    }
}

/* Dark mode */
[data-theme="dark"] .cp-swal.swal2-container.swal2-backdrop-show {
    background: rgba(0, 0, 0, 0.58);
}

[data-theme="dark"] .cp-swal-popup.swal2-popup {
    background: #1f1f28;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
    color: #f0f0f5;
}

[data-theme="dark"] .cp-swal-title.swal2-title,
[data-theme="dark"] .cp-swal-toast-title.swal2-title {
    color: #f0f0f5;
}

[data-theme="dark"] .cp-swal-text.swal2-html-container {
    color: #9ca3af;
}

[data-theme="dark"] .cp-swal-list {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.22);
    color: #e5e7eb;
}

[data-theme="dark"] .cp-swal-list li {
    color: #e5e7eb;
}

[data-theme="dark"] .cp-swal-text.swal2-html-container pre {
    background: #131319;
    border-color: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
}

[data-theme="dark"] .cp-swal-info-body {
    color: #d1d5db;
}

[data-theme="dark"] .cp-swal-btn--cancel,
[data-theme="dark"] .cp-swal-btn--deny {
    background: #1a1a22;
    border-color: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
}

[data-theme="dark"] .cp-swal-btn--cancel:hover {
    background: #252530;
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

[data-theme="dark"] .cp-swal-popup.cp-swal-popup--toast.swal2-popup {
    background: #1f1f28;
    border-color: rgba(255, 255, 255, 0.1);
}
