/* ============================================================
   PADCRAFT — design tokens (thème clair, pastel, premium)
   ============================================================ */
:root {
  --bg: #FBFAFE;
  --surface: #FFFFFF;
  --surface-2: #F6F2FC;
  --surface-3: #ECE6F8;
  --line: #E7E1F3;
  --text: #241F33;
  --text-muted: #6E6680;
  --text-faint: #A79FBC;
  --ink: #1E1A2E; /* texte foncé sur fond coloré/clair */

  /* identité de marque du site (indépendante des couleurs de manette) */
  --brand: #6C5CE7;
  --brand-ink: #FFFFFF;
  --pastel-blue: #AFC6FF;
  --pastel-pink: #FFC7EC;
  --pastel-mint: #A9F0CF;
  --pastel-coral: #FFBEBE;
  --pastel-amber: #FFDFA8;

  --shadow-soft: 0 24px 48px -28px rgba(108,92,231,.28);
  --shadow-card: 0 12px 28px -18px rgba(36,31,51,.16);

  /* button-true colors (mirroir des boutons d'une vraie manette) */
  --face-a: #4f9dff;
  --face-b: #ff5c6c;
  --face-x: #ff6fd8;
  --face-y: #3ddc97;

  /* rendu du produit manette — personnalisable via le configurateur,
     volontairement indépendant du thème du site */
  --gp-body: #2c303c;
  --gp-accent: #ffb020;
  --gp-stick: #4f9dff;
  --gp-btn-idle: #3d4250;

  /* identité "vitrine premium" — scène sombre pour la mise en avant produit */
  --stage-bg: #15101f;
  --stage-bg-2: #211a33;
  --stage-line: rgba(255,255,255,.09);
  --stage-text: rgba(255,255,255,.86);
  --stage-text-muted: rgba(255,255,255,.52);
  --brand-deep: #4C3FC7;
  --gold: #F5B942;
  --shadow-stage: 0 40px 80px -30px rgba(20,10,40,.55);

  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  --radius: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ============================================================
   Gamepad — rendu photo (base + boutons calibrés en image)
   ============================================================ */
.gp-mount { display: flex; align-items: center; justify-content: center; }
.gp-svg { width: 100%; height: auto; max-width: 520px; overflow: visible; }

/* halo optionnel derrière la manette — activé via .gp-mount--halo */
.gp-mount--halo { position: relative; padding: 12px 0; }
.gp-mount--halo::before {
  content: '';
  position: absolute;
  inset: -18% -6% -6% -6%;
  background: radial-gradient(
    ellipse var(--halo-size, 60%) calc(var(--halo-size, 60%) * 0.92) at 50% 38%,
    var(--halo-color, rgba(108,92,231,.14)), transparent 70%
  );
  z-index: 0;
  pointer-events: none;
}
.gp-mount--halo .gp-svg { position: relative; z-index: 1; }

.gp-mount--interactive [data-btn], .gp-mount--interactive [data-trigger],
.gp-mount--interactive .gp-tint, .gp-mount--interactive [data-group] { pointer-events: auto; cursor: pointer; }

.gp-bg-variant-a, .gp-bg-variant-b { transition: opacity .3s ease; }

.gp-tint {
  mix-blend-mode: multiply;
  transition: opacity .06s ease, fill .2s ease;
  pointer-events: none;
}

.gp-btn-img { pointer-events: none; }
.gp-stick-wrap { pointer-events: none; }

/* état de connexion */
.gp-status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
  letter-spacing: .02em;
}
.gp-status.is-connected { color: var(--gp-accent); }

/* ============================================================
   Footer partagé
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); padding: 56px 24px 28px; }
.site-footer .footer-grid {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
}
@media (max-width: 700px) { .site-footer .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer .footer-brand p { color: var(--text-muted); font-size: 13px; line-height: 1.65; max-width: 32ch; margin: 10px 0 0; }
.site-footer h5 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin: 0 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer a { color: var(--text-muted); text-decoration: none; font-size: 14px; }
.site-footer a:hover { color: var(--brand); }
.footer-bottom {
  max-width: 1120px; margin: 40px auto 0; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 12.5px; color: var(--text-faint);
}

/* ============================================================
   Pages compte (connexion / inscription)
   ============================================================ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; position: relative; overflow: hidden; }
.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: var(--shadow-card); position: relative; z-index: 1;
}
.auth-card .logo { display: block; text-align: center; margin-bottom: 22px; }
.auth-card h1 { font-family: var(--font-display); font-size: 24px; text-align: center; margin: 0 0 6px; }
.auth-card .auth-sub { text-align: center; color: var(--text-muted); font-size: 13.5px; margin: 0 0 28px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 6px; }
.auth-field input {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-family: var(--font-body); font-size: 14.5px;
}
.auth-field input:focus { outline: none; border-color: var(--brand); }
.auth-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }
.auth-check a { color: var(--brand); }
.auth-submit {
  width: 100%; background: var(--brand); color: #fff; border: none; border-radius: 10px;
  padding: 13px; font-weight: 600; font-family: var(--font-body); font-size: 15px; cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.auth-msg { text-align: center; font-size: 13px; margin-top: 14px; padding: 10px; border-radius: 8px; background: var(--surface-2); color: var(--text-muted); display: none; }
.auth-msg.is-visible { display: block; }
.auth-forgot { text-align: center; margin-top: 14px; }
.auth-forgot a { font-size: 13px; color: var(--text-muted); text-decoration: none; }
.auth-forgot a:hover { color: var(--brand); }
.auth-switch { text-align: center; margin-top: 24px; font-size: 13.5px; color: var(--text-muted); }
.auth-switch a { color: var(--brand); text-decoration: none; font-weight: 600; }
.auth-back { position: absolute; top: 24px; left: 24px; font-size: 13px; color: var(--text-muted); text-decoration: none; z-index: 1; }

.auth-oauth {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font-family: var(--font-body); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.auth-oauth:hover { border-color: var(--text-faint); background: var(--surface-2); }
.auth-oauth svg { width: 18px; height: 18px; flex-shrink: 0; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-faint); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.auth-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-field-row .auth-field { margin-bottom: 0; }

.pw-checklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.pw-checklist li {
  display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-faint);
  transition: color .15s ease;
}
.pw-checklist li::before {
  content: '○'; font-size: 9px; flex-shrink: 0; width: 12px; text-align: center; color: var(--text-faint);
}
.pw-checklist li.is-met { color: var(--face-y); }
.pw-checklist li.is-met::before { content: '●'; color: var(--face-y); }

.field-hint { display: block; font-size: 11.5px; margin-top: 5px; min-height: 14px; }
.field-hint.is-error { color: var(--face-b); }
.field-hint.is-success { color: var(--face-y); }
.field-hint.is-checking { color: var(--text-faint); }

/* ============================================================
   Pages légales (article longue forme)
   ============================================================ */
.legal-wrap { max-width: 760px; margin: 0 auto; padding: 60px 24px 90px; }
.legal-back { color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.legal-wrap h1 { font-family: var(--font-display); font-size: clamp(28px,4vw,38px); margin: 24px 0 8px; }
.legal-updated { color: var(--text-faint); font-size: 13px; margin: 0 0 24px; }
.legal-disclaimer {
  background: var(--pastel-amber); border-radius: 12px; padding: 16px 18px; font-size: 13px;
  color: var(--ink); line-height: 1.6; margin-bottom: 36px;
}
.legal-wrap h2 { font-family: var(--font-display); font-size: 19px; margin: 36px 0 12px; }
.legal-wrap p, .legal-wrap li { color: var(--text-muted); font-size: 15px; line-height: 1.75; }
.legal-wrap ul { padding-left: 20px; }
.legal-wrap a { color: var(--brand); }

/* ============================================================
   Pages support / FAQ
   ============================================================ */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; padding: 18px 4px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-q .chev { transition: transform .2s ease; color: var(--text-faint); flex-shrink: 0; font-size: 20px; }
.faq-item.is-open .faq-q .chev { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq-a p { color: var(--text-muted); font-size: 14px; line-height: 1.7; padding: 0 4px 18px; margin: 0; }

/* ============================================================
   Icône panier (nav) — partagée entre les pages
   ============================================================ */
.nav-cart {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; color: var(--text);
  text-decoration: none; transition: background .15s ease;
}
.nav-cart:hover { background: var(--surface-2); }
.nav-cart svg { width: 19px; height: 19px; }
.cart-badge {
  position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--brand); color: #fff; font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; display: none; align-items: center; justify-content: center;
  line-height: 1; border: 2px solid var(--bg);
}
.cart-badge.is-visible { display: flex; }

/* ============================================================
   Boutique — cartes produit avec prix & ajout au panier
   ============================================================ */
.product-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card); border-color: transparent; }
.product-card .mini-mount {
  width: 100%; height: 118px; margin-bottom: 14px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, var(--surface-2), var(--surface-3) 130%);
  border-radius: 14px; position: relative; overflow: hidden;
}
.product-card .mini-mount .gp-svg { width: 100%; max-width: 165px; }
.product-card .rating { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-faint); margin-bottom: 4px; }
.product-card .rating .stars { color: var(--gold); letter-spacing: 1px; font-size: 12px; }
.product-card h4 { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; margin: 0 0 4px; color: var(--text); }
.product-card .maker { font-size: 12px; color: var(--text-faint); margin: 0 0 14px; }
.product-card .price-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 10px; }
.product-card .price { font-family: var(--font-mono); font-weight: 600; font-size: 16px; color: var(--text); }
.product-card .price .was { font-size: 12px; color: var(--text-faint); text-decoration: line-through; font-weight: 400; margin-right: 6px; }
.btn-add-cart {
  background: var(--ink); color: #fff; border: none; border-radius: 10px; padding: 9px 15px;
  font-family: var(--font-body); font-weight: 600; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: background .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn-add-cart:hover { background: var(--brand); }
.btn-add-cart:active { transform: scale(.96); }
.btn-add-cart.is-added { background: var(--face-y); }

/* micro-toast confirmation d'ajout au panier */
.cart-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-stage);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 200;
  display: flex; align-items: center; gap: 8px;
}
.cart-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.cart-toast .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--face-y); flex-shrink: 0; }

/* ============================================================
   Preuve sociale — témoignages streamers
   ============================================================ */
.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .testimonial-grid { grid-template-columns: 1fr; } }
.testimonial-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px;
}
.testimonial-card .stars { color: var(--gold); font-size: 13px; letter-spacing: 2px; margin-bottom: 14px; display: block; }
.testimonial-card p.quote { color: var(--text); font-size: 14.5px; line-height: 1.7; margin: 0 0 18px; }
.testimonial-who { display: flex; align-items: center; gap: 10px; }
.testimonial-avatar {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
}
.testimonial-who .name { font-size: 13.5px; font-weight: 600; color: var(--text); display: block; }
.testimonial-who .handle { font-size: 12px; color: var(--text-faint); }

/* ============================================================
   Bannière CTA finale
   ============================================================ */
.cta-band {
  background: linear-gradient(150deg, var(--stage-bg) 0%, var(--brand-deep) 130%);
  border-radius: var(--radius); padding: 64px 40px; text-align: center; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.10), transparent 55%);
  pointer-events: none;
}
.cta-band .eyebrow { background: rgba(255,255,255,.12); color: #fff; position: relative; }
.cta-band h2 { color: #fff; margin: 0 auto 14px; max-width: 22ch; position: relative; }
.cta-band p { color: rgba(255,255,255,.7); max-width: 46ch; margin: 0 auto 30px; line-height: 1.65; position: relative; }
.cta-band .hero-ctas { justify-content: center; position: relative; }
.cta-band .btn-secondary { background: transparent; border-color: rgba(255,255,255,.28); color: #fff; }
.cta-band .btn-secondary:hover { border-color: #fff; }

/* ============================================================
   Page panier
   ============================================================ */
.cart-page { max-width: 900px; margin: 0 auto; padding: 20px 24px 100px; }
.cart-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 28px 0 32px; flex-wrap: wrap; }
.cart-title-row h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px,4vw,34px); margin: 0; }
.cart-count-label { color: var(--text-faint); font-size: 14px; font-family: var(--font-mono); }

.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
@media (max-width: 800px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-items { display: flex; flex-direction: column; gap: 14px; }
.cart-line {
  display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px;
}
.cart-line .thumb {
  width: 76px; height: 76px; border-radius: 12px; flex-shrink: 0;
  background: radial-gradient(circle at 50% 30%, var(--surface-2), var(--surface-3) 130%);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.cart-line .thumb .gp-svg { width: 100%; max-width: 90px; }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .info h4 { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin: 0 0 3px; color: var(--text); }
.cart-line .info p { font-size: 12.5px; color: var(--text-faint); margin: 0; }
.cart-line .qty-stepper {
  display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex-shrink: 0;
}
.cart-line .qty-stepper button {
  width: 30px; height: 30px; border: none; background: var(--surface-2); color: var(--text); font-size: 15px;
  cursor: pointer; font-family: var(--font-body);
}
.cart-line .qty-stepper span { width: 30px; text-align: center; font-family: var(--font-mono); font-size: 13px; }
.cart-line .line-price { font-family: var(--font-mono); font-weight: 600; font-size: 14.5px; width: 64px; text-align: right; flex-shrink: 0; }
.cart-line .remove-btn {
  background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 18px; line-height: 1;
  padding: 6px; flex-shrink: 0; transition: color .15s ease;
}
.cart-line .remove-btn:hover { color: var(--face-b); }

.cart-summary {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px;
  position: sticky; top: 24px; box-shadow: var(--shadow-card);
}
.cart-summary h3 { font-family: var(--font-display); font-size: 15.5px; margin: 0 0 18px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-muted); margin-bottom: 10px; }
.summary-row.total { color: var(--text); font-weight: 700; font-size: 17px; margin: 16px 0 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.summary-row.total .val { font-family: var(--font-mono); }
.checkout-btn {
  width: 100%; background: var(--brand); color: #fff; border: none; border-radius: 10px; padding: 14px;
  font-weight: 600; font-size: 15px; cursor: pointer; box-shadow: var(--shadow-soft); font-family: var(--font-body);
}
.checkout-note {
  font-size: 12px; color: var(--text-faint); text-align: center; margin: 12px 0 0; line-height: 1.6;
}
.checkout-msg {
  margin-top: 14px; background: var(--surface-2); border-radius: 10px; padding: 12px 14px;
  font-size: 12.5px; color: var(--text-muted); line-height: 1.6; display: none;
}
.checkout-msg.is-visible { display: block; }

.cart-empty {
  text-align: center; padding: 80px 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cart-empty .icon { font-size: 40px; margin-bottom: 18px; opacity: .6; }
.cart-empty h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 10px; }
.cart-empty p { color: var(--text-muted); margin: 0 0 26px; }

/* ============================================================
   Widget compte (bandeau) — connecté / déconnecté
   ============================================================ */
.account-widget { position: relative; }
.account-widget [data-account-toggle] {
  background: none; border: none; cursor: pointer; padding: 0; font: inherit;
}
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 12.5px;
}
.account-menu {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-card); padding: 8px; z-index: 60;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease;
}
.account-widget.is-menu-open .account-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.account-menu-user {
  font-size: 12.5px; color: var(--text-faint); padding: 8px 10px 10px; margin: 0;
  border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.account-menu a, .account-menu button {
  display: block; width: 100%; text-align: left; text-decoration: none; background: none; border: none;
  font-family: var(--font-body); font-size: 13.5px; color: var(--text); padding: 9px 10px; border-radius: 8px;
  cursor: pointer;
}
.account-menu a:hover, .account-menu button:hover { background: var(--surface-2); }
.account-menu [data-account-logout] { color: var(--face-b); }
.account-widget.is-logged-out [data-account-username],
.account-widget.is-logged-out [data-account-logout],
.account-widget.is-logged-out [data-account-profile-link],
.account-widget.is-logged-in [data-account-login-link],
.account-widget.is-logged-in [data-account-signup-link] { display: none; }
.account-widget.is-logged-out .account-menu { display: none !important; }
