/*
 * Flex — feuille de style commune du site, de l'espace client et du panel admin (lot 21).
 * Style sobre, aligné sur l'application : fond noir, texte blanc, boutons en pilule, aucun effet.
 */
:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --surface: #131418;
  --surface-2: #1a1c21;
  --line: #26282e;
  --line-strong: #34373f;
  --text: #f2f3f5;
  --muted: #9a9fa8;
  --faint: #6b7079;
  --accent: #ffffff;
  --accent-ink: #0a0b0d;
  --link: #8ab4ff;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 4.6vw, 52px); font-weight: 750; }
h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; }
h3 { font-size: 17px; font-weight: 650; }
p { margin: 0 0 1em; color: var(--muted); }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(var(--max), 100%); margin: 0 auto; padding: 0 24px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* En-tête */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(10, 11, 13, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.topbar .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 19px; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 999px; font-size: 15px; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 760px) {
  .topbar .nav.hide-mobile { display: none; }
  .topbar .wrap { gap: 10px; height: auto; min-height: 60px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .topbar .nav:not(.hide-mobile) { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; }
}

/* Boutons */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: 600 15px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; opacity: .9; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--surface-2); opacity: 1; }
.btn.danger { background: transparent; color: var(--bad); border-color: rgba(248, 113, 113, .45); }
.btn.small { min-height: 34px; padding: 0 13px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; padding: 0; }

/* Cartes et grilles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card.flat { background: transparent; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card h2 { font-size: 21px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

/* Formulaires */
.form { max-width: 440px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); font: 16px/1.4 var(--font);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--muted); }
.check input { margin-top: 5px; }
.hint { font-size: 13px; color: var(--faint); margin-top: 6px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; margin: 0; }

/* Messages */
.alert { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 15px; margin: 0 0 18px; color: var(--text); }
.alert.ok { border-color: rgba(74, 222, 128, .4); }
.alert.error { border-color: rgba(248, 113, 113, .5); }
.alert.warn { border-color: rgba(251, 191, 36, .45); }

/* Étiquettes d'état */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag.ok { color: var(--ok); border-color: rgba(74, 222, 128, .35); }
.tag.warn { color: var(--warn); border-color: rgba(251, 191, 36, .35); }
.tag.bad { color: var(--bad); border-color: rgba(248, 113, 113, .4); }

/* Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { color: var(--faint); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface); }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table a { color: var(--text); }
.empty { padding: 28px; text-align: center; color: var(--faint); }

/* Chiffres clés */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.kpi b { display: block; font-size: 28px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 14px; }

/* Liste de détails */
dl.details { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; }
dl.details dt { color: var(--faint); font-size: 14px; }
dl.details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { dl.details { grid-template-columns: 1fr; } dl.details dd { margin-bottom: 6px; } }

/* Pages */
.page { padding-top: 36px; padding-bottom: 64px; }
.page-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(26px, 3.4vw, 36px); margin: 0; }
.page-head p { margin: 6px 0 0; }
.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.eyebrow { color: var(--faint); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.lead { font-size: 18px; color: var(--muted); max-width: 640px; }
.auth { max-width: 460px; margin: 48px auto; }
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--faint); font-size: 14px; }
.footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.footer a { color: var(--muted); }

/* Site vitrine */
.hero { padding: 72px 0 56px; }
.hero .grid { grid-template-columns: 1fr 1.15fr; align-items: center; gap: 40px; }
@media (max-width: 900px) { .hero .grid { grid-template-columns: 1fr; } }
.shot { border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: #000; }
.shot img { width: 100%; height: auto; }
.feature { padding: 4px 0; }
.feature .ico { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); display: grid; place-items: center; margin-bottom: 12px; color: var(--text); }
.feature .ico svg { width: 20px; height: 20px; }
.feature p { margin: 0; font-size: 15px; }
.platforms { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.code-big { font: 700 30px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; padding: 14px 0; color: var(--text); }
.price { font-size: 34px; font-weight: 750; color: var(--text); margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.offer ul { list-style: none; padding: 0; margin: 14px 0 20px; color: var(--muted); font-size: 15px; }
.offer li { padding: 5px 0; border-top: 1px solid var(--line); }
.offer li:first-child { border-top: 0; }
details.faq { border-top: 1px solid var(--line); padding: 16px 0; }
details.faq summary { cursor: pointer; font-weight: 600; color: var(--text); list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; float: right; color: var(--faint); }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: 10px 0 0; }

/* Panel admin */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding-top: 28px; padding-bottom: 64px; }
.admin-nav { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { color: var(--muted); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 15px; }
.admin-nav a:hover, .admin-nav a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.admin-nav .sep { height: 1px; background: var(--line); margin: 10px 0; }
@media (max-width: 860px) { .admin-layout { grid-template-columns: minmax(0, 1fr); } .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search] { max-width: 340px; }
.toolbar select { width: auto; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.actions-list { display: grid; gap: 14px; }
.danger-zone { border-color: rgba(248, 113, 113, .35); }
