:root {
  --bill-ink: #171319;
  --bill-ink-soft: #4e4650;
  --bill-paper: #f4ede3;
  --bill-card: #fffdf9;
  --bill-line: #d8cdbf;
  --bill-violet: #7147f8;
  --bill-violet-dark: #4d2cc5;
  --bill-rose: #c77f78;
  --bill-success: #18794e;
  --bill-error: #a82c32;
  --bill-shadow: 0 28px 80px rgba(31, 20, 37, .14);
  --bill-focus: 0 0 0 4px rgba(113, 71, 248, .22);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; background: var(--bill-paper); }
body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--bill-ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(199, 127, 120, .18), transparent 31rem),
    radial-gradient(circle at 91% 86%, rgba(113, 71, 248, .11), transparent 34rem),
    var(--bill-paper);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.55;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

button, a { touch-action: manipulation; }
button { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--bill-violet-dark);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.billing-header {
  width: min(1280px, calc(100% - 40px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(23, 19, 25, .14);
}

.billing-brand {
  min-width: 120px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}
.billing-brand img { display: block; width: 110px; height: 40px; object-fit: contain; }
.billing-header-actions { display: flex; align-items: center; gap: 12px; }
.secure-pill, .workspace-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(23, 19, 25, .16);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.secure-pill svg, .checkout-footer svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.secure-pill { color: var(--bill-success); background: rgba(255, 255, 255, .48); }
.workspace-link { transition: background .18s ease, border-color .18s ease; }
.workspace-link:hover { border-color: var(--bill-ink); background: rgba(255, 255, 255, .65); }

.billing-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) 0 72px;
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(400px, 1.12fr);
  gap: clamp(44px, 7vw, 96px);
  align-items: start;
}

.billing-intro { min-width: 0; }
.billing-kicker {
  margin: 0 0 18px;
  color: var(--bill-violet-dark);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.billing-intro h1 {
  max-width: 680px;
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(42px, 5vw, 74px);
  line-height: .99;
  letter-spacing: -.055em;
}
.billing-intro h1 span { color: var(--bill-violet); }
.billing-lead {
  max-width: 610px;
  margin: 24px 0 28px;
  color: var(--bill-ink-soft);
  font-size: clamp(16px, 1.5vw, 18px);
}
.account-line {
  max-width: 610px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
  border-top: 1px solid var(--bill-line);
  border-bottom: 1px solid var(--bill-line);
  font-size: 13px;
}
.account-line span {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.account-line strong { overflow-wrap: anywhere; text-align: right; }

.plan-picker {
  max-width: 610px;
  margin: 30px 0 0;
  padding: 0;
  border: 0;
}
.plan-picker legend {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}
.plan-option {
  width: 100%;
  min-height: 82px;
  margin: 0 0 10px;
  padding: 15px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--bill-ink);
  text-align: left;
  border: 1px solid var(--bill-line);
  border-radius: 14px;
  background: rgba(255, 253, 249, .64);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.plan-option:hover { border-color: rgba(113, 71, 248, .58); background: var(--bill-card); }
.plan-option:focus-visible, .pay-button:focus-visible, a:focus-visible {
  outline: none;
  box-shadow: var(--bill-focus);
}
.plan-option.is-selected {
  border-color: var(--bill-violet);
  background: var(--bill-card);
  box-shadow: inset 4px 0 0 var(--bill-violet);
}
.plan-option > span { display: grid; gap: 2px; }
.plan-option strong { font-family: "Sora", sans-serif; font-size: 17px; }
.plan-option small { color: var(--bill-ink-soft); font-size: 12px; }
.plan-option em {
  width: max-content;
  color: var(--bill-violet-dark);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-style: normal;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.plan-option > b {
  flex: 0 0 auto;
  font-family: "Sora", sans-serif;
  font-size: 28px;
  letter-spacing: -.04em;
}
.plan-option > b i { font-size: 14px; font-style: normal; vertical-align: 8px; }
.plan-option > b small { margin-left: 3px; font-family: "Inter", sans-serif; font-weight: 500; }

.method-rail {
  max-width: 610px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 20px 0 0;
}
.method-rail span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(23, 19, 25, .15);
  border-radius: 8px;
  background: rgba(255, 255, 255, .42);
  font-size: 11px;
  font-weight: 600;
}
.trust-list {
  max-width: 610px;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  list-style: none;
}
.trust-list li { color: var(--bill-ink-soft); font-size: 12px; }
.trust-list svg {
  width: 16px;
  margin-right: 4px;
  fill: none;
  stroke: var(--bill-success);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}

.checkout-card {
  position: sticky;
  top: 28px;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(23, 19, 25, .16);
  border-radius: 20px;
  background: var(--bill-card);
  box-shadow: var(--bill-shadow);
}
.checkout-spine {
  position: relative;
  color: rgba(255, 255, 255, .7);
  background: var(--bill-ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: .18em;
}
.checkout-spine span {
  position: absolute;
  left: 50%;
  bottom: 24px;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-90deg);
}
.checkout-content { min-width: 0; padding: clamp(22px, 4vw, 36px); }
.checkout-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--bill-line);
}
.checkout-head p {
  margin: 0 0 3px;
  color: var(--bill-ink-soft);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.checkout-head h2 { margin: 0; font-family: "Sora", sans-serif; font-size: 20px; }
.checkout-head > strong {
  flex: 0 0 auto;
  font-family: "Sora", sans-serif;
  font-size: 24px;
  letter-spacing: -.04em;
  text-align: right;
}
.checkout-head > strong small {
  display: block;
  color: var(--bill-ink-soft);
  font-family: "Inter", sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .07em;
}

.current-plan, .provider-notice {
  min-height: 62px;
  margin: 18px 0 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
}
.current-plan { border: 1px solid rgba(24, 121, 78, .24); background: rgba(24, 121, 78, .07); }
.status-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--bill-success); box-shadow: 0 0 0 5px rgba(24, 121, 78, .12); }
.current-plan p, .provider-notice p { margin: 0; display: grid; }
.current-plan b, .provider-notice b { font-size: 13px; }
.current-plan small, .provider-notice small { color: var(--bill-ink-soft); font-size: 11px; }

.checkout-stage {
  min-height: 330px;
  padding: 46px 24px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.checkout-mark {
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  padding: 10px;
  color: var(--bill-violet);
  border: 1px solid rgba(113, 71, 248, .24);
  border-radius: 50%;
  background: rgba(113, 71, 248, .07);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.checkout-stage h3 { margin: 0; font-family: "Sora", sans-serif; font-size: 20px; }
.checkout-stage p { max-width: 330px; margin: 10px 0 22px; color: var(--bill-ink-soft); font-size: 13px; }
.pay-button {
  width: min(100%, 350px);
  min-height: 50px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fff;
  border: 0;
  border-radius: 10px;
  background: var(--bill-violet);
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, opacity .18s ease;
}
.pay-button:hover:not(:disabled) { background: var(--bill-violet-dark); }
.pay-button:disabled { opacity: .48; cursor: not-allowed; }
.pay-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.provider-notice {
  margin: 18px 0;
  border: 1px solid var(--bill-line);
  background: #f8f3ec;
}
.provider-notice.is-ready { border-color: rgba(24, 121, 78, .24); background: rgba(24, 121, 78, .07); }
.provider-notice.is-error { border-color: rgba(168, 44, 50, .24); background: rgba(168, 44, 50, .07); }
.notice-spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 2px solid rgba(113, 71, 248, .2);
  border-top-color: var(--bill-violet);
  border-radius: 50%;
  animation: bill-spin .8s linear infinite;
}
.provider-notice.is-ready .notice-spinner { border: 0; background: var(--bill-success); animation: none; }
.provider-notice.is-error .notice-spinner { border: 0; background: var(--bill-error); animation: none; }

.paddle-checkout { display: none; width: 100%; min-width: 0; }
.paddle-checkout.is-open { display: block; min-height: 560px; }
.checkout-status { min-height: 20px; margin: 12px 0 0; color: var(--bill-ink-soft); font-size: 12px; }
.checkout-status.is-error { color: var(--bill-error); }
.checkout-status.is-success { color: var(--bill-success); }
.checkout-footer {
  min-height: 48px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--bill-line);
  color: var(--bill-ink-soft);
  font-size: 10px;
}
.checkout-footer span { display: inline-flex; align-items: center; gap: 6px; }
.checkout-footer a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: flex-end; }

@keyframes bill-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .billing-main { grid-template-columns: 1fr; max-width: 720px; }
  .checkout-card { position: static; }
}

@media (max-width: 620px) {
  .billing-header { width: calc(100% - 28px); min-height: 72px; }
  .secure-pill { display: none; }
  .workspace-link { padding: 0 11px; font-size: 12px; }
  .billing-main { width: calc(100% - 28px); padding: 42px 0 48px; gap: 38px; }
  .billing-intro h1 { font-size: clamp(39px, 12vw, 56px); }
  .billing-lead { font-size: 16px; }
  .account-line { align-items: flex-start; flex-direction: column; gap: 2px; padding: 10px 2px; }
  .account-line strong { text-align: left; }
  .trust-list { grid-template-columns: 1fr; gap: 8px; }
  .checkout-card { grid-template-columns: 24px minmax(0, 1fr); border-radius: 16px; }
  .checkout-content { padding: 20px 16px; }
  .checkout-head { align-items: flex-end; }
  .checkout-head > strong { font-size: 21px; }
  .checkout-stage { min-height: 300px; padding-inline: 6px; }
  .paddle-checkout.is-open { min-height: 620px; }
}

@media (max-width: 390px) {
  .billing-brand img { width: 98px; height: auto; }
  .plan-option { align-items: flex-start; }
  .plan-option > b { font-size: 24px; }
  .checkout-head { flex-direction: column; align-items: flex-start; }
  .checkout-head > strong { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
