:root {
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface-2: #f8f8fb;
  --text: #17172a;
  --muted: #6b6b80;
  --border: #e4e4ec;
  --accent: #5b4cf0;
  --accent-hover: #4a3be0;
  --accent-ink: #ffffff;
  --accent-soft: #eeecfe;
  --ok: #12804c;
  --ok-soft: #e5f5ec;
  --warn: #8a5a00;
  --warn-soft: #fff3d6;
  --err: #c0283a;
  --err-soft: #fdecee;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 10px 30px rgba(20, 20, 40, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e15;
    --surface: #17171f;
    --surface-2: #1d1d27;
    --text: #ededf4;
    --muted: #9c9cb0;
    --border: #2a2a37;
    --accent: #7d70ff;
    --accent-hover: #8f84ff;
    --accent-soft: #252140;
    --ok: #4fd08f;
    --ok-soft: #16301f;
    --warn: #f1c25b;
    --warn-soft: #33290f;
    --err: #ff7a88;
    --err-soft: #3a1820;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
[hidden] { display: none !important; }

.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }
.wrap.narrow { max-width: 520px; }

.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.logo-mark { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), #c05cf0); }
.secure { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

.grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 780px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

h1, .h1 { font-size: 26px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.02em; }
h2, .h2 { font-size: 19px; margin: 0 0 16px; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Visuel produit */
.visual {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 22px;
  color: #fff;
  overflow: hidden;
  background: radial-gradient(120% 120% at 100% 0%, #e46bb4 0%, transparent 55%), linear-gradient(135deg, #4b3be6, #8a4ff0);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.visual::after {
  content: '';
  position: absolute;
  inset: auto -30% -60% auto;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.visual-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.9; }
.visual-code { font-family: Consolas, Menlo, monospace; font-size: clamp(16px, 3.6vw, 22px); letter-spacing: 0.14em; }
.visual-amount { font-size: 13px; opacity: 0.9; }

.price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0; flex-wrap: wrap; }
.price { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.stock {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok);
}
.stock::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock.low { background: var(--warn-soft); color: var(--warn); }
.stock.out { background: var(--err-soft); color: var(--err); }

.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.perks li { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.perks svg { flex: none; color: var(--accent); }
.discord-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-weight: 600; text-decoration: none; }
.discord-link:hover { text-decoration: underline; }

/* Formulaire */
label.field { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input[type='email'] {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
input[type='email']:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hint { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }

fieldset { border: 0; padding: 0; margin: 22px 0 0; min-width: 0; }
legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
/* Quantité */
.qty-label { margin-top: 20px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  flex: none; width: 44px; height: 44px; border-radius: 10px;
  font: inherit; font-size: 20px; font-weight: 600; line-height: 1;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  cursor: pointer;
}
.qty-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.qty-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.qty input {
  width: 64px; height: 44px; padding: 0 6px; text-align: center;
  font: inherit; font-weight: 600;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  -moz-appearance: textfield; appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.qty-total { margin-left: 6px; font-size: 14px; }

/* Choix de la crypto */
.coins { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.coin { position: relative; cursor: pointer; }
.coin input { position: absolute; opacity: 0; pointer-events: none; }
.coin > span {
  display: grid; justify-items: center; gap: 1px;
  padding: 9px 6px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.coin b { font-size: 15px; }
.coin small { font-size: 12px; color: var(--muted); }
.coin:hover > span { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.coin input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.coin input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; margin-top: 22px;
  font: inherit; font-weight: 650; font-size: 16px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  text-decoration: none;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--surface-2); }
.btn + .btn { margin-top: 10px; }

.error { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--err-soft); color: var(--err); font-size: 14px; }

.footer { margin-top: 28px; text-align: center; font-size: 13px; color: var(--muted); }

/* Pages statut */
.status { text-align: center; padding: 36px 24px; }
.status-icon {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.status-icon.ok { background: var(--ok-soft); color: var(--ok); }
.status-icon.warn { background: var(--warn-soft); color: var(--warn); }
.status-icon.err { background: var(--err-soft); color: var(--err); }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid currentColor; border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.summary { margin: 22px 0 0; padding: 0; list-style: none; text-align: left; border-top: 1px solid var(--border); }
.summary li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.summary li span:first-child { color: var(--muted); }
.summary li span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* Paiement crypto */
.pay-order { margin: -8px 0 10px; font-weight: 600; }
.qr { display: grid; place-items: center; margin: 18px 0 6px; }
.qr img { width: 220px; height: 220px; padding: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--border); }
.pay-field { margin-top: 14px; }
.pay-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pay-value { display: flex; gap: 8px; align-items: stretch; }
.pay-value code {
  flex: 1; min-width: 0;
  padding: 10px 12px; border-radius: 10px;
  font: 15px/1.4 Consolas, Menlo, monospace;
  background: var(--surface-2); border: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.copy {
  flex: none; padding: 0 14px; border-radius: 10px;
  font: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer;
}
.copy:hover { background: var(--surface-2); }
.pay-status {
  display: flex; align-items: center; gap: 10px;
  margin-top: 18px; padding: 12px 14px; border-radius: 10px;
  background: var(--accent-soft); color: var(--text); font-size: 14px;
}
.pay-status.ok { background: var(--ok-soft); color: var(--ok); }
.spinner.sm { flex: none; width: 16px; height: 16px; border-width: 2px; color: var(--accent); }
.pay-status.ok .spinner { color: var(--ok); }
.note { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }

/* Codes livrés (page /success) */
.codes { margin: 20px 0 0; text-align: left; }
.codes .pay-field:first-child { margin-top: 0; }
.pay-value code.gift-code { font-size: 19px; font-weight: 600; letter-spacing: 1.5px; text-align: center; }

/* Boîte d'envoi */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; }
