/* Style commun des pages acheter / commande / affilie / admin (identité du
   site vitrine : Poppins + dégradé violet/rose). */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/poppins-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('assets/fonts/poppins-600-latin.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/poppins-700-latin.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 800; font-display: swap; src: url('assets/fonts/poppins-800-latin.woff2') format('woff2'); }

* { box-sizing: border-box; }
body { margin: 0; background: #F4F3F8; color: #211543;
       font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif; }
a { color: #6D28D9; text-decoration: none; }

.topbar { position: sticky; top: 0; z-index: 50; background: rgba(244,243,248,.9);
          backdrop-filter: blur(12px); border-bottom: 1px solid rgba(33,21,67,.06); }
.topbar-in { max-width: 720px; margin: 0 auto; padding: 12px 20px;
             display: flex; align-items: center; gap: 10px; }
.topbar img { width: 34px; height: 34px; border-radius: 10px; }
.topbar b { font-size: 18px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
.card { background: #ffffff; border-radius: 20px; padding: 22px 20px;
        box-shadow: 0 8px 24px rgba(33,21,67,.07); margin-bottom: 16px; }
h1 { font-size: 24px; font-weight: 800; margin: 0 0 6px; }
h2 { font-size: 17px; font-weight: 700; margin: 0 0 12px; }
.muted { color: rgba(33,21,67,.6); font-size: 14px; line-height: 1.5; }

label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number] {
  width: 100%; padding: 12px 14px; border: 1.5px solid rgba(33,21,67,.15);
  border-radius: 12px; font: inherit; font-size: 16px; background: #FBFAFE; }
input:focus { outline: none; border-color: #6D28D9; }

.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { flex: 1 1 30%; min-width: 90px; }
.choice input { display: none; }
.choice span { display: block; text-align: center; padding: 12px 8px;
  border: 1.5px solid rgba(33,21,67,.15); border-radius: 12px; font-size: 14px;
  font-weight: 600; cursor: pointer; background: #FBFAFE; }
.choice input:checked + span { border-color: #6D28D9; background: #F1EAFD; color: #6D28D9; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  font-size: 16px; color: #fff; padding: 15px 20px; border-radius: 14px;
  background: linear-gradient(135deg, #6D28D9, #D6308F);
  box-shadow: 0 6px 16px rgba(109,40,217,.3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-line { background: none; box-shadow: none; color: #6D28D9;
  border: 1.5px solid #6D28D9; }
.btn-danger { background: #C62828; box-shadow: 0 6px 16px rgba(198,40,40,.25); }
.btn-small { width: auto; padding: 9px 16px; font-size: 14px; border-radius: 10px; }

.total-row { display: flex; justify-content: space-between; font-size: 15px;
  padding: 6px 0; }
.total-row.big { font-size: 20px; font-weight: 800; border-top: 1.5px solid
  rgba(33,21,67,.1); margin-top: 6px; padding-top: 12px; }
.ok { color: #1B9E4C; font-weight: 600; }
.error { color: #C62828; font-size: 14px; margin-top: 10px; min-height: 18px; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; }
.badge.pending { background: #FFF3E0; color: #B26A00; }
.badge.paid { background: #E7F6EC; color: #1B9E4C; }
.badge.cancelled { background: #FDECEA; color: #C62828; }

.code-box { text-align: center; background: #F1EAFD; border: 2px dashed #6D28D9;
  border-radius: 16px; padding: 20px; margin: 14px 0; }
.code-box .code { font-size: 26px; font-weight: 800; letter-spacing: 1.5px;
  color: #6D28D9; word-break: break-all; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid
  rgba(33,21,67,.08); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  color: rgba(33,21,67,.55); }
.scroll-x { overflow-x: auto; }

/* ─────────────────────────────────────────────────────────────────────────
   Variante LARGE — /affilie et /admin uniquement.
   `/acheter` et `/commande` sont regardées au téléphone par des clients : elles
   gardent leurs 720 px. Ces deux-là sont des outils de travail, avec des
   tableaux : leur imposer un ruban de 720 px au milieu d'un écran de 1920 est
   une perte de place, pas une élégance.
   ───────────────────────────────────────────────────────────────────────── */
.wrap.wide, .topbar-in.wide { max-width: 1200px; }
.wrap.wide { padding-left: 24px; padding-right: 24px; }

/* Tuiles de chiffres. `auto-fit` : 4 de front sur un écran, 2 sur une tablette,
   1 sur un téléphone, sans une seule requête média. */
.kpis { display: grid; gap: 12px; margin-top: 4px;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi { background: #FBFAFE; border: 1.5px solid rgba(33,21,67,.08);
       border-radius: 16px; padding: 16px 18px; }
.kpi .k-label { font-size: 13px; font-weight: 600; color: rgba(33,21,67,.6); }
.kpi .k-value { font-size: 28px; font-weight: 800; line-height: 1.2;
                margin-top: 4px; }
.kpi .k-note { font-size: 12.5px; color: rgba(33,21,67,.55); margin-top: 2px; }
.kpi.accent { background: linear-gradient(135deg, #6D28D9, #D6308F); border: 0; }
.kpi.accent .k-label, .kpi.accent .k-note { color: rgba(255,255,255,.8); }
.kpi.accent .k-value { color: #fff; }

/* États d'un filleul. Le vocabulaire compte : « à relancer » n'est pas un
   constat d'échec, c'est une action. */
.badge.trial   { background: #EEF2FF; color: #4338CA; }
.badge.expired { background: #FFF3E0; color: #B26A00; }
.badge.lapsed  { background: #F1F0F5; color: rgba(33,21,67,.6); }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-head { display: flex; align-items: baseline; justify-content: space-between;
                gap: 12px; flex-wrap: wrap; }

/* Bloc repliable (section Commandes de l'admin, tunnel web suspendu). */
details.fold > summary { cursor: pointer; font-size: 17px; font-weight: 700;
  list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '▸'; color: #6D28D9; font-size: 15px; }
details.fold[open] > summary::before { content: '▾'; }
details.fold > summary .muted { font-weight: 400; }

/* ── Téléphone : les tableaux deviennent des cartes ──────────────────────
   Un tableau de neuf colonnes sur un écran de 380 px reste illisible même avec
   un défilement horizontal : on ne lit pas un tableau en le poussant du doigt.
   Chaque ligne devient une carte, chaque cellule porte son intitulé. */
@media (max-width: 720px) {
  .wrap.wide { padding-left: 12px; padding-right: 12px; }
  .card { padding: 18px 16px; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards thead { display: none; }
  table.cards tr { border: 1.5px solid rgba(33,21,67,.1); border-radius: 14px;
                   padding: 10px 12px; margin-bottom: 10px; background: #FBFAFE; }
  table.cards td { border: 0; padding: 5px 0; display: flex; gap: 12px;
                   align-items: baseline; justify-content: space-between; }
  table.cards td::before { content: attr(data-label); font-size: 12px;
    text-transform: uppercase; letter-spacing: .4px; font-weight: 600;
    color: rgba(33,21,67,.55); flex: 0 0 auto; }
  table.cards td:empty { display: none; }
  .scroll-x { overflow-x: visible; }
}
