/* ═══════════════════════════════════════════════
   MashupStation — Premium Dark Theme
   ═══════════════════════════════════════════════ */

/* ─── Reset & Variables ─── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #22222f;
    --bg-input: #16161f;
    --bg-glass: rgba(26, 26, 37, 0.7);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 203, 5, 0.3);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --gold: #FFCB05;
    --gold-dark: #e0a800;
    --orange: #FF6B00;
    --green: #00e676;
    --green-bg: rgba(0, 230, 118, 0.1);
    --red: #ff5252;
    --red-bg: rgba(255, 82, 82, 0.1);
    --purple: #b388ff;
    --purple-bg: rgba(179, 136, 255, 0.1);
    --gradient-gold: linear-gradient(135deg, #FFCB05, #FF6B00);
    --gradient-card: linear-gradient(145deg, #1a1a25 0%, #15151e 100%);
    --gradient-purple: linear-gradient(135deg, #b388ff, #7c4dff);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(255, 203, 5, 0.15);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── Particles ─── */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 8s infinite ease-in-out;
}

@keyframes float-particle {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }

    20% {
        opacity: 0.6;
    }

    80% {
        opacity: 0.3;
    }

    100% {
        opacity: 0;
        transform: translateY(-10vh) scale(1);
    }
}

/* ─── Screen Management ─── */
.screen {
    display: none;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
}

/* ═══ LOGIN ═══ */
#loginScreen {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-gold);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo */
.logo-area {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    animation: pulse-glow 3s infinite ease-in-out;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(255, 203, 5, 0.3));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(255, 203, 5, 0.6));
    }
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

/* Login Steps */
.login-step {
    display: none;
}

.login-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* OTP Info */
.otp-info {
    text-align: center;
    padding: 20px;
    background: rgba(255, 203, 5, 0.05);
    border: 1px solid rgba(255, 203, 5, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.otp-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.otp-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.otp-info strong {
    color: var(--gold);
}

/* ─── Inputs ─── */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 203, 5, 0.1);
}

.input-prefix {
    padding: 0 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-right: 1px solid var(--border);
    white-space: nowrap;
    user-select: none;
}

input[type="tel"],
input[type="text"],
input[type="number"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 14px 16px;
    font-family: var(--font);
    font-weight: 500;
}

input::placeholder {
    color: var(--text-muted);
}

.otp-field {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 6px;
    font-weight: 700;
    transition: border-color var(--transition);
}

.otp-field:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 203, 5, 0.1);
}

.input-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-gold);
    color: #0a0a0f;
    box-shadow: 0 4px 15px rgba(255, 203, 5, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 203, 5, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--gold);
    background: rgba(255, 203, 5, 0.05);
}

.btn-full {
    width: 100%;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* Button loading state */
.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-loader {
    display: block;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(10, 10, 15, 0.2);
    border-top-color: #0a0a0f;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: absolute;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.error-msg {
    font-size: 0.82rem;
    color: var(--red);
    margin-top: 12px;
    text-align: center;
    min-height: 1.2em;
}

/* ═══ DASHBOARD ═══ */
#dashboardScreen {
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Topbar ─── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: rgba(255, 203, 5, 0.06);
    border: 1px solid rgba(255, 203, 5, 0.1);
    border-radius: 30px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gradient-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #0a0a0f;
}

.user-msisdn {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ─── Main ─── */
.dashboard-main {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* ─── Stats ─── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 36px;
    animation: slideUp 0.5s ease-out;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-icon-gold {
    background: rgba(255, 203, 5, 0.1);
}

.stat-icon-green {
    background: var(--green-bg);
}

.stat-icon-red {
    background: var(--red-bg);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Bundle Cards ─── */
.bundle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.bundle-card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.bundle-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 203, 5, 0.03), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.bundle-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.bundle-card:hover::after {
    opacity: 1;
}

.bundle-card.selected {
    border-color: var(--gold);
    box-shadow: var(--shadow-glow), 0 0 0 1px var(--gold);
}

.bundle-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
    background: rgba(255, 203, 5, 0.15);
    color: var(--gold);
    z-index: 1;
}

.bundle-badge-purple {
    background: var(--purple-bg);
    color: var(--purple);
}

.bundle-icon-area {
    margin-bottom: 16px;
}

.bundle-emoji {
    font-size: 2.5rem;
}

.bundle-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.bundle-price {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.bundle-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.bundle-features {
    list-style: none;
}

.bundle-features li {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 4px 0;
}

/* ─── Purchase Form ─── */
.purchase-form {
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-xl);
    padding: 28px;
    margin-bottom: 32px;
    animation: expandIn 0.4s ease-out;
}

@keyframes expandIn {
    from {
        opacity: 0;
        transform: scaleY(0.95);
        transform-origin: top;
    }

    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

.purchase-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.purchase-form-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Toggle Buttons */
.option-group {
    margin-bottom: 20px;
}

.option-group>label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.toggle-group {
    display: flex;
    gap: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
}

.toggle-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
}

.toggle-btn.active {
    background: var(--gradient-gold);
    color: #0a0a0f;
    box-shadow: var(--shadow-sm);
}

/* Quantity */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--gold);
    color: #0a0a0f;
}

.quantity-control input {
    width: 60px;
    text-align: center;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font);
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Cost Display */
.cost-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 203, 5, 0.05);
    border: 1px solid rgba(255, 203, 5, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.cost-display span:first-child {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.cost-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gold);
}

/* ─── Results ─── */
.results-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 32px;
    animation: slideUp 0.4s ease-out;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.results-header h3 {
    font-weight: 700;
}

.results-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.result-badge {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.result-badge-success {
    background: var(--green-bg);
    color: var(--green);
}

.result-badge-fail {
    background: var(--red-bg);
    color: var(--red);
}

.results-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
}

.result-item.success {
    border-left: 3px solid var(--green);
}

.result-item.failed {
    border-left: 3px solid var(--red);
}

.result-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.result-msg {
    flex: 1;
    color: var(--text-secondary);
}

.result-num {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── Activity Log ─── */
.activity-section {
    margin-top: 8px;
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.activity-log {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-height: 360px;
    overflow-y: auto;
    padding: 12px;
}

.activity-log::-webkit-scrollbar {
    width: 6px;
}

.activity-log::-webkit-scrollbar-track {
    background: transparent;
}

.activity-log::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.log-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.log-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    animation: fadeIn 0.3s ease;
}

.log-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.log-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.log-dot-success {
    background: var(--green);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

.log-dot-error {
    background: var(--red);
    box-shadow: 0 0 8px rgba(255, 82, 82, 0.4);
}

.log-dot-info {
    background: var(--gold);
    box-shadow: 0 0 8px rgba(255, 203, 5, 0.4);
}

.log-content {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.log-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* ─── Toast ─── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-family: var(--font);
    font-weight: 500;
    color: #fff;
    max-width: 380px;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.4s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(20px);
}

.toast-success {
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--green);
}

.toast-error {
    background: rgba(255, 82, 82, 0.15);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: var(--red);
}

.toast-info {
    background: rgba(255, 203, 5, 0.12);
    border: 1px solid rgba(255, 203, 5, 0.25);
    color: var(--gold);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* ─── Utility ─── */
.hidden {
    display: none !important;
}

/* ─── Responsive ─── */
@media (max-width: 700px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .bundle-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 10px 16px;
    }

    .user-msisdn {
        display: none;
    }

    .dashboard-main {
        padding: 20px 16px 60px;
    }

    .login-container {
        padding: 32px 20px;
    }

    .purchase-form {
        padding: 20px;
    }

    .results-summary {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 400px) {
    .stat-card {
        padding: 14px;
    }

    .bundle-card {
        padding: 20px 18px;
    }
}

/* ─── Scrollbar (global) ─── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* Results list scrollbar */
.results-list::-webkit-scrollbar {
    width: 5px;
}

.results-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ─── Admin Link (subtle) ─── */
.admin-link {
    display: block;
    margin-top: 24px;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-decoration: none;
    opacity: 0.35;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.admin-link:hover {
    opacity: 1;
    color: var(--gold);
}

/* ─── Balance Details Overlay Modal ─── */
.balance-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(5, 5, 10, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.balance-modal-overlay.open {
    display: flex;
}

.balance-modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 203, 5, 0.07);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.balance-modal-box::-webkit-scrollbar {
    width: 4px;
}

.balance-modal-box::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.balance-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.balance-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.balance-modal-breakdown-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.balance-modal-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.balance-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.balance-modal-row:last-child {
    border-bottom: none;
}

.balance-modal-row-label {
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 3px;
}

.balance-modal-row-expiry {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.balance-modal-row-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    white-space: nowrap;
    margin-left: 16px;
}

/* ─── Purchase Progress Overlay ─── */
.purchase-progress-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    padding: 36px 28px 28px;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 203, 5, 0.08);
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pulsing rings around the icon */
.pp-icon-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--gold);
    animation: pp-pulse 2s ease-out infinite;
    opacity: 0;
}

.pp-ring-1 {
    width: 80px;
    height: 80px;
    animation-delay: 0s;
}

.pp-ring-2 {
    width: 80px;
    height: 80px;
    animation-delay: 0.5s;
}

.pp-ring-3 {
    width: 80px;
    height: 80px;
    animation-delay: 1s;
}

@keyframes pp-pulse {
    0% {
        transform: scale(0.6);
        opacity: 0.9;
    }

    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

.pp-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(255, 203, 5, 0.15), rgba(255, 107, 0, 0.1));
    border: 1.5px solid rgba(255, 203, 5, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    position: relative;
    z-index: 2;
    animation: pp-icon-spin 3s linear infinite;
}

@keyframes pp-icon-spin {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(255, 203, 5, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(255, 107, 0, 0.8));
    }
}

.pp-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pp-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* Progress bar */
.pp-bar-wrap {
    margin-bottom: 24px;
}

.pp-bar-track {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 10px;
}

.pp-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, #FFCB05, #FF6B00, #FFCB05);
    background-size: 200% 100%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pp-bar-shimmer 1.5s linear infinite;
}

@keyframes pp-bar-shimmer {
    0% {
        background-position: 200% center;
    }

    100% {
        background-position: -200% center;
    }
}

.pp-bar-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Result feed */
.pp-feed {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.pp-feed::-webkit-scrollbar {
    width: 3px;
}

.pp-feed::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.pp-feed-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    opacity: 0;
    transform: translateY(8px);
    animation: pp-row-in 0.35s ease forwards;
}

@keyframes pp-row-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pp-feed-row.pp-success {
    background: rgba(0, 230, 118, 0.07);
    color: var(--green);
}

.pp-feed-row.pp-fail {
    background: rgba(255, 82, 82, 0.07);
    color: var(--red);
}

.pp-feed-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
}

.pp-feed-msg {
    flex: 1;
    line-height: 1.4;
}

.pp-feed-num {
    flex-shrink: 0;
    opacity: 0.5;
    font-size: 0.75rem;
}

/* Done state */
.pp-done-summary {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
}

.pp-done-chip {
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 700;
}

.pp-done-chip.success {
    background: var(--green-bg);
    color: var(--green);
}

.pp-done-chip.fail {
    background: var(--red-bg);
    color: var(--red);
}