.billing-experience {
  display: grid;
  gap: 22px;
}

.billing-hero-panel,
.billing-card,
.billing-checkout,
.billing-storage-card,
.billing-history-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.68)),
    rgba(255, 255, 255, 0.04);
  box-shadow: 0 28px 90px rgba(2, 6, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(150%);
}

.light-theme .billing-hero-panel,
.light-theme .billing-card,
.light-theme .billing-checkout,
.light-theme .billing-storage-card,
.light-theme .billing-history-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(241, 245, 249, 0.76)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.billing-hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: clamp(24px, 4vw, 38px);
}

.billing-hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.26), transparent 68%);
  pointer-events: none;
}

.billing-hero-panel h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(32px, 6vw, 68px);
  line-height: 0.96;
  letter-spacing: 0;
}

.billing-hero-panel p {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted-text, #94a3b8);
  font-size: 1rem;
  line-height: 1.7;
}

.billing-hero-stats,
.billing-status-strip,
.billing-storage-grid,
.billing-history-grid {
  display: grid;
  gap: 14px;
}

.billing-hero-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 26px;
}

.billing-hero-stats article,
.billing-status-strip article {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.billing-hero-stats span,
.billing-status-strip span,
.billing-card small,
.billing-history-card span {
  display: block;
  color: var(--muted-text, #94a3b8);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.billing-hero-stats strong,
.billing-status-strip strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.billing-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  width: fit-content;
  padding: 5px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
}

.billing-toggle button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  color: inherit;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.billing-toggle button.is-active {
  color: #020617;
  background: #f8fafc;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.18);
}

.billing-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.billing-card {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 560px;
  flex-direction: column;
  border-radius: 28px;
  padding: 24px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.billing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(45, 212, 191, 0.52);
  box-shadow: 0 36px 110px rgba(20, 184, 166, 0.14);
}

.billing-card.is-featured {
  border-color: rgba(56, 189, 248, 0.6);
}

.billing-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 7px 11px;
  color: #06111f;
  background: linear-gradient(135deg, #67e8f9, #a7f3d0);
  font-size: 0.75rem;
  font-weight: 900;
}

.billing-card h3 {
  margin: 22px 0 8px;
  font-size: 1.45rem;
}

.billing-price {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-top: 16px;
}

.billing-price strong {
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0;
}

.billing-card ul {
  display: grid;
  gap: 11px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.billing-card li {
  color: var(--muted-text, #cbd5e1);
  line-height: 1.45;
}

.light-theme .billing-card h3,
.light-theme .billing-price strong,
.light-theme .billing-price span {
  color: #07182f;
}

.light-theme .billing-card small,
.light-theme .billing-card p {
  color: #344761;
  font-weight: 750;
}

.light-theme .billing-card li {
  color: #263a56;
  font-weight: 850;
}

.light-theme .billing-card li::before {
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.38);
}

.billing-card li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.6);
}

.billing-card-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.billing-card-actions button,
.billing-checkout button,
.billing-storage-card button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
}

.billing-primary {
  color: #020617;
  background: #f8fafc;
}

.billing-secondary {
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
}

.billing-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(20px) saturate(150%);
}

.billing-checkout {
  width: min(760px, 100%);
  max-height: min(860px, 92vh);
  overflow: auto;
  border-radius: 30px;
  padding: 26px;
}

.billing-plan-selector {
  width: min(1240px, calc(100vw - 36px));
  max-height: min(900px, calc(100dvh - 36px));
  padding: clamp(22px, 2.8vw, 34px);
}

.billing-plan-selector .billing-checkout-header {
  margin-bottom: 18px;
}

.billing-plan-selector .billing-plans-grid {
  grid-template-columns: repeat(3, minmax(280px, 1fr));
}

.billing-plan-selector .billing-card {
  min-height: 500px;
  padding: 22px;
}

.billing-payment-sheet {
  width: min(860px, calc(100vw - 36px));
  background:
    radial-gradient(circle at 14% 12%, rgba(0, 217, 255, 0.2), transparent 22rem),
    radial-gradient(circle at 88% 6%, rgba(255, 183, 55, 0.18), transparent 18rem),
    linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.86));
}

.light-theme .billing-payment-sheet {
  background:
    radial-gradient(circle at 14% 12%, rgba(0, 217, 255, 0.18), transparent 22rem),
    radial-gradient(circle at 88% 6%, rgba(255, 183, 55, 0.16), transparent 18rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(241, 250, 252, 0.88));
}

.billing-payment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 18px;
  margin: 20px 0;
}

.billing-payment-brand {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(0, 217, 255, 0.22);
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.07);
}

.billing-payment-brand img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(0, 217, 255, 0.18));
}

.billing-payment-brand strong {
  font-size: 1.05rem;
}

.billing-payment-brand span {
  color: var(--muted-text, #94a3b8);
  line-height: 1.5;
}

.billing-checkout-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.billing-checkout-close {
  width: 42px;
  height: 42px;
  border-radius: 50% !important;
  color: inherit;
  background: rgba(255, 255, 255, 0.08) !important;
}

.billing-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.billing-total {
  font-size: 1.4rem;
  font-weight: 900;
}

.billing-coupon {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.billing-coupon input {
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 0 14px;
  color: inherit;
  background: rgba(255, 255, 255, 0.06);
}

.billing-storage-grid,
.billing-history-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.billing-storage-card,
.billing-history-card {
  border-radius: 22px;
  padding: 20px;
}

.billing-welcome-back {
  cursor: pointer;
}

.billing-welcome-card {
  position: relative;
  overflow: hidden;
  width: min(520px, calc(100vw - 34px));
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid rgba(45, 212, 191, 0.34);
  border-radius: 28px;
  color: #f8fafc;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(45, 212, 191, 0.28), transparent 16rem),
    radial-gradient(circle at 18% 20%, rgba(56, 189, 248, 0.22), transparent 14rem),
    linear-gradient(145deg, rgba(2, 6, 23, 0.96), rgba(6, 32, 44, 0.92));
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: default;
  animation: billingWelcomeIn 260ms ease both;
}

.billing-welcome-card img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 20px rgba(45, 212, 191, 0.5));
}

.billing-welcome-card h2 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.billing-welcome-card p:not(.eyebrow) {
  max-width: 34rem;
  margin: 16px auto 0;
  color: #cbd5e1;
  line-height: 1.6;
}

.billing-welcome-card button {
  min-height: 48px;
  margin-top: 24px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  color: #04111f;
  background: linear-gradient(135deg, #67e8f9, #a7f3d0);
  font-weight: 950;
}

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

@media (max-width: 980px) {
  .billing-hero-stats,
  .billing-plans-grid,
  .billing-storage-grid,
  .billing-history-grid {
    grid-template-columns: 1fr;
  }

  .billing-card {
    min-height: auto;
  }

  .billing-plan-selector .billing-plans-grid,
  .billing-payment-layout {
    grid-template-columns: 1fr;
  }
}
