@font-face { font-family: "Figtree"; src: url("/billing/fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("/billing/fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #0b0e15;
  --night: #0e1219;
  --deck: #131823;
  --raise: #1a2030;
  --raise-2: #212839;
  --line: #232b3b;
  --line-2: #2e3749;
  --text: #e9ecf3;
  --soft: #b4bbcc;
  --fog: #8b93a7;
  --dim: #5f677b;
  --lamp: #f5a524;
  --lamp-2: #ffd27a;
  --lamp-ink: #1d1300;
  --lamp-soft: rgba(245, 165, 36, 0.12);
  --red: #ff5d6c;
  --red-soft: rgba(255, 93, 108, 0.12);
  --green: #3ddc97;
  --green-soft: rgba(61, 220, 151, 0.12);
  --moon: #8fa2ff;
  --display: "Bricolage", ui-sans-serif, system-ui, sans-serif;
  --body: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --r: 12px;
  --r-lg: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(900px 520px at 85% -10%, rgba(38, 47, 87, 0.75), transparent 65%), radial-gradient(700px 420px at -10% 10%, rgba(245, 165, 36, 0.06), transparent 60%); }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.025em; }
p { margin: 0; text-wrap: pretty; }
button { font: inherit; }
svg { display: block; flex: none; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(1120px, 100% - 32px); margin: 0 auto; padding: 22px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--lamp); text-decoration: none; font: 700 19px/1 var(--display); letter-spacing: -0.02em; }
.brand span { color: var(--text); }
.top-right { display: flex; align-items: center; gap: 10px; }
.secure-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--soft); font-size: 13px; font-weight: 600; }
.secure-pill svg { color: var(--green); }
.who { display: inline-flex; align-items: center; gap: 9px; color: var(--soft); font-size: 13.5px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--raise-2); color: var(--soft); font: 700 12px/1 var(--display); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.app { flex: 1; width: min(1120px, 100% - 32px); margin: 0 auto; padding: 12px 0 48px; }
.foot { width: min(1120px, 100% - 32px); margin: 0 auto; padding: 22px 0 32px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12.5px; }
.foot span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Buttons and inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--raise); color: var(--text); font-weight: 650; font-size: 14.5px; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, box-shadow .2s, opacity .15s; }
.btn:hover:not(:disabled) { background: var(--raise-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink); box-shadow: 0 10px 30px -12px rgba(245, 165, 36, 0.8); }
.btn.primary:hover:not(:disabled) { background: var(--lamp-2); border-color: var(--lamp-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--soft); }
.btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); }
.btn.danger { background: transparent; border-color: rgba(255, 93, 108, 0.4); color: #ff8a93; }
.btn.danger:hover:not(:disabled) { background: var(--red-soft); }
.btn.lg { min-height: 52px; font-size: 15.5px; border-radius: 14px; padding: 0 20px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span { color: var(--soft); font-size: 13px; font-weight: 550; }
.input { width: 100%; min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--night); color: var(--text); font: 15px var(--body); transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--dim); }
.input:hover { border-color: #3a4458; }
.input:focus { outline: none; border-color: var(--lamp); box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.18); }
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.spinner.lg { width: 28px; height: 28px; border-width: 3px; color: var(--lamp); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { min-height: 50vh; display: grid; place-items: center; }

/* ---------- Checkout ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 0; border-radius: 24px; border: 1px solid var(--line); background: var(--deck); overflow: hidden; box-shadow: 0 40px 100px -50px rgba(0, 0, 0, 0.9); animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.summary { position: relative; padding: 40px; border-right: 1px solid var(--line); background: linear-gradient(165deg, rgba(245, 165, 36, 0.09), transparent 42%), linear-gradient(180deg, #151b28, #11161f); overflow: hidden; }
.summary::after { content: ""; position: absolute; right: -90px; top: -90px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(closest-side, rgba(143, 162, 255, 0.18), transparent); pointer-events: none; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--lamp); font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 16px; height: 2px; border-radius: 2px; background: currentColor; }
.summary h1 { margin-top: 12px; font-size: 32px; line-height: 1.1; }
.tagline { margin-top: 8px; color: var(--soft); }
.price { display: flex; align-items: flex-end; gap: 12px; margin-top: 26px; }
.price b { font: 750 56px/.9 var(--display); letter-spacing: -0.04em; }
.price span { padding-bottom: 4px; color: var(--fog); font-size: 13.5px; line-height: 1.3; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(11, 14, 21, 0.55); }
.qty-row b { display: block; font-weight: 650; }
.qty-row span { display: block; color: var(--fog); font-size: 12.5px; }
.stepper { display: inline-flex; align-items: center; border-radius: 11px; border: 1px solid var(--line-2); background: var(--night); overflow: hidden; }
.stepper button { width: 38px; height: 38px; border: 0; background: transparent; color: var(--text); font-size: 18px; cursor: pointer; }
.stepper button:hover:not(:disabled) { background: var(--raise); }
.stepper button:disabled { color: var(--dim); cursor: not-allowed; }
.stepper output { min-width: 34px; text-align: center; font: 700 16px/1 var(--display); font-variant-numeric: tabular-nums; }
.lines { margin: 22px 0 0; display: grid; gap: 10px; }
.lines div { display: flex; justify-content: space-between; gap: 12px; }
.lines dt { color: var(--soft); }
.lines dd { margin: 0; font-variant-numeric: tabular-nums; }
.lines .muted dt, .lines .muted dd { color: var(--fog); font-size: 13px; }
.lines .total { margin-top: 6px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.lines .total dt { color: var(--text); font-weight: 650; }
.lines .total dd { font: 700 20px/1.2 var(--display); }
.perks { display: grid; gap: 9px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--soft); font-size: 14px; }
.perks li { display: flex; gap: 10px; }
.perks svg { margin-top: 3px; color: var(--green); }

.pay { padding: 40px; }
.pay h2 { font-size: 21px; margin-bottom: 20px; }
.test-banner { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 22px; padding: 10px 12px; border-radius: 10px; border: 1px dashed rgba(245, 165, 36, 0.5); background: var(--lamp-soft); color: var(--lamp-2); font-size: 13px; }
.test-banner code { font: 600 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }
.pe { min-height: 140px; }
.pe-loading { height: 140px; border-radius: 10px; background: linear-gradient(90deg, var(--night), var(--raise), var(--night)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pay .btn.primary { margin-top: 8px; }
.error { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: #ff8a93; font-size: 13.5px; }
.fine { margin-top: 14px; color: var(--fog); font-size: 12.5px; }
.secured { display: flex; gap: 12px; align-items: flex-start; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.secured > svg { margin-top: 2px; color: var(--green); }
.secured b { display: block; font-size: 13.5px; }
.secured span { display: block; color: var(--fog); font-size: 12.5px; }
.secured .stripe-word { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 9px; border-radius: 7px; background: rgba(99, 91, 255, 0.14); color: #a9a4ff; font-size: 12px; font-weight: 700; }
.brands { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.brands span { padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--fog); font-size: 11px; font-weight: 800; letter-spacing: .04em; }

.code-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.code-box summary { cursor: pointer; color: var(--soft); font-size: 13.5px; font-weight: 600; list-style: none; }
.code-box summary::-webkit-details-marker { display: none; }
.code-box summary::before { content: "+ "; color: var(--lamp); }
.code-box[open] summary::before { content: "– "; }
.code-form { display: flex; gap: 8px; margin-top: 12px; }
.code-form .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Center cards (signed out, free access, done) ---------- */
.center { display: grid; place-items: center; min-height: 58vh; }
.center-card { width: min(480px, 100%); padding: 36px; border-radius: 22px; border: 1px solid var(--line); background: var(--deck); text-align: center; animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.center-card h1 { font-size: 28px; margin-top: 18px; }
.center-card p { margin-top: 10px; color: var(--soft); }
.center-card .actions { display: grid; gap: 10px; margin-top: 26px; }
.badge-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; background: var(--lamp-soft); color: var(--lamp); }
.badge-icon.ok { background: var(--green-soft); color: var(--green); }
.done-mark { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); box-shadow: 0 0 0 10px rgba(61, 220, 151, 0.06); animation: pop .6s cubic-bezier(.2, 1.4, .3, 1) both; }
.done-mark svg { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .25s ease forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.discord-btn { background: #5865f2; border-color: #5865f2; color: #fff; box-shadow: 0 10px 30px -12px rgba(88, 101, 242, 0.9); }
.discord-btn:hover:not(:disabled) { background: #6b77f5 !important; }
.telegram-btn { background: #2aabee; border-color: #2aabee; color: #fff; }

/* ---------- Manage ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 26px; flex-wrap: wrap; }
.page-head h1 { margin-top: 10px; font-size: 34px; }
.banner { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(245, 165, 36, 0.35); background: var(--lamp-soft); color: var(--lamp-2); font-size: 14px; }
.banner.bad { border-color: rgba(255, 93, 108, 0.4); background: var(--red-soft); color: #ff9aa2; }
.banner > svg { margin-top: 2px; }
.banner .btn { margin-left: auto; flex: none; }
.grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.card { padding: 24px; border-radius: 20px; border: 1px solid var(--line); background: var(--deck); animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.card.wide { grid-column: 1 / -1; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card h2 { font-size: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--lamp-soft); color: var(--lamp); }
.pill.bad { background: var(--red-soft); color: #ff8a93; }
.pill.muted { background: var(--raise-2); color: var(--fog); }
.big { font: 750 44px/1 var(--display); letter-spacing: -0.035em; }
.big span { margin-left: 4px; color: var(--fog); font: 500 15px var(--body); letter-spacing: 0; }
.plan-sub { margin-top: 8px; color: var(--soft); }
.usage { margin-top: 20px; }
.bar { height: 8px; border-radius: 99px; background: var(--raise-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lamp), var(--lamp-2)); transition: width .5s; }
.bar.full i { background: linear-gradient(90deg, #ff8a5c, var(--lamp)); }
.usage span { display: block; margin-top: 8px; color: var(--fog); font-size: 13px; }
.qty-edit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.qty-edit .label { flex: 1; min-width: 160px; }
.qty-edit .label b { display: block; font-weight: 650; }
.qty-edit .label span { color: var(--fog); font-size: 12.5px; }
.cc { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: linear-gradient(135deg, #1b2133, #131823); }
.cc-brand { display: grid; place-items: center; min-width: 52px; height: 34px; padding: 0 8px; border-radius: 7px; background: #fff; color: #1a1f71; font: 800 13px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.cc b { display: block; font: 650 16px/1.3 var(--body); letter-spacing: .04em; }
.cc span { color: var(--fog); font-size: 12.5px; }
.method-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.card-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.mini-secure { display: flex; align-items: center; gap: 7px; margin-top: 14px; color: var(--fog); font-size: 12.5px; }
.mini-secure svg { color: var(--green); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 0 12px 10px; color: var(--fog); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 13px 12px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
td:last-child, th:last-child { text-align: right; }
td a { display: inline-flex; align-items: center; gap: 6px; color: var(--soft); text-decoration: none; font-weight: 600; }
td a:hover { color: var(--text); }
.empty { padding: 18px 0 4px; color: var(--fog); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.danger-row p { color: var(--fog); max-width: 560px; }
.preview { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 16px; border-radius: 14px; border: 1px dashed rgba(245, 165, 36, 0.45); background: var(--lamp-soft); }
.preview div { flex: 1; display: grid; gap: 2px; }
.preview b { color: var(--lamp); font-size: 14px; }
.preview span { color: var(--fog); font-size: 12.5px; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 99px; border: 0; background: var(--raise-2); cursor: pointer; transition: background-color .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--lamp); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(5, 7, 12, 0.7); backdrop-filter: blur(6px); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal-card { width: min(440px, 100%); padding: 26px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--deck); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9); animation: rise .3s both; }
.modal-card h2 { font-size: 21px; }
#modal-body { margin-top: 10px; color: var(--soft); font-size: 14.5px; }
#modal-body p + p { margin-top: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ---------- Small screens ---------- */
@media (max-width: 880px) {
  .checkout { grid-template-columns: minmax(0, 1fr); }
  .summary { border-right: 0; border-bottom: 1px solid var(--line); }
  .grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .summary, .pay { padding: 24px 20px; }
  .summary h1 { font-size: 26px; }
  .price b { font-size: 46px; }
  .card { padding: 20px; }
  .page-head h1 { font-size: 28px; }
  .secure-pill { display: none; }
  .center-card { padding: 28px 22px; }
  th:nth-child(2), td:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
