/* FiveScript — design system inspiré gaming premium */
:root {
  --bg: #0a0b0e;
  --bg-2: #111318;
  --bg-3: #1a1d24;
  --bg-card: #14171d;
  --border: #23272f;
  --border-strong: #2e333d;
  --text: #f3f5f9;
  --muted: #8b94a3;
  --muted-2: #6b7280;
  --accent: #1fc7e9;
  --accent-2: #00b4d8;
  --accent-glow: rgba(31,199,233,.35);
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 14px;
  --radius-sm: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1000px 500px at 50% -100px, rgba(31,199,233,.06), transparent 60%),
    radial-gradient(800px 400px at 90% 200px, rgba(31,199,233,.04), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.main { padding: 24px 24px 80px; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }
.muted { color: var(--muted); }
code { font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace; font-size: 0.92em; }

/* ===== Topbar ===== */
.topbar {
  background: rgba(10,11,14,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--text); font-weight: 800; font-size: 22px;
  letter-spacing: .02em;
}
.brand__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px; color: #0a0b0e; font-weight: 900;
  font-size: 16px;
  box-shadow: 0 0 24px rgba(31,199,233,.3);
}
.brand__name { color: var(--text); }
.nav {
  display: flex; align-items: center; gap: 26px; flex: 1; justify-content: center;
}
.nav__primary {
  display: flex; align-items: center; gap: 26px;
}
.nav__primary a {
  color: var(--muted); font-weight: 500; font-size: 15px;
  position: relative; padding: 6px 0;
  transition: color .15s ease;
}
.nav__primary a:hover { color: var(--text); }
.nav__primary a.is-active {
  color: var(--text);
}
.nav__primary a.is-active::after {
  content: ''; position: absolute; bottom: -22px; left: 0; right: 0;
  height: 2px; background: var(--accent);
}
.nav__right { display: flex; align-items: center; gap: 12px; }
.nav__user { color: var(--muted); font-size: 13px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0b0e !important; padding: 10px 18px; border-radius: 8px;
  font-weight: 700; border: 0; cursor: pointer; font-size: 14px;
  letter-spacing: .01em;
  transition: transform .12s ease, box-shadow .2s ease, filter .15s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 30px var(--accent-glow); filter: brightness(1.05); color: #0a0b0e !important; }
.btn--ghost {
  background: transparent; color: var(--text) !important;
  border: 1px solid var(--border-strong);
}
.btn--ghost:hover { border-color: var(--accent); box-shadow: none; background: rgba(31,199,233,.06); color: var(--text) !important; }
.btn--block { display: flex; width: 100%; }
.btn--danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: white !important; }
.btn--danger:hover { color: white !important; }
.btn--paypal { background: #ffc439; color: #003087 !important; }
.btn--paypal:hover { color: #003087 !important; }
.btn--lg { padding: 13px 24px; font-size: 15px; }
.btn--icon::before {
  content: ''; display: inline-block; width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: var(--icon) center/contain no-repeat; mask: var(--icon) center/contain no-repeat;
}
.btn--buy { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M13 2L3 14h7l-1 8 10-12h-7l1-8z'/></svg>"); }
.btn--cart { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='9' cy='21' r='1'/><circle cx='20' cy='21' r='1'/><path d='M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/></svg>"); }

/* ===== Flashes ===== */
.flashes { padding-top: 18px; }
.flash {
  padding: 14px 18px; border-radius: 10px; margin-bottom: 12px;
  border: 1px solid var(--border-strong); background: var(--bg-2);
  font-size: 14px;
}
.flash--success { border-color: rgba(34,197,94,.5); background: rgba(34,197,94,.08); }
.flash--error { border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.08); }
.flash--info { border-color: rgba(31,199,233,.5); background: rgba(31,199,233,.06); }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  position: relative;
}
.hero h1 {
  font-size: clamp(48px, 8vw, 96px);
  margin: 0 0 24px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff, #b8c1d0);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--muted);
  margin: 0 auto;
  font-size: 17px;
  max-width: 720px;
  line-height: 1.6;
}
.hero__cta { margin-top: 28px; display: inline-flex; gap: 12px; }

/* ===== Toolbar (recherche + sort) ===== */
.catalog-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin: 24px 0 22px;
}
.search {
  position: relative; flex: 1; max-width: 420px;
}
.search input {
  width: 100%; padding: 12px 16px 12px 42px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font: inherit; font-size: 14px;
  transition: border-color .15s ease, background .15s ease;
}
.search input:focus { outline: none; border-color: var(--accent); background: var(--bg-3); }
.search::before {
  content: ''; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><circle cx='11' cy='11' r='8'/><path d='M21 21l-4.35-4.35'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><circle cx='11' cy='11' r='8'/><path d='M21 21l-4.35-4.35'/></svg>") center/contain no-repeat;
}
.catalog-count { color: var(--muted); font-size: 14px; }
.sort {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 12px;
}
.sort label { color: var(--muted); font-size: 13px; }
.sort select {
  background: transparent; border: 0; color: var(--text); font: inherit; font-size: 14px;
  padding: 6px 8px 6px 0; cursor: pointer; font-weight: 600;
}
.sort select:focus { outline: none; }

/* ===== Grid produits ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .25s ease;
  display: flex; flex-direction: column;
  position: relative;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(31,199,233,.4);
  box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 0 0 1px rgba(31,199,233,.15);
}
.card__media {
  position: relative;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #1a1d24, #0e1015);
  background-size: cover; background-position: center;
  overflow: hidden;
}
.card__media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
}
.card__placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.15); font-weight: 800; font-size: 28px;
  letter-spacing: .05em;
}
.card__tags {
  position: absolute; top: 12px; left: 12px;
  display: flex; gap: 6px; z-index: 2;
}
.card__discount {
  position: absolute; top: 12px; right: 12px;
  background: var(--accent); color: #0a0b0e;
  font-weight: 800; font-size: 12px;
  padding: 4px 10px; border-radius: 6px;
  z-index: 2;
}
.tag {
  display: inline-block;
  padding: 3px 10px; border-radius: 6px;
  background: rgba(10,11,14,.7); color: var(--text);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.08);
}
.tag--accent { background: var(--accent); color: #0a0b0e; border-color: transparent; }
.tag--ghost { background: transparent; color: var(--muted); border-color: var(--border-strong); }
.card__body {
  padding: 16px 18px 18px;
  display: flex; flex-direction: column; flex: 1; gap: 6px;
}
.card__title {
  margin: 0; font-size: 18px; font-weight: 700;
  color: var(--text);
}
.card__title a { color: inherit; }
.card__desc { color: var(--muted); font-size: 13px; flex: 1; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px;
}
.price {
  color: var(--text); font-weight: 800; font-size: 19px;
  display: flex; align-items: baseline; gap: 8px;
}
.price__old { color: var(--muted-2); font-weight: 500; font-size: 13px; text-decoration: line-through; }
.card__actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 14px;
}

/* ===== Section title ===== */
.section-title {
  font-size: clamp(28px, 4vw, 38px);
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-sub { color: var(--muted); margin: 0 0 28px; }

/* ===== Empty state ===== */
.empty {
  text-align: center; padding: 80px 20px;
  background: var(--bg-2); border: 1px dashed var(--border-strong);
  border-radius: var(--radius); color: var(--muted);
}

/* ===== Product detail ===== */
.product {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 36px;
  margin-top: 20px;
}
@media (max-width: 900px) { .product { grid-template-columns: 1fr; } }
.product__cover {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  background-size: cover; background-position: center;
  border-radius: var(--radius); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.product__title { margin: 0 0 8px; font-size: 36px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.product__short { color: var(--muted); margin: 0 0 24px; font-size: 16px; }
.product__buy {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.product__price { font-size: 36px; color: var(--text); font-weight: 800; margin-bottom: 16px; letter-spacing: -0.02em; }
.product__long {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  white-space: pre-wrap; font-size: 14px; line-height: 1.7;
  color: var(--text);
}
.tags-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

/* ===== Forms (login/register) ===== */
.form {
  max-width: 460px; margin: 60px auto 0;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px;
}
.form h1 { margin: 0 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.form > .muted { display: block; margin-bottom: 26px; font-size: 14px; }
.form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.form input, .form textarea, .form select {
  width: 100%; padding: 12px 14px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font: inherit;
  margin-bottom: 16px;
  transition: border-color .15s ease, background .15s ease;
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none; border-color: var(--accent); background: var(--bg-3);
}
.form__alt { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.form__alt a { color: var(--accent); }

/* ===== Account (mes scripts) ===== */
.account__header { margin-bottom: 28px; }
.account__header h1 { margin: 0 0 6px; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.purchase {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 14px;
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
}
.purchase__title { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.purchase__meta { color: var(--muted); font-size: 13px; }
.purchase__key {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  background: var(--bg-3); padding: 8px 14px; border-radius: 8px;
  color: var(--accent); font-size: 13px; letter-spacing: .04em;
  margin-top: 8px; display: inline-block;
  border: 1px solid rgba(31,199,233,.2);
}
.purchase__actions { display: flex; flex-direction: column; gap: 8px; min-width: 180px; }

/* ===== Checkout ===== */
.checkout__gateways { display: grid; gap: 12px; margin-top: 16px; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 32px 0 28px;
  margin-top: 80px;
}
.footer__inner {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center;
}
@media (max-width: 720px) { .footer__inner { grid-template-columns: 1fr; text-align: center; gap: 16px; } }
.footer__links { display: flex; gap: 22px; justify-content: center; }
.footer__links a { color: var(--muted); font-size: 14px; }
.footer__links a:hover { color: var(--text); }
.footer__copy { text-align: right; font-size: 13px; color: var(--muted); }

/* ===== Admin tables ===== */
.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.admin-table th { background: var(--bg-3); color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: rgba(31,199,233,.03); }
.admin-toolbar { display: flex; gap: 12px; margin-bottom: 24px; align-items: center; flex-wrap: wrap; }
.admin-toolbar h1 { margin: 0; flex: 1; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }

/* ===== Mobile ===== */
@media (max-width: 720px) {
  .topbar__inner { padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
  .nav { gap: 12px; justify-content: flex-end; }
  .nav__primary { gap: 14px; }
  .nav__primary a.is-active::after { display: none; }
  .container { padding: 0 16px; }
  .main { padding: 16px 16px 60px; }
  .purchase { grid-template-columns: 1fr; }
  .purchase__actions { flex-direction: row; }
  .hero { padding: 50px 16px 36px; }
  .form { padding: 24px; margin-top: 28px; }
}
