:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --error: #ef4444;
  --error-light: #fef2f2;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 80px 0; }

/* ── HEADER ─────────────────────────────── */
header {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--primary);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 17px;
}
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}
.header-cta:hover { background: var(--primary-dark); text-decoration: none; transform: translateY(-1px); }

/* ── HERO ────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #5b21b6 0%, #6366f1 45%, #818cf8 100%);
  color: white;
  padding: 100px 0 90px;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 28px;
  letter-spacing: 0.03em;
}
.hero h1 {
  font-size: clamp(34px, 5.5vw, 62px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.hero p {
  font-size: 19px;
  opacity: 0.88;
  margin-bottom: 44px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--primary);
  padding: 16px 36px;
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(0,0,0,0.25);
  text-decoration: none;
}

/* ── SECTION HEADERS ─────────────────────── */
.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}
.section-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.6;
}
.section-header { margin-bottom: 56px; }

/* ── STEPS ───────────────────────────────── */
.steps-section { background: white; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}
.step-card {
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  position: relative;
}
.step-number {
  width: 42px;
  height: 42px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 16px;
}
.step-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.step-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}
.step-arrow {
  display: none;
}

/* ── BENEFITS ────────────────────────────── */
.benefits-section { background: var(--bg); }
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.benefit-card {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.benefit-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.benefit-icon {
  width: 50px;
  height: 50px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.benefit-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.benefit-card p { color: var(--text-muted); font-size: 14px; line-height: 1.55; }

/* ── PRICING CARDS ───────────────────────── */
.pricing-section { background: white; }
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.plan-card {
  border-radius: var(--radius);
  border: 2px solid var(--border);
  padding: 28px 24px 24px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative;
  background: white;
  text-align: left;
}
.plan-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.plan-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15), var(--shadow);
  transform: translateY(-3px);
}
.plan-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 3px 14px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.plan-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: var(--text-muted); }
.plan-price {
  font-size: 40px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.plan-duration {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.plan-features {
  list-style: none;
  font-size: 13px;
  margin-bottom: 20px;
}
.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  color: var(--text-muted);
}
.plan-features li .check {
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.plan-btn {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: center;
}
.plan-card.selected .plan-btn,
.plan-card:hover .plan-btn {
  background: var(--primary);
  color: white;
}

/* ── CHECKOUT ────────────────────────────── */
.checkout-section { background: var(--bg); }
.checkout-card {
  max-width: 520px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.checkout-heading {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}
.checkout-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.plan-summary {
  background: var(--primary-light);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.summary-name { font-weight: 700; font-size: 15px; color: var(--primary); }
.summary-price { font-weight: 800; font-size: 22px; color: var(--primary); }
.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 20px;
  line-height: 1.5;
}
.terms-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.terms-checkbox a { color: var(--primary); }
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-align: center;
  letter-spacing: 0.01em;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { background: #cbd5e1; cursor: not-allowed; transform: none; }

.error-msg {
  color: var(--error);
  font-size: 14px;
  margin-top: 14px;
  display: none;
}
.error-msg.show { display: block; }

.result-box {
  margin-top: 20px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: none;
}
.result-box.show { display: block; }
.result-box-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0369a1;
  margin-bottom: 10px;
}
.link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.link-row input {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  background: white;
  outline: none;
  font-family: monospace;
  min-width: 0;
}
.btn-copy {
  padding: 10px 16px;
  background: #0369a1;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}
.btn-copy:hover { background: #0284c7; }
.btn-proceed {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-proceed:hover { background: #059669; text-decoration: none; }
.copied-msg { font-size: 13px; color: var(--success); margin-top: 6px; }

/* ── FOOTER ──────────────────────────────── */
footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 36px 0;
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--primary); text-decoration: none; }
.footer-copy { font-size: 12px; color: var(--text-muted); }

/* ── STATUS PAGES (success, cancel, wait) ── */
.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.status-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  max-width: 520px;
  width: 100%;
  text-align: center;
}
.status-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
}
.status-icon.success { background: var(--success-light); color: var(--success); }
.status-icon.error   { background: var(--error-light); color: var(--error); }
.status-icon.pending { background: #fef9c3; color: #ca8a04; }

.status-card h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.status-card .lead { color: var(--text-muted); font-size: 15px; margin-bottom: 28px; }

/* API Key display */
.key-box {
  background: #0f172a;
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 0 0 16px;
  text-align: left;
}
.key-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 10px;
}
.key-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  color: #a5f3fc;
  word-break: break-all;
  line-height: 1.6;
  letter-spacing: 0.02em;
}
.key-value.loading {
  color: #475569;
  font-style: italic;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.key-value.error-state { color: #f87171; }

.btn-copy-key {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-copy-key:hover { background: var(--primary-dark); }
.btn-copy-key:disabled { background: #cbd5e1; cursor: not-allowed; }

.warning-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: #dc2626;
  font-weight: 600;
  text-align: center;
}
.success-note {
  font-size: 13px;
  color: var(--success);
  margin-bottom: 6px;
}

/* Spinner */
.spinner-wrap { margin: 0 auto 24px; }
.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  background: transparent;
}
.btn-secondary:hover { background: var(--primary); color: white; text-decoration: none; }

/* ── LEGAL PAGES ─────────────────────────── */
.legal-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.2s;
}
.legal-back:hover { color: var(--primary); text-decoration: none; }
.legal-wrap h1 {
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.effective-date {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.legal-wrap h2 {
  font-size: 19px;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 12px;
}
.legal-wrap p {
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 16px;
}
.legal-wrap ul {
  color: var(--text-muted);
  padding-left: 20px;
  line-height: 1.75;
  margin-bottom: 16px;
}
.legal-wrap li { margin-bottom: 6px; }
.legal-footer-nav {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.legal-footer-nav a {
  font-size: 13px;
  color: var(--text-muted);
}
.legal-footer-nav a:hover { color: var(--primary); }

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 640px) {
  section { padding: 60px 0; }
  .hero { padding: 72px 0 60px; }
  .status-card { padding: 32px 20px; }
  .checkout-card { padding: 28px 20px; }
  .steps-grid, .benefits-grid, .plans-grid { grid-template-columns: 1fr; }
  .header-cta span { display: none; }
}
