@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

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

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #888888;
  --border: #e8e8e8;
  --font: 'Inter', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────── */
header {
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.3px;
}

nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.8; }

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

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

/* ── Main ─────────────────────────────────── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
}

/* ── Product Card ─────────────────────────── */
.product-card {
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.product-icon {
  width: 52px;
  height: 52px;
  background: #f5f5f5;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--text);
}

.product-card h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.product-card .price {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 10px;
}

.stock-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: #059669;
  background: #ecfdf5;
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 20px;
}
.stock-badge.low  { color: #b45309; background: #fffbeb; }
.stock-badge.out  { color: #b91c1c; background: #fef2f2; }

.product-card .buy-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border-radius: 10px;
  justify-content: center;
}

/* ── Divider ─────────────────────────────── */
.divider {
  width: 100%;
  max-width: 360px;
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ── Reviews ──────────────────────────────── */
.reviews-section {
  width: 100%;
  max-width: 480px;
}

.reviews-section h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.review-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.review-item:last-child { border-bottom: none; }

.review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.reviewer-name {
  font-size: 14px;
  font-weight: 500;
}

.review-stars {
  font-size: 12px;
  color: #f59e0b;
  letter-spacing: 1px;
}

.review-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.no-reviews {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 16px 0;
}

/* ── Review Notice ────────────────────────── */
.review-notice {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 20px;
}
.review-notice a {
  color: var(--text);
  text-decoration: underline;
}

/* ── Review Form ──────────────────────────── */
.review-form {
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: #aaa; }

.stars-input {
  display: flex;
  gap: 8px;
  align-items: center;
}
.stars-input label {
  font-size: 16px;
  cursor: pointer;
  color: var(--muted);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.stars-input input { display: none; }
.stars-input label:has(input:checked) {
  color: #f59e0b;
  font-weight: bold;
  transform: scale(1.1);
}
.stars-input label {
  transition: all 0.15s;
}

/* ── Auth ─────────────────────────────────── */
.auth-wrap {
  max-width: 320px;
  width: 100%;
}

.auth-wrap h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
}

.auth-error {
  font-size: 13px;
  color: #c0392b;
  margin-bottom: 14px;
  text-align: center;
}

.auth-footer {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 20px;
}
.auth-footer a {
  color: var(--text);
  text-decoration: underline;
}

/* ── Checkout ─────────────────────────────── */
.simple-card {
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.simple-card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.simple-card p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.order-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.order-line:last-of-type {
  font-weight: 600;
  border-bottom: none;
}

/* ── Success ──────────────────────────────── */
.key-display {
  font-family: monospace;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 14px;
  margin: 20px 0;
  user-select: all;
}

/* ── Dashboard ────────────────────────────── */
.dash-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
}

.key-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.key-code {
  font-family: monospace;
  font-weight: 600;
}

.key-date {
  font-size: 12px;
  color: var(--muted);
}

/* ── Account entries ─────────────────────── */
.accounts-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f9f9f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.account-num {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  min-width: 24px;
}

.account-code {
  font-family: monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  user-select: all;
}

/* ── Footer ───────────────────────────────── */
footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ── Delete button on reviews ─────────────── */
.delete-btn {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.15s;
}
.delete-btn:hover { color: #c0392b; }

/* ── Admin nav link ───────────────────────── */
.admin-link {
  color: var(--text) !important;
  font-weight: 500;
}

/* ── Admin stats row ──────────────────────── */
.admin-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
}

/* ── Admin nav grid ───────────────────────── */
.admin-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.admin-nav-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 16px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}
.admin-nav-card:hover { background: #f9f9f9; }

/* ── Admin table rows ─────────────────────── */
.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.admin-row:last-child { border-bottom: none; }

.admin-row-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.admin-row-name {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-row-meta {
  font-size: 12px;
  color: var(--muted);
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Badges ───────────────────────────────── */
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-admin { background: #eff6ff; color: #1d4ed8; }
.badge-ban   { background: #fef2f2; color: #b91c1c; }

/* ── Action buttons ───────────────────────── */
.action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 11px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.action-btn:hover { background: #f5f5f5; }

.warn-btn { color: #b45309; border-color: #fde68a; }
.warn-btn:hover { background: #fffbeb; }

.danger-btn { color: #b91c1c; border-color: #fecaca; }
.danger-btn:hover { background: #fef2f2; }
