/* 
 * Global Institutional UI Standard (Platform Core)
 * Standardizes typography and elements globally while preserving navigation integrity.
 */

/* ── Global Library Overrides (Institutional Hardening) ── */
.swal2-checkbox { display: none !important; }

/* ── Global Typography Overrides (Excluding Navigation) ── */

/* Inputs & Labels */
main label, .auth-wrap label, 
main .lbl, .auth-wrap .lbl, 
.kyc-fl, .auth-lbl-text, .fi-lbl, .wc-slbl, .dc-slbl, .sc-price-lbl, .sm-price-lbl, .ep-sc-lbl, .ep-m-fl {
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #64748b !important;
    margin-bottom: 8px !important;
    display: block !important;
}

main input, .auth-wrap input,
main select, .auth-wrap select,
main textarea, .auth-wrap textarea,
.fi-inp, .kyc-fi, .auth-fi, .wc-fi, .dc-fi, .sm-amt-inp, .ep-m-fi {
    font-size: 14px !important;
    font-weight: 500 !important;
}

/* Headings Normalization */
main h1, .auth-wrap h1, .kyc-htitle, .auth-heading h1, .wc-top-title, .dc-top-title, .sm-bar-title, .ep-card-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    color: #0f172a !important;
    line-height: 1.2 !important;
}

main h2, .auth-wrap h2, .kyc-rtitle, .auth-heading h2, .sm-m-title, .sc-sym, .ep-m-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    color: #0f172a !important;
}

/* Global Button Moderation */
main button, .auth-wrap button, .btn, .sc-cta, .sm-submit, .ep-m-confirm, .kyc-submit {
    font-size: 13px !important;
    font-weight: 600 !important; /* Moderate weight */
    letter-spacing: 0.01em !important;
}

/* ── Central Button Loading State ── */
/*
 * Usage (JS): ButtonLoader.start(btn)  /  ButtonLoader.stop(btn)
 * Or declaratively with data-loading-text="Processing..."
 * Adds an animated spinner + disables the button automatically.
 */
@keyframes btn-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.btn-loading {
    position: relative !important;
    cursor: not-allowed !important;
    opacity: 0.75 !important;
    pointer-events: none !important;
    padding-left: 2.4em !important;  /* room for spinner */
}

.btn-loading::before {
    content: '' !important;
    position: absolute !important;
    left: 0.75em !important;
    top: 50% !important;
    width: 1em !important;
    height: 1em !important;
    margin-top: -0.5em !important;
    border-radius: 50% !important;
    border: 2px solid currentColor !important;
    border-top-color: transparent !important;
    animation: btn-spin 0.65s linear infinite !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    opacity: 0.85 !important;
}

/* Numerical Displays (Prices, Balances) */
.sc-price, .sm-price-val, .wc-bal-val, .dc-bal-val, .amt-inp, .sm-amt-inp, .ep-sc-val, .ep-m-price-val {
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
}

/* Secondary Typography */
.kyc-hsub, .auth-heading p, .ks-sub, .wc-bal-lbl, .dc-bal-lbl, .sm-bar-sub, .sc-name, .ep-card-sub, .ep-m-sub, .fi-hint {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    line-height: 1.5 !important;
}

/* Auth Specific UI */
.auth-divider {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
}

.auth-register, .auth-footer {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    text-align: center !important;
}

.auth-register a, .auth-footer a {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #2563eb !important;
    text-decoration: none !important;
}

/* Badge Normalization */
.chg-badge, .sm-bar-badge, .ks-badge, .ep-live {
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
}

/* ── Dark Mode Overrides ── */
html.dark main label, html.dark .auth-wrap label, html.dark .lbl, html.dark .kyc-fl, html.dark .auth-lbl-text, html.dark .fi-lbl, html.dark .wc-slbl, html.dark .dc-slbl, html.dark .sc-price-lbl, html.dark .sm-price-lbl, html.dark .ep-sc-lbl, html.dark .ep-m-fl {
    color: rgba(255, 255, 255, 0.5) !important;
}

html.dark main h1, html.dark .auth-wrap h1, html.dark .kyc-htitle, html.dark .auth-heading h1, html.dark .wc-top-title, html.dark .dc-top-title, html.dark .sm-bar-title, html.dark .ep-card-title,
html.dark main h2, html.dark .auth-wrap h2, html.dark .kyc-rtitle, html.dark .sm-m-title, html.dark .sc-sym, html.dark .ep-m-title,
html.dark .sc-price, html.dark .sm-price-val, html.dark .wc-bal-val, html.dark .dc-bal-val, html.dark .ep-sc-val, html.dark .ep-m-price-val {
    color: #f9fafb !important;
}

html.dark .kyc-hsub, html.dark .auth-heading p, html.dark .ks-sub, html.dark .wc-bal-lbl, html.dark .dc-bal-lbl, html.dark .sm-bar-sub, html.dark .sc-name, html.dark .ep-card-sub, html.dark .ep-m-sub, html.dark .auth-register, html.dark .auth-footer {
    color: rgba(255, 255, 255, 0.6) !important;
}

html.dark .auth-divider {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* ── Dashboard Proactive Alerts (BS5-style) ── */
.dba-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.dba {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    border-left-width: 4px;
    font-size: 14px;
    line-height: 1.5;
    transition: opacity 0.28s ease, transform 0.28s ease;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    flex-wrap: wrap;
}

/* Type colours */
.dba-warning { background: #fffbeb; border-color: #fbbf24; color: #92400e; }
.dba-info    { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
.dba-notice  { background: #f5f3ff; border-color: #8b5cf6; color: #5b21b6; }
.dba-success { background: #f0fdf4; border-color: #22c55e; color: #166534; }

html.dark .dba {
    background: #1e2533;
    box-shadow: none;
}
html.dark .dba-warning { background: rgba(251,191,36,0.08); border-color: #fbbf24; color: #fcd34d; }
html.dark .dba-info    { background: rgba(59,130,246,0.08); border-color: #3b82f6; color: #93c5fd; }
html.dark .dba-notice  { background: rgba(139,92,246,0.08); border-color: #8b5cf6; color: #c4b5fd; }
html.dark .dba-success { background: rgba(34,197,94,0.08);  border-color: #22c55e; color: #86efac; }

/* Icon */
.dba-ico {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

/* Body */
.dba-body {
    flex: 1;
    min-width: 0;
}
.dba-body strong {
    font-weight: 700;
    margin-right: 6px;
}

/* CTA link */
.dba-btn {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1.5px solid currentColor;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
    opacity: 0.85;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.dba-btn:hover { opacity: 1; }

/* Close button */
.dba-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 0 2px;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.dba-close:hover { opacity: 1; }

/* Mobile: hide CTA, just show text + dismiss */
@media (max-width: 500px) {
    .dba-btn { display: none; }
    .dba { font-size: 13px; padding: 12px 14px; }
}


@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.db-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out forwards;
    cursor: pointer;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

html.dark .db-alert {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.db-alert:hover {
    transform: translateY(-3px) scale(1.005);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.3);
}

.db-alert-left {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.db-alert-ico {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.db-alert-ico::after {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0.15;
}

.db-alert-ico.warning { color: #f59e0b; }
.db-alert-ico.info { color: #3b82f6; }
.db-alert-ico.notice { color: #8b5cf6; }
.db-alert-ico.success { color: #10b981; }

.db-alert-title {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

.db-alert-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    font-weight: 500;
}

.db-alert-btn {
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.db-alert:hover .db-alert-btn {
    background: #fff;
    color: #0f172a;
    border-color: #fff;
    transform: translateX(4px);
}

.db-alert-close {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
    z-index: 20;
}

.db-alert-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.db-alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 24px 24px;
    overflow: hidden;
}

.db-alert-progress-fill {
    height: 100%;
    background: currentColor;
    width: 100%;
    transform-origin: left;
    opacity: 0.3;
}

.db-alert.auto-hide .db-alert-progress-fill {
    animation: alertProgress 8s linear forwards;
}

@keyframes alertProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.db-alert-ico.warning { background: #fff7ed; color: #f97316; }
.db-alert-ico.info { background: #eff6ff; color: #3b82f6; }
.db-alert-ico.notice { background: #f0fdf4; color: #10b981; }

.db-alert-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.db-alert-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

@media (max-width: 640px) {
    .db-alert {
        padding: 12px 14px;
        padding-right: 38px; /* room for the X close button */
    }
    .db-alert-btn {
        display: none; /* card itself is a link; hide btn to prevent overflow */
    }
    .db-alert-left {
        gap: 12px;
    }
    .db-alert-ico {
        width: 38px;
        height: 38px;
    }
    .db-alert-title {
        font-size: 13px;
    }
    .db-alert-desc {
        font-size: 11px;
    }
}

.db-alert-btn {
    padding: 9px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: 16px;
}

.db-alert-btn:hover {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

html.dark .db-alert {
    background: #161d2f;
    border-color: rgba(255, 255, 255, 0.06);
}

html.dark .db-alert-title { color: #f8fafc; }
html.dark .db-alert-desc { color: rgba(248, 250, 252, 0.5); }
html.dark .db-alert-btn {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}
html.dark .db-alert-btn:hover { background: #fff; color: #0f172a; }

/* ── Pulse shimmer (reusable utility) ── */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
.btn-shimmer {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.05) 25%,
        rgba(255,255,255,0.18) 50%,
        rgba(255,255,255,0.05) 75%) !important;
    background-size: 800px 100% !important;
    animation: shimmer 1.4s infinite !important;
}

