/* Purchase page: two plan cards drawn like the panel's (chamfered corners, accent diagonals), green buy buttons, a result band after Stripe. */

.buy-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
/* One centred column: title and status stacked in the middle, the two cards under them, steps and small print the same width. */
.buy-main { flex: 1; padding: 64px 0 96px; }
.buy-main .wrap { --wrap: 960px; }
.buy-main .section-head {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 16px;
  margin-bottom: 40px;
  text-align: center;
}
.buy-main .eyebrow { justify-content: center; }
.buy-main h1 {
  margin: 12px 0 0;
  font: 700 clamp(34px, 4.2vw, 54px)/1.05 var(--font-display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.buy-main .section-head p.note { max-width: 38em; }
.buy-status b { color: var(--text); font-weight: 700; }
.buy-status a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(242, 170, 59, 0.55); }
.buy-status a:hover { text-decoration-color: currentColor; }

/* Loading placeholder, as the panel draws it. */
.sk {
  display: inline-block;
  width: 14ch;
  max-width: 100%;
  height: 0.85em;
  vertical-align: -0.08em;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.13) 50%, rgba(255, 255, 255, 0.05) 70%) 0 0 / 300% 100%;
  animation: sk 1.4s linear infinite;
}
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- Result band: what came of the checkout the visitor just left (always in the page so its first message is read out) ---------- */

.buy-result[data-kind="none"] { padding: 0; margin: 0; background: none; box-shadow: none; }
.buy-result {
  --c: var(--info);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 0 0 32px;
  padding: 16px 20px;
  background: color-mix(in srgb, var(--c) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--c);
}
.buy-result[data-kind="done"] { --c: var(--ok); }
.buy-result[data-kind="error"] { --c: var(--danger); }
.buy-result p { margin: 0; flex: 1 1 260px; line-height: 1.45; }
.buy-result b { color: var(--text); font-weight: 700; }
.buy-result-actions:empty { display: none; }
.buy-result .btn { --cut: 8px; min-height: 42px; padding: 0 1.2em; font-size: 0.9rem; }
.buy-result[data-kind="wait"] p::before {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.6em;
  border: 2px solid var(--c);
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.05em;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Plans ---------- */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.plan {
  --cut: 14px;
  --frame: var(--line);
  --frame-strong: var(--line-strong);
  --corner: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  padding: 30px 32px 32px;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background:
    linear-gradient(to bottom right, transparent 50%, var(--corner) 50%, var(--corner) calc(50% + 2px), transparent calc(50% + 2px)) top left / var(--cut) var(--cut) no-repeat,
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--frame-strong) calc(50% - 1px), var(--frame-strong) 50%, transparent 50%) bottom right / var(--cut) var(--cut) no-repeat,
    linear-gradient(var(--frame), var(--frame)) top right / calc(100% - var(--cut)) 1px no-repeat,
    linear-gradient(var(--frame), var(--frame)) top right / 1px calc(100% - var(--cut)) no-repeat,
    linear-gradient(var(--frame), var(--frame)) bottom left / calc(100% - var(--cut)) 1px no-repeat,
    linear-gradient(var(--frame), var(--frame)) bottom left / 1px calc(100% - var(--cut)) no-repeat,
    var(--bg-raised);
}
.plan.is-best {
  --frame: rgba(84, 214, 143, 0.5);
  --frame-strong: rgba(84, 214, 143, 0.85);
  --corner: var(--ok);
  background-color: #0c1a26;
}
.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 26px;
}
.plan h2 {
  margin: 0;
  font: 700 0.78rem/1.2 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 11px;
  font: 700 0.7rem/1 var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ok);
  background: rgba(84, 214, 143, 0.14);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.plan-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.plan-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: -6px 0 0;
}
.plan-amount {
  font: 700 clamp(46px, 5vw, 62px)/1 var(--font-display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.plan-term {
  font: 700 1.05rem/1.2 var(--font-display);
  letter-spacing: 0.04em;
  color: var(--muted);
}
.plan ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}
.plan li {
  position: relative;
  padding-left: 18px;
  font-size: 1rem;
  line-height: 1.35;
  color: #cfd8e4;
}
.plan li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.52em;
  width: 5px;
  height: 5px;
  background: var(--ok);
  transform: rotate(45deg);
}
.plan-buy {
  width: 100%;
  min-height: 54px;
  margin-top: auto;
  font-size: 1rem;
}
.plan-buy[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.plan-buy[disabled]:hover { background: var(--ok); }
.plan-buy.is-busy, .plan-buy.is-busy[disabled] { opacity: 1; cursor: progress; }

.buy-msg { margin: 16px 0 0; color: var(--danger); line-height: 1.4; text-align: center; }
.buy-msg:empty { display: none; }

/* ---------- How it works ---------- */

.buy-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 32px;
  margin: 48px 0 0;
  padding: 32px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  counter-reset: step;
}
.buy-steps li {
  position: relative;
  padding-left: 44px;
  color: var(--muted);
  line-height: 1.45;
  counter-increment: step;
  text-wrap: pretty;
}
.buy-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font: 700 0.8rem/1 var(--font-display);
  color: var(--on-accent);
  background: var(--accent);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.buy-steps b { color: var(--text); }
.buy-fine {
  margin: 28px auto 0;
  max-width: 60em;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  text-wrap: pretty;
}

/* ---------- Phones ---------- */

@media (max-width: 720px) {
  .buy-main { padding: 36px 0 64px; }
  .buy-main .section-head { margin-bottom: 28px; }
  .plans { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .plan { padding: 24px 22px 26px; }
  .buy-steps { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 36px; }
  .buy-fine { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .sk, .buy-result[data-kind="wait"] p::before { animation: none; }
}
