/**
 * Checkout pages (purchase.html, receipt.html).
 *
 * Tokens and shell (nav/footer/cta-btn) are kept identical to index.html's
 * inline <style> block so a buyer moving from the landing page into checkout
 * sees one continuous site. If index.html's palette ever changes, change it
 * here too — index.html is a single self-contained file and does not share a
 * stylesheet with anything.
 */

:root {
  --bg-main: #080b10;
  --bg-card: #111520;
  --accent: #4ade80;
  --accent-hover: #22c55e;
  --accent-glow: rgba(74, 222, 128, 0.18);
  --blue: #38bdf8;
  --crypto: #f59e0b;
  --crypto-hover: #d97706;
  --text-main: #f1f5f9;
  --text-muted: #7c8ba4;
  --border: #1e2535;
  --border-bright: #2a3347;
  --danger: #f87171;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: inherit;
  background-color: var(--bg-main);
  color: var(--text-main);
  margin: 0;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Base link colour. Without this, anchors inside cards and callouts fall back
   to the browser default dark blue, which is nearly invisible on this
   background. Nav and footer links set their own colour and override this. */
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAV (mirrors index.html) ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 6%;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 11, 16, 0.85);
  backdrop-filter: blur(14px);
}
.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-dot { color: var(--accent); }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 28px;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: #fff; }

/* ── PAGE SHELL ── */
.checkout-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 20px 72px;
}
.checkout-head { text-align: center; margin-bottom: 36px; }
.checkout-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crypto);
  font-weight: 700;
  margin: 0 0 18px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 5px 12px;
  border-radius: 20px;
}
.checkout-head h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  margin: 0 0 14px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.8px;
}
.checkout-head p {
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 480px;
  font-size: 0.98rem;
}

/* ── CARD ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 20px;
}
.card + .card { margin-top: 0; }
.card-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 18px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--crypto);
  font-size: 0.68rem;
  font-weight: 800;
  margin-right: 8px;
}

/* ── FORM CONTROLS ── */
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 7px;
}
.field {
  width: 100%;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--border-bright);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field:focus {
  outline: none;
  border-color: var(--crypto);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}
.field:disabled { opacity: 0.55; cursor: not-allowed; }
.field + .field-label { margin-top: 16px; }
select.field {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237c8ba4' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}

.field-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin: 7px 0 0;
}
.field-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 8px 0 0;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #4ade80, #22c55e); color: #000; }
.btn-primary:not(:disabled):hover { transform: translateY(-1px); }
.btn-crypto {
  background: transparent;
  color: var(--crypto);
  border-color: var(--crypto);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.15), 0 4px 12px rgba(0, 0, 0, 0.2);
}
.btn-crypto:not(:disabled):hover {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-color: #fbbf24;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.3), 0 8px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-bright);
  font-weight: 600;
}
.btn-ghost:hover { color: #fff; border-color: var(--text-muted); }
.btn-link {
  background: none;
  border: none;
  color: var(--blue);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn { flex: 1 1 200px; }

/* ── AUTH STATE ── */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab {
  flex: 1;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid var(--border-bright);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.auth-tab.active {
  border-color: var(--crypto);
  background: rgba(245, 158, 11, 0.1);
  color: var(--crypto);
}
.signed-in-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.signed-in-email {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--accent);
  word-break: break-all;
}
.signed-in-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 3px;
}

/* ── SPENT-TRIAL EXPLAINER ── */
.trial-spent {
  border-color: rgba(251, 146, 60, 0.35);
  background: linear-gradient(180deg, rgba(251, 146, 60, 0.06), transparent 60%), var(--bg-card);
}
.trial-spent-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-orange, #fb923c);
  margin: 0 0 6px;
}
.trial-spent-title { font-size: 1.35rem; font-weight: 800; margin: 0 0 18px; letter-spacing: -0.4px; }

.usage-meter {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 10px;
}
.usage-meter-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fb923c, #f59e0b);
}
.usage-line { font-size: 0.9rem; color: var(--text-main); margin: 0 0 18px; font-weight: 600; }

.usage-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 7px 18px;
  margin: 0 0 18px;
  font-size: 0.86rem;
}
.usage-facts dt { color: var(--text-muted); }
.usage-facts dd { margin: 0; color: var(--text-main); }
.trial-spent-note { font-size: 0.86rem; color: var(--text-muted); margin: 0; }

@media (max-width: 680px) {
  .usage-facts { grid-template-columns: 1fr; gap: 2px 0; }
  .usage-facts dd { margin-bottom: 8px; }
}

/* ── PAYMENT METHOD PICKER ── */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.method-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-bright);
  border-radius: 11px;
  padding: 20px 16px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: inherit;
  width: 100%;
}
.method-card:hover { border-color: var(--text-muted); }
.method-card.selected { border-color: var(--accent); background: rgba(74, 222, 128, 0.07); }
#method-crypto-btn.selected {
  border-color: var(--crypto);
  background: rgba(245, 158, 11, 0.07);
}
.method-icon { font-size: 22px; line-height: 1; }
.method-name { font-size: 0.95rem; font-weight: 700; color: #fff; }
.method-price { font-size: 1.3rem; font-weight: 800; color: #fff; }
.method-price span { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.method-note { font-size: 0.76rem; color: var(--text-muted); line-height: 1.45; margin-top: 4px; }
.method-badge {
  position: absolute;
  top: -9px;
  right: 12px;
  background: var(--crypto);
  color: #000;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.panel-lead {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 18px;
}
.panel-lead strong { color: var(--text-main); }

/* ── PLAN PICKER ── */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-card {
  position: relative;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-bright);
  border-radius: 11px;
  padding: 18px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: inherit;
  width: 100%;
}
/* "Selected" follows the chosen payment method so one screen never shows two
   different selection colours at once: green for card, amber for crypto. */
.plan-card:hover { border-color: var(--text-muted); }
.plan-card.selected {
  border-color: var(--accent);
  background: rgba(74, 222, 128, 0.07);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}
body[data-method="crypto"] .plan-card:hover { border-color: var(--crypto); }
body[data-method="crypto"] .plan-card.selected {
  border-color: var(--crypto);
  background: rgba(245, 158, 11, 0.07);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}
.plan-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.plan-price { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1.1; }
.plan-period { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }
.plan-was {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-top: 6px;
}
.promo-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--crypto);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 14px;
}

/* ── TERMINAL ── */
.terminal-summary {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 11px;
  padding: 16px;
  margin-bottom: 18px;
  text-align: center;
}
.terminal-plan {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 6px;
}
.terminal-amount {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--crypto);
  line-height: 1.15;
  margin: 0;
}
.terminal-note { font-size: 0.82rem; color: var(--text-muted); margin: 8px 0 0; }

.qr-box {
  display: flex;
  justify-content: center;
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  margin: 0 auto 18px;
  width: fit-content;
}
.qr-box img { display: block; }
/* When the QR image fails the white backing is dropped, otherwise the muted
   fallback text sits on white and is unreadable. */
.qr-box.is-fallback {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-bright);
  max-width: 100%;
}
.qr-fallback { color: var(--text-muted); font-size: 0.82rem; text-align: center; margin: 0; }

.copy-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-bright);
  border-radius: 9px;
  padding: 11px 13px;
  margin-bottom: 10px;
}
.copy-value {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-main);
  word-break: break-all;
  flex: 1 1 200px;
}
.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.copy-btn:hover { color: #fff; border-color: var(--text-muted); }

.status-line {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 16px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crypto);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
.status-line.is-success { border-color: rgba(74, 222, 128, 0.4); color: var(--accent); }
.status-line.is-success .status-dot { background: var(--accent); animation: none; }
.status-line.is-error { border-color: rgba(248, 113, 113, 0.4); color: var(--danger); }
.status-line.is-error .status-dot { background: var(--danger); animation: none; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ── CALLOUT ── */
.callout {
  border-radius: 9px;
  padding: 13px 16px;
  font-size: 0.85rem;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
}
.callout-warning {
  background: rgba(251, 146, 60, 0.08);
  border: 1px solid rgba(251, 146, 60, 0.25);
  color: var(--text-muted);
}
.callout-info {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--text-muted);
}
.callout strong { color: var(--text-main); }

.fine-print {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 22px;
}
.fine-print a { color: var(--blue); text-decoration: none; }
.fine-print a:hover { text-decoration: underline; }

.is-hidden { display: none !important; }

/* ── RECEIPT ── */
.receipt-key {
  display: block;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 9px;
  padding: 15px;
  text-align: center;
  word-break: break-all;
  margin-bottom: 10px;
}

/* ── FOOTER (mirrors index.html) ── */
footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}
footer .footer-links { margin-top: 14px; }
footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 14px;
  transition: color 0.2s;
}
footer a:hover { color: #fff; }

@media (max-width: 680px) {
  nav { flex-direction: column; gap: 14px; }
  .nav-links a { margin: 0 8px; font-size: 0.82rem; }
  .checkout-wrap { padding: 36px 16px 56px; }
  .card { padding: 22px 18px; }
  .plan-grid { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }
  .method-badge { top: 10px; right: 10px; }
}
