/**
 * Модалки подписки и пополнения: стекло + неон в духе лендинга.
 */

body.modal-open:has(#billingSubscribeModal.show) .modal-backdrop,
body.modal-open:has(#billingTopupModal.show) .modal-backdrop {
    background: rgba(4, 6, 12, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#billingSubscribeModal .modal-dialog,
#billingTopupModal .modal-dialog {
    max-width: min(440px, calc(100vw - 1.5rem));
}

.modal-content.billing-modal-content {
    position: relative;
    overflow: hidden;
    border-radius: 22px !important;
    border: 1px solid rgba(168, 85, 247, 0.38) !important;
    background: color-mix(in srgb, var(--card-bg) 78%, transparent) !important;
    backdrop-filter: blur(22px) saturate(1.15);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
    color: var(--text-color) !important;
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        0 0 48px rgba(168, 85, 247, 0.18);
}

[data-theme="dark"] .modal-content.billing-modal-content {
    background: color-mix(in srgb, var(--card-bg) 72%, transparent) !important;
    border-color: rgba(168, 85, 247, 0.42) !important;
}

.modal-content.billing-modal-content::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: conic-gradient(from 210deg, rgba(168, 85, 247, 0.12), rgba(0, 240, 255, 0.08), rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.12));
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
}

.modal-content.billing-modal-content > * {
    position: relative;
    z-index: 1;
}

[data-theme="light"] .modal-content.billing-modal-content {
    background: color-mix(in srgb, #ffffff 88%, transparent) !important;
    box-shadow:
        0 24px 70px rgba(79, 70, 229, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.85) inset,
        0 0 36px rgba(99, 102, 241, 0.1);
}

.billing-modal-header {
    border-bottom: 1px solid rgba(168, 85, 247, 0.22) !important;
    padding: 1.1rem 1.25rem !important;
}

.billing-modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-color) 0%, #a855f7 55%, #06b6d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

[data-theme="light"] .billing-modal-title {
    background: linear-gradient(135deg, #0f172a 0%, #6d28d9 50%, #0891b2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.billing-modal-header .btn-close {
    opacity: 0.75;
    filter: none;
}

[data-theme="dark"] .billing-modal-header .btn-close {
    filter: invert(1) brightness(1.1);
}

.billing-modal-body {
    padding: 1.25rem 1.25rem 1.1rem !important;
}

.billing-modal-body .form-control {
    border-radius: 12px;
    border-color: rgba(168, 85, 247, 0.28);
    background: color-mix(in srgb, var(--card-bg) 92%, transparent);
}

[data-theme="dark"] .billing-modal-body .form-control {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-color);
}

.billing-modal-body .form-control:focus {
    border-color: rgba(0, 240, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.billing-modal-footer {
    border-top: 1px solid rgba(168, 85, 247, 0.18) !important;
    padding: 1rem 1.25rem 1.2rem !important;
    gap: 0.5rem;
}

.btn-billing-ghost {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color) !important;
}

[data-theme="light"] .btn-billing-ghost {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.25);
}

.btn-billing-ghost:hover {
    border-color: rgba(168, 85, 247, 0.45);
    background: rgba(168, 85, 247, 0.08);
}

.btn-billing-glow {
    border: none;
    border-radius: 12px;
    font-weight: 600;
    padding: 0.5rem 1.15rem;
    color: #fff !important;
    background: linear-gradient(135deg, #a855f7, #6366f1, #00d4e8) !important;
    background-size: 140% 140%;
    box-shadow: 0 0 24px rgba(168, 85, 247, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-billing-glow:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 0 32px rgba(168, 85, 247, 0.55);
}

.btn-billing-topup-preset {
    border-radius: 10px !important;
    font-weight: 600 !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    background: rgba(16, 185, 129, 0.1) !important;
    color: var(--text-color) !important;
}

.btn-billing-topup-preset:hover {
    border-color: rgba(16, 185, 129, 0.65) !important;
    background: rgba(16, 185, 129, 0.18) !important;
}

.billing-modal-body ul.billing-modal-list {
    padding-left: 1.15rem;
    margin-bottom: 0.75rem;
}

.billing-modal-body ul.billing-modal-list li {
    margin-bottom: 0.35rem;
}

.btn-billing-method {
    border-radius: 12px !important;
    font-weight: 500 !important;
    padding: 0.65rem 0.9rem !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-color) !important;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="light"] .btn-billing-method {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

.btn-billing-method:hover:not(:disabled) {
    border-color: rgba(168, 85, 247, 0.5) !important;
    background: rgba(168, 85, 247, 0.08) !important;
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.15);
}
