/* =============================================================================
 * Smart upsell tile — Dashboard home, rendered by balance-upsell-tile.js
 * Sits just below the main balance widget when runway dips below 14 days.
 *
 * Three severities, mirroring user-balance-pill.css:
 *   --info     — runway 7..14 days (soft heads-up, no urgency).
 *   --warning  — runway 3..7 days (yellow, action recommended).
 *   --critical — runway < 3 days (magenta, action needed soon).
 * ============================================================================= */

.balance-upsell-tile {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4, 16px);
    padding: var(--space-4, 16px) var(--space-5, 20px);
    margin: 0 0 var(--space-5, 20px) 0;
    background: var(--bg-card, rgba(13, 13, 20, 0.85));
    border: 1px solid rgba(0, 255, 255, 0.25);
    border-left-width: 3px;
    clip-path: polygon(
        0 0,
        calc(100% - 12px) 0,
        100% 12px,
        100% 100%,
        12px 100%,
        0 calc(100% - 12px)
    );
}

.balance-upsell-tile__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-cyan, #0ff);
}

.balance-upsell-tile__icon svg {
    width: 24px;
    height: 24px;
}

.balance-upsell-tile__body {
    flex: 1;
    min-width: 0;
}

.balance-upsell-tile__title {
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary, #fff);
    margin-bottom: 4px;
}

.balance-upsell-tile__msg {
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted, rgba(255, 255, 255, 0.7));
}

.balance-upsell-tile__actions {
    flex-shrink: 0;
    align-self: center;
}

.balance-upsell-tile__cta {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--neon-cyan, #0ff);
    background: rgba(0, 255, 255, 0.12);
    color: var(--neon-cyan, #0ff);
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.18s ease;
    clip-path: polygon(
        0 0,
        calc(100% - 8px) 0,
        100% 8px,
        100% 100%,
        8px 100%,
        0 calc(100% - 8px)
    );
}

.balance-upsell-tile__cta:hover {
    background: rgba(0, 255, 255, 0.22);
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.35);
}

/* -----------------------------------------------------------------------------
 * Severity modifiers
 * --------------------------------------------------------------------------- */
.balance-upsell-tile--info {
    border-color: rgba(0, 255, 255, 0.3);
    border-left-color: var(--neon-cyan, #0ff);
}
.balance-upsell-tile--info .balance-upsell-tile__icon {
    color: var(--neon-cyan, #0ff);
}

.balance-upsell-tile--warning {
    border-color: rgba(255, 215, 0, 0.4);
    border-left-color: var(--neon-yellow, #ffd700);
    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.04),
        var(--bg-card, rgba(13, 13, 20, 0.85))
    );
}
.balance-upsell-tile--warning .balance-upsell-tile__icon {
    color: var(--neon-yellow, #ffd700);
}
.balance-upsell-tile--warning .balance-upsell-tile__cta {
    border-color: var(--neon-yellow, #ffd700);
    background: rgba(255, 215, 0, 0.12);
    color: var(--neon-yellow, #ffd700);
}
.balance-upsell-tile--warning .balance-upsell-tile__cta:hover {
    background: rgba(255, 215, 0, 0.22);
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.4);
}

.balance-upsell-tile--critical {
    border-color: rgba(247, 37, 133, 0.5);
    border-left-color: var(--neon-magenta, #f72585);
    background: linear-gradient(
        135deg,
        rgba(247, 37, 133, 0.06),
        var(--bg-card, rgba(13, 13, 20, 0.85))
    );
    animation: balanceUpsellPulse 3s ease-in-out infinite;
}
.balance-upsell-tile--critical .balance-upsell-tile__icon {
    color: var(--neon-magenta, #f72585);
}
.balance-upsell-tile--critical .balance-upsell-tile__cta {
    border-color: var(--neon-magenta, #f72585);
    background: rgba(247, 37, 133, 0.16);
    color: var(--neon-magenta, #f72585);
}
.balance-upsell-tile--critical .balance-upsell-tile__cta:hover {
    background: rgba(247, 37, 133, 0.28);
    box-shadow: 0 0 20px rgba(247, 37, 133, 0.45);
}

@keyframes balanceUpsellPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(247, 37, 133, 0); }
    50%      { box-shadow: 0 0 22px rgba(247, 37, 133, 0.25); }
}

/* -----------------------------------------------------------------------------
 * Mobile compaction
 * --------------------------------------------------------------------------- */
@media (max-width: 720px) {
    .balance-upsell-tile {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3, 12px);
    }
    .balance-upsell-tile__actions {
        align-self: flex-start;
    }
}
