/* ============================================================
   quota-alert.css — "you're out of X" pop-up
   Requires: app.css (tokens load on the same page; this file is
   imported from app.css itself, so they always do).
   ============================================================ */

:root {
    --qa-bg:       var(--glass-panel-solid);
    --qa-border:   var(--glass-line);
    --qa-accent:   var(--brand,           #1880c0);
    --qa-dim:      var(--brand-dim,       rgba(24,128,192,0.10));
    --qa-glow:     var(--brand-glow,      rgba(24,128,192,0.28));
    --qa-t1:       var(--text-primary,    #e8eaed);
    --qa-t2:       var(--text-secondary,  #8aafc8);
    --qa-t3:       var(--text-tertiary,   #445f78);
    --qa-warn:     var(--warning,         #f5a524);
    --qa-t:        var(--t, 0.20s cubic-bezier(0.4,0,0.2,1));
}

/* ══ OVERLAY ════════════════════════════════════════════════ */
.qa-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;                  /* above the payment modal's backdrop */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--scrim);
    backdrop-filter: var(--scrim-blur);
    -webkit-backdrop-filter: var(--scrim-blur);
    animation: qaFade 0.16s ease-out;
}
.qa-overlay[hidden] { display: none; }

@keyframes qaFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes qaRise { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ══ CARD ═══════════════════════════════════════════════════ */
.qa-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 30px 26px 22px;
    background: var(--qa-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--qa-border);
    border-radius: var(--r-xl, 20px);
    box-shadow: var(--glass-highlight), var(--glass-shadow);
    text-align: center;
    animation: qaRise 0.22s cubic-bezier(0.16,1,0.3,1);
}

.qa-close {
    position: absolute;
    top: 12px; inset-inline-end: 12px;
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    background: none; border: none; border-radius: var(--r-sm, 8px);
    color: var(--qa-t3); cursor: pointer;
    transition: background var(--qa-t), color var(--qa-t);
}
.qa-close:hover { background: rgba(255,255,255,0.05); color: var(--qa-t1); }
.qa-close svg   { width: 15px; height: 15px; }

/* ══ ICON ═══════════════════════════════════════════════════ */
.qa-icon {
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 52px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--qa-dim);
    border: 1px solid rgba(24,128,192,0.22);
    color: var(--qa-accent);
    box-shadow: 0 0 22px var(--qa-glow);
}
.qa-icon svg { width: 24px; height: 24px; }
/* A locked feature is not an emptied meter — amber says "not yours yet"
   rather than "you spent it". */
.qa-card.is-locked .qa-icon {
    color: var(--qa-warn);
    background: rgba(245,165,36,0.10);
    border-color: rgba(245,165,36,0.24);
    box-shadow: 0 0 22px rgba(245,165,36,0.20);
}

/* ══ COPY ═══════════════════════════════════════════════════ */
.qa-title {
    margin: 0 0 8px;
    font-size: 17px; font-weight: 600; line-height: 1.35;
    color: var(--qa-t1);
    text-wrap: balance;
}
.qa-body {
    margin: 0 0 18px;
    font-size: 13.5px; line-height: 1.6;
    color: var(--qa-t2);
}

/* ══ METER ══════════════════════════════════════════════════ */
.qa-meter { margin-bottom: 20px; }
.qa-meter[hidden] { display: none; }
.qa-meter-track {
    height: 6px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}
.qa-meter-fill {
    height: 100%;
    width: 100%;                   /* exhausted — the bar is the point */
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--qa-accent), #e0533f);
}
.qa-meter-legend {
    display: flex; justify-content: space-between; gap: 10px;
    margin-top: 7px;
    font-size: 11px; color: var(--qa-t3);
    font-variant-numeric: tabular-nums;
}

/* ══ ACTIONS ════════════════════════════════════════════════ */
.qa-actions {
    display: flex; gap: 8px;
    margin-bottom: 6px;
}
.qa-btn {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--r-md, 12px);
    font-family: inherit; font-size: 13px; font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--qa-t), border-color var(--qa-t), color var(--qa-t), box-shadow var(--qa-t);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qa-btn-primary {
    background: var(--qa-accent);
    border-color: var(--qa-accent);
    color: #fff;
    box-shadow: 0 4px 16px var(--qa-glow);
}
.qa-btn-primary:hover { background: var(--brand-light, #2a9ad6); border-color: var(--brand-light, #2a9ad6); }
.qa-btn-ghost {
    background: rgba(255,255,255,0.03);
    border-color: var(--qa-border);
    color: var(--qa-t2);
}
.qa-btn-ghost:hover { background: rgba(255,255,255,0.06); color: var(--qa-t1); }

.qa-dismiss {
    width: 100%;
    padding: 8px;
    background: none; border: none;
    color: var(--qa-t3);
    font-family: inherit; font-size: 12px;
    cursor: pointer;
    transition: color var(--qa-t);
}
.qa-dismiss:hover { color: var(--qa-t2); }

/* ══ NARROW SCREENS ═════════════════════════════════════════ */
@media (max-width: 480px) {
    .qa-card    { padding: 26px 18px 18px; }
    .qa-actions { flex-direction: column; }
    .qa-btn     { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .qa-overlay, .qa-card { animation: none; }
    .qa-btn, .qa-close, .qa-dismiss { transition: none; }
}
