/* ==========================================================================
   invite_bump.css — S8 right phone

   The bump notification card that appears in the sharer's /upgrade view
   when a referred friend redeems their invite. Slides in from above on
   broadcast (P26), slides out + fades when dismissed.

   Container .invite-bumps holds zero-or-more .invite-bump cards. The
   credit-balance pill above flashes mint via .upgrade-credits--bumped.
   ========================================================================== */

.invite-bumps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Separate the bump cards from whatever section follows (e.g. Your
   Subscription). Collapsed when no bumps are queued. */
.invite-bumps:not(:empty) {
  margin-bottom: var(--space-6);
}

.invite-bumps:empty {
  display: none;
}

.invite-bump {
  background: var(--color-mint-light);
  border: 1.5px solid var(--color-mint);
  border-radius: 10px;
  padding: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: invite-bump-in 400ms var(--ease-out);
}

@keyframes invite-bump-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.invite-bump__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 168, 107, 0.18);
  color: var(--color-mint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.invite-bump__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.invite-bump__eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-mint);
}

.invite-bump__line {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--color-ink);
  line-height: 1.3;
}

.invite-bump__line strong {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.invite-bump__amount {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--color-mint);
  flex-shrink: 0;
}

.invite-bump__dismiss {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-mint);
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.invite-bump__dismiss:hover { opacity: 1; }

/* --- Dismissing slide-out --- */

.invite-bump--dismissing {
  animation: invite-bump-out 300ms var(--ease-out) forwards;
  pointer-events: none;
}

@keyframes invite-bump-out {
  from { opacity: 1; transform: translateY(0); max-height: 100px; }
  to   { opacity: 0; transform: translateY(-8px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; border-width: 0; }
}

/* --- Credit-balance pop animation (server-broadcasted via P3) --- */

.upgrade-credits {
  transition: color var(--duration-normal) var(--ease-out);
}

.upgrade-credits--bumped {
  color: var(--color-mint);
  animation: credit-balance-bump 800ms var(--ease-spring);
}

@keyframes credit-balance-bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* --- Reduced motion: no slide / no spring scale; styles only --- */

@media (prefers-reduced-motion: reduce) {
  .invite-bump {
    animation: none;
  }

  .invite-bump--dismissing {
    animation: none;
    opacity: 0;
    display: none;
  }

  .upgrade-credits--bumped {
    animation: none;
    transform: none;
  }
}
