/* "Subscription extended" celebration modal (SubsExtendedModal.tsx).
   Ported 1:1 from new-features/subs-extended-notif/subs-extended-design.html.
   Tokens from shell.css; a few design values have no matching token and are
   kept as literals (flagged in the plan): 20px title, 30px expiry date,
   #16a34a green accent, #f59e0b confetti, #cbd5e1 dashed border. */

.xl-se-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.xl-se-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
}

.xl-se-card {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  background: var(--white);
  border-radius: 18px;
  padding: 34px 26px 24px;
  /* natural-shadows Level 5 (modal) — NOT the design's 0.4 raw value */
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  text-align: center;
  overflow: hidden;
}

/* ── Confetti ─────────────────────────────────────────────────────────── */
.xl-se-confetti {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  pointer-events: none;
}
.xl-se-confetti span {
  position: absolute;
  top: 0;
}
.xl-se-c1 {
  left: 14%;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--blue);
  animation: xl-se-fall 2.4s ease-in 0.2s infinite;
}
.xl-se-c2 {
  left: 32%;
  width: 6px;
  height: 10px;
  background: #16a34a;
  animation: xl-se-fall 2.6s ease-in 0.5s infinite;
}
.xl-se-c3 {
  left: 52%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  animation: xl-se-fall 2.2s ease-in 0.1s infinite;
}
.xl-se-c4 {
  left: 70%;
  width: 6px;
  height: 9px;
  background: var(--blue);
  animation: xl-se-fall 2.7s ease-in 0.7s infinite;
}
.xl-se-c5 {
  left: 86%;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--blue-deep);
  animation: xl-se-fall 2.5s ease-in 0.35s infinite;
}

/* ── Check badge ──────────────────────────────────────────────────────── */
.xl-se-badge {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
}
.xl-se-badge-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--green-light);
  animation: xl-se-ring 0.5s ease-out both;
}
.xl-se-badge-svg {
  position: absolute;
  inset: 0;
}
.xl-se-badge-arc {
  animation: xl-se-draw 0.6s ease-out 0.15s both;
}
.xl-se-badge-check {
  animation: xl-se-draw 0.4s ease-out 0.45s both;
}

/* ── Text ─────────────────────────────────────────────────────────────── */
.xl-se-title {
  font-size: 20px; /* no 20px token — kept literal (flagged) */
  font-weight: var(--fw-extrabold);
  color: var(--ink);
  margin: 0 0 4px;
}
.xl-se-copy {
  font-size: var(--fs-md);
  color: var(--slate);
  margin: 0 0 18px;
}

/* ── Active-until box ─────────────────────────────────────────────────── */
.xl-se-expiry {
  border: 1.5px dashed #cbd5e1; /* no exact token — kept literal (flagged) */
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.xl-se-expiry-label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em; /* present in the design */
  color: var(--muted);
  text-transform: uppercase;
}
.xl-se-expiry-date {
  font-size: 30px; /* no 30px token — kept literal (flagged) */
  font-weight: var(--fw-extrabold);
  color: var(--ink);
  line-height: 1.1;
  margin-top: 4px;
}

/* ── Days pill ────────────────────────────────────────────────────────── */
.xl-se-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-light);
  color: var(--blue);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

/* ── Button ───────────────────────────────────────────────────────────── */
.xl-se-btn {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  padding: 13px 14px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  background: var(--blue);
  color: var(--white);
  transition: background 0.15s ease;
}
.xl-se-btn:hover {
  background: var(--blue-dark);
}

/* ── Keyframes (verbatim from the design) ─────────────────────────────── */
@keyframes xl-se-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes xl-se-ring {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes xl-se-fall {
  0% {
    transform: translateY(-14px) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translateY(150px) rotate(320deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xl-se-confetti {
    display: none;
  }
  .xl-se-badge-ring,
  .xl-se-badge-arc,
  .xl-se-badge-check {
    animation: none;
  }
  /* render the checkmark + arc in their final drawn state */
  .xl-se-badge-arc,
  .xl-se-badge-check {
    stroke-dashoffset: 0;
  }
}
