/* Checkout: cinematic single-column flow */
@property --checkout-ring {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.checkout-modal {
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(var(--accent-rgb), .22), transparent 55%),
    rgba(3, 4, 10, .86);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.checkout-modal-card.checkout-minimal {
  isolation: isolate;
  width: min(580px, calc(100vw - 32px));
  max-height: min(94vh, 920px);
  padding: 0;
  overflow-x: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: color-mix(in srgb, var(--bg-secondary, #0b0f18) 92%, #04050a);
  box-shadow:
    0 50px 140px -20px rgba(0, 0, 0, .75),
    0 0 0 1px rgba(var(--accent-rgb), .06),
    inset 0 1px 0 rgba(255, 255, 255, .07);
  opacity: 0;
  transform: translateY(46px) scale(.94) rotateX(8deg);
  transform-origin: 50% 100%;
  filter: blur(12px);
  transition:
    transform 760ms cubic-bezier(.16, 1, .3, 1),
    opacity 520ms ease,
    filter 640ms cubic-bezier(.16, 1, .3, 1);
}

.checkout-modal.is-visible .checkout-modal-card.checkout-minimal {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Living aurora behind the content */
.checkout-cinema {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.checkout-cinema i {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0;
  transition: opacity 1.4s ease .2s;
}

.checkout-cinema i:nth-child(1) {
  width: 360px;
  height: 260px;
  top: -140px;
  left: -80px;
  background: rgba(var(--accent-rgb), .55);
}

.checkout-cinema i:nth-child(2) {
  width: 300px;
  height: 240px;
  top: -120px;
  right: -110px;
  background: rgba(139, 92, 246, .42);
}

.checkout-cinema i:nth-child(3) {
  width: 420px;
  height: 200px;
  bottom: -150px;
  left: 20%;
  background: rgba(34, 211, 238, .16);
}

.checkout-modal.is-visible .checkout-cinema i { opacity: .55; }
.checkout-modal.is-visible .checkout-cinema i:nth-child(1) { animation: checkoutDriftA 14s ease-in-out infinite alternate; }
.checkout-modal.is-visible .checkout-cinema i:nth-child(2) { animation: checkoutDriftB 17s ease-in-out infinite alternate; }
.checkout-modal.is-visible .checkout-cinema i:nth-child(3) { animation: checkoutDriftA 20s ease-in-out infinite alternate-reverse; }

.checkout-cinema::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--bg-secondary, #0b0f18) 70%, transparent) 42%, transparent 100%);
}

/* Header */
.checkout-minimal .checkout-head {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 28px 34px 4px;
  border: 0;
}

.checkout-minimal .checkout-kicker-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  margin: 0;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), .28);
  background: rgba(var(--accent-rgb), .1);
  color: color-mix(in srgb, var(--accent-primary) 55%, #fff);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
}

.checkout-minimal .checkout-kicker-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5eead4;
  box-shadow: 0 0 10px #5eead4;
}

.checkout-minimal .checkout-section-title {
  margin: 6px 0 0;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 720;
  line-height: 1.06;
  letter-spacing: -.04em;
  color: var(--text-primary);
}

.checkout-lead {
  max-width: 440px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

/* Plan ticket with a rotating light rim */
.checkout-minimal .checkout-plan-card {
  position: relative;
  display: grid;
  gap: 16px;
  margin: 18px 34px 0;
  padding: 20px 22px 18px;
  border: 0;
  border-radius: 20px;
  background:
    linear-gradient(160deg, rgba(var(--accent-rgb), .14), transparent 55%),
    rgba(255, 255, 255, .025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.checkout-minimal .checkout-plan-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--checkout-ring), rgba(255, 255, 255, .06) 0deg, rgba(var(--accent-rgb), .9) 60deg, rgba(139, 92, 246, .6) 110deg, rgba(255, 255, 255, .06) 170deg, rgba(255, 255, 255, .06) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.checkout-modal.is-visible .checkout-plan-card::before {
  animation: checkoutRing 7s linear infinite;
}

.checkout-minimal .checkout-plan-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 0;
}

.checkout-minimal .checkout-plan-copy { display: grid; gap: 5px; min-width: 0; }

.checkout-plan-tag {
  color: var(--text-soft, var(--text-secondary));
  font-size: 11px;
  font-weight: 600;
}

.checkout-minimal .checkout-plan-name {
  color: var(--text-primary);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-transform: none;
}

.checkout-minimal .checkout-savings {
  justify-self: start;
  margin-top: 2px;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(52, 211, 153, .12);
  color: #6ee7b7;
  font-size: 11.5px;
  font-weight: 650;
}

.checkout-minimal .checkout-price-block { text-align: right; }

.checkout-minimal .checkout-amount {
  font-size: clamp(28px, 5vw, 34px);
  font-weight: 760;
  letter-spacing: -.045em;
  background: linear-gradient(100deg, var(--text-primary) 30%, color-mix(in srgb, var(--accent-primary) 50%, #fff) 50%, var(--text-primary) 70%);
  background-size: 250% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.checkout-modal.is-visible .checkout-amount {
  animation: checkoutPriceShine 1.8s .9s cubic-bezier(.4, 0, .2, 1) both;
}

.checkout-minimal .checkout-amount-year {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.checkout-included {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, .1);
}

.checkout-step-title {
  color: var(--text-soft, var(--text-secondary));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.checkout-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checkout-features li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.35;
}

.checkout-features li i {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(52, 211, 153, .16);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .35);
}

.checkout-features li i::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 4px;
  height: 7px;
  border: solid #6ee7b7;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkout-modal.is-visible .checkout-features li {
  animation: checkoutReveal .6s calc(.5s + var(--i, 0) * .08s) cubic-bezier(.16, 1, .3, 1) both;
}

.checkout-modal.is-visible .checkout-features li i {
  animation: checkoutPop .5s calc(.62s + var(--i, 0) * .08s) cubic-bezier(.34, 1.56, .64, 1) both;
}

.checkout-minimal .checkout-expiry {
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  color: var(--text-secondary) !important;
  font-size: 12.5px;
}

/* Payment method */
.checkout-method {
  display: grid;
  gap: 9px;
  margin: 18px 34px 0;
}

.checkout-minimal .payment-segment-shell {
  width: 100%;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}

.checkout-minimal .payment-method-tabs .ghost-button {
  min-height: 42px;
  border-radius: 10px;
  font-size: 13px;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}

.checkout-minimal .payment-method-tabs .ghost-button:hover { color: var(--text-primary); }

.checkout-minimal .payment-method-tabs .ghost-button.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .42), rgba(139, 92, 246, .28));
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .4), 0 8px 22px -8px rgba(var(--accent-rgb), .6);
}

.checkout-minimal .checkout-instructions {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.checkout-minimal .checkout-box { margin: 18px 34px 0; padding: 18px 0 0; }

/* Footer */
.checkout-minimal .checkout-foot {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px 34px 24px;
}

.checkout-minimal .checkout-status-banner { margin: 0; }

.checkout-minimal .checkout-pay-button {
  position: relative;
  min-height: 56px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(110deg, var(--accent-primary), color-mix(in srgb, var(--accent-primary) 50%, #8b5cf6) 60%, #8b5cf6);
  box-shadow: 0 18px 40px -12px rgba(var(--accent-rgb), .7), inset 0 1px 0 rgba(255, 255, 255, .25);
  font-size: 15px;
  font-weight: 720;
  transition: transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .25s ease, filter .2s ease;
}

.checkout-minimal .checkout-pay-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  transform: translateX(-130%);
}

.checkout-modal.is-visible .checkout-pay-button::after {
  animation: checkoutButtonShine 5s 1.2s ease-in-out infinite;
}

.checkout-minimal .checkout-pay-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(110deg, var(--accent-primary), color-mix(in srgb, var(--accent-primary) 50%, #8b5cf6) 60%, #8b5cf6);
  box-shadow: 0 24px 50px -12px rgba(var(--accent-rgb), .8), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.checkout-minimal .checkout-pay-button:active { transform: translateY(0) scale(.985); }

.checkout-minimal .checkout-promo-toggle {
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
}

.checkout-minimal .checkout-promo-toggle:hover { color: var(--text-primary); }

.checkout-assurance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 2px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
  list-style: none;
}

.checkout-assurance li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.checkout-assurance svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  fill: none;
  stroke: color-mix(in srgb, var(--accent-primary) 65%, #fff);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.checkout-assurance span { display: grid; gap: 1px; min-width: 0; }
.checkout-assurance b { color: var(--text-primary); font-size: 12px; font-weight: 650; }
.checkout-assurance small { color: var(--text-soft, var(--text-secondary)); font-size: 11px; line-height: 1.35; }

.checkout-minimal .checkout-modal-close {
  top: 22px;
  right: 22px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .05);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1), background .2s ease;
}

.checkout-minimal .checkout-modal-close:hover { transform: rotate(90deg); }

/* Staged entrance */
.checkout-modal.is-visible :is(.checkout-head > *, .checkout-plan-card, .checkout-method, .checkout-box, .checkout-foot > *) {
  animation: checkoutReveal .8s cubic-bezier(.16, 1, .3, 1) both;
}
.checkout-modal.is-visible .checkout-head > :nth-child(1) { animation-delay: .12s; }
.checkout-modal.is-visible .checkout-head > :nth-child(2) { animation-delay: .18s; }
.checkout-modal.is-visible .checkout-head > :nth-child(3) { animation-delay: .24s; }
.checkout-modal.is-visible .checkout-plan-card { animation-delay: .32s; }
.checkout-modal.is-visible .checkout-method { animation-delay: .44s; }
.checkout-modal.is-visible .checkout-box { animation-delay: .5s; }
.checkout-modal.is-visible .checkout-foot > :nth-child(1) { animation-delay: .54s; }
.checkout-modal.is-visible .checkout-foot > :nth-child(2) { animation-delay: .58s; }
.checkout-modal.is-visible .checkout-foot > :nth-child(3) { animation-delay: .64s; }
.checkout-modal.is-visible .checkout-foot > :nth-child(n + 4) { animation-delay: .7s; }

@keyframes checkoutReveal {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes checkoutPop {
  from { opacity: 0; transform: scale(.3); }
  to { opacity: 1; transform: none; }
}
@keyframes checkoutRing { to { --checkout-ring: 360deg; } }
@keyframes checkoutPriceShine { to { background-position: 0 0; } }
@keyframes checkoutButtonShine {
  0%, 62% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}
@keyframes checkoutDriftA { to { transform: translate(60px, 40px) scale(1.15); } }
@keyframes checkoutDriftB { to { transform: translate(-50px, 30px) scale(.9); } }

/* White theme */
body[data-theme="white"] .checkout-modal { background: rgba(15, 23, 42, .32); }
body[data-theme="white"] .checkout-modal-card.checkout-minimal {
  background: #fff;
  border-color: rgba(15, 23, 42, .08);
  box-shadow: 0 40px 110px -20px rgba(15, 23, 42, .35);
}
body[data-theme="white"] .checkout-cinema::after { background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .8) 42%, transparent); }
body[data-theme="white"] .checkout-modal.is-visible .checkout-cinema i { opacity: .22; }
body[data-theme="white"] .checkout-minimal .checkout-kicker-label { color: var(--accent-primary); }
body[data-theme="white"] .checkout-minimal .checkout-plan-card { background: linear-gradient(160deg, rgba(var(--accent-rgb), .08), transparent 55%), #f8fafc; box-shadow: none; }
body[data-theme="white"] .checkout-included { border-top-color: rgba(15, 23, 42, .12); }
body[data-theme="white"] .checkout-minimal .checkout-savings { color: #047857; background: rgba(16, 185, 129, .12); }
body[data-theme="white"] .checkout-features li i::after { border-color: #059669; }
body[data-theme="white"] .checkout-minimal .checkout-expiry { background: rgba(15, 23, 42, .04); }
body[data-theme="white"] .checkout-minimal .payment-segment-shell { background: rgba(15, 23, 42, .035); border-color: rgba(15, 23, 42, .08); }
body[data-theme="white"] .checkout-minimal .payment-method-tabs .ghost-button.is-active { color: #fff; }
body[data-theme="white"] .checkout-assurance { border-top-color: rgba(15, 23, 42, .08); }
body[data-theme="white"] .checkout-assurance svg { stroke: var(--accent-primary); }
body[data-theme="white"] .checkout-minimal .checkout-modal-close { color: #334155; background: rgba(15, 23, 42, .045); border-color: rgba(15, 23, 42, .08); }

@media (max-width: 560px) {
  .checkout-modal { padding: 10px; }
  .checkout-modal-card.checkout-minimal { width: calc(100vw - 20px); border-radius: 24px; }
  .checkout-minimal .checkout-head { padding: 26px 20px 4px; }
  .checkout-minimal .checkout-plan-card,
  .checkout-method,
  .checkout-minimal .checkout-box { margin-left: 20px; margin-right: 20px; }
  .checkout-minimal .checkout-foot { padding: 20px 20px 22px; }
  .checkout-minimal .checkout-plan-hero { flex-direction: column; }
  .checkout-minimal .checkout-price-block { text-align: left; }
  .checkout-features { grid-template-columns: 1fr; }
  .checkout-assurance { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .checkout-modal-card.checkout-minimal { transform: none; filter: none; transition: opacity .2s ease; }
  .checkout-modal.is-visible :is(.checkout-cinema i, .checkout-head > *, .checkout-plan-card, .checkout-plan-card::before, .checkout-method, .checkout-box, .checkout-foot > *, .checkout-features li, .checkout-features li i, .checkout-amount, .checkout-pay-button::after) {
    animation: none;
  }
}
