:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --border: #2a2a2a;
  --text: #e2e2e2;
  --text-muted: #888;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-light: rgba(124, 58, 237, 0.12);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
  --radius-sm: 6px;
}

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

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo span { color: var(--accent); }

nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color .2s;
}

nav a:hover { color: var(--text); }

/* ─── Main ────────────────────────────────────────────────────────────────── */
main { flex: 1; padding: 48px 0; }

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ─── Typography ──────────────────────────────────────────────────────────── */
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

.page-title { margin-bottom: 32px; }
.page-title p { color: var(--text-muted); margin-top: 8px; }

/* ─── Product grid ────────────────────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .2s, transform .2s;
}

.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.product-card__name { font-size: 1rem; font-weight: 600; color: var(--text); }

.product-card__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
}

.badge--success { background: rgba(34,197,94,.15); color: var(--success); }
.badge--empty { background: rgba(239,68,68,.12); color: var(--danger); }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, transform .1s;
  border: none;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover { background: var(--accent-hover); color: #fff; }

.btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn--outline:hover { border-color: var(--text-muted); color: var(--text); }

.btn--full { width: 100%; }

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ─── Product detail ──────────────────────────────────────────────────────── */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}

.product-detail__desc {
  color: var(--text-muted);
  margin-top: 12px;
  white-space: pre-line;
}

.product-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-sidebar .price { font-size: 1.75rem; }

/* ─── Checkout / forms ────────────────────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
  margin: 0 auto;
}

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

input[type="email"], input[type="text"], input[type="password"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s;
  width: 100%;
  font-family: inherit;
}

input:focus { border-color: var(--accent); }

.form-hint { font-size: 0.8rem; color: var(--text-muted); }

.order-summary {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ─── Order page ──────────────────────────────────────────────────────────── */
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 560px;
  margin: 0 auto;
}

.status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-weight: 500;
}

.status-banner--success { background: rgba(34,197,94,.12); color: var(--success); }
.status-banner--pending { background: rgba(245,158,11,.12); color: var(--warning); }
.status-banner--failed { background: rgba(239,68,68,.12); color: var(--danger); }

.credentials {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 20px 0;
}

.cred-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.cred-row:last-child { border-bottom: none; }

.cred-row__label { font-size: 0.8rem; color: var(--text-muted); }

.cred-row__value {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color .2s;
}

.cred-row__value:hover { color: var(--accent); }

/* ─── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 0;
  color: var(--text-muted);
}

.empty-state h2 { color: var(--text); margin-bottom: 8px; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .product-detail { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
}
