/*
 * Espace commerçant — the style of the site vixalon.com (charter VIXALON): white and Brume Glacée
 * surfaces, Bleu Vixalon for the headings, Rose Impulsion for the actions; Inter for the text, Plus
 * Jakarta Sans for the headings and buttons, JetBrains Mono for the descriptors. Light mode only, as
 * the site.
 */
:root {
  --background: #ffffff;
  --surface: #f4f7f9;
  --foreground: #2e4353;
  --brand: #2f5267;
  --muted: #5c7183;
  --border: #e4ebef;
  --input: #cbd8df;
  --primary: #cd3562;
  --primary-hover: #e84e7d;
  --ardoise: #5a88a5;
  --night: #16252f;
  --night-deep: #0b1319;
  --night-raised: #1f3444;
  --silver: #93a6b2;
  /* Status colours stay outside the brand palette (charter §4.5). */
  --ok: #047857;
  --ok-bg: #e7f6ef;
  --warn: #9a5b06;
  --warn-bg: #fdf3e1;
  --bad: #c02626;
  --bad-bg: #fdecec;
  --font-display: "Plus Jakarta Sans", sans-serif;
  --font-sans: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --shadow: 0 30px 60px -45px rgba(22, 37, 47, 0.5);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; }
body { font: 15px/1.6 var(--font-sans); color: var(--foreground); background: var(--background); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--font-display); color: var(--brand); letter-spacing: -0.02em; }
h1 { font-size: 2rem; font-weight: 800; line-height: 1.15; margin: 0 0 18px; }
h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 14px; }
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 12px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { font-family: var(--font-mono); font-size: 12px; background: var(--surface); color: var(--brand); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

/* « // ESPACE COMMERÇANT »: the descriptor of the site (vx-eyebrow). */
.eyebrow { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; line-height: 1.4; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 10px; }

a { color: var(--brand); text-decoration: underline; text-decoration-color: var(--primary); text-decoration-thickness: 2px; text-underline-offset: 4px; transition: color 150ms var(--ease); }
a:hover { color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* Buttons: pills, Plus Jakarta Sans SemiBold in capitals (charter §5.1). */
button {
  font-family: var(--font-display); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid var(--brand); background: var(--background); color: var(--brand);
  padding: 11px 22px; border-radius: 9999px; cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
button:hover { background: var(--surface); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--primary); border-color: var(--primary); color: #ffffff; padding: 14px 28px; }
button.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
button.danger { border-color: var(--bad); color: var(--bad); }
button.danger:hover { background: var(--bad-bg); }
button.small { padding: 7px 16px; font-size: 11px; }
button.block { width: 100%; }
button.link {
  border: 0; background: none; padding: 0; border-radius: 0; font: inherit; text-transform: none; letter-spacing: 0;
  color: var(--brand); text-decoration: underline; text-decoration-color: var(--primary); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
button.link:hover { background: none; color: var(--primary); }

/* Fields: pills, border #cbd8df, Bleu Vixalon on focus (with a visible ring). */
label { display: block; margin: 0 0 16px; font-weight: 600; font-size: 14px; color: var(--brand); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; font: 400 15px var(--font-sans); color: var(--foreground);
  padding: 12px 20px; border: 1.5px solid var(--input); border-radius: 9999px; background: #ffffff;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 82, 103, 0.14); }
input[readonly] { background: var(--surface); font-family: var(--font-mono); font-size: 13px; }
input.code { font-family: var(--font-mono); font-size: 22px; letter-spacing: 0.4em; text-align: center; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.links { margin: 16px 0 0; font-size: 14px; text-align: center; }

.error, .notice { padding: 10px 16px; border-radius: 16px; font-size: 14px; margin: 16px 0 0; }
.error { color: var(--bad); background: var(--bad-bg); }
.notice { color: var(--ok); background: var(--ok-bg); }

/* The mark and the wordmark of the site. */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--brand); text-decoration: none; }
.brand:hover { color: var(--brand); }
.brand img { width: 32px; height: 32px; display: block; }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 1.125rem; letter-spacing: 0.08em; color: var(--brand); }

/* --- Signed out --------------------------------------------------------------------------------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 40px 16px; background: var(--surface); }
.auth-card { width: 100%; max-width: 440px; background: #ffffff; border: 1px solid var(--border); border-radius: 2rem; padding: 40px 36px; box-shadow: var(--shadow); }
.auth .foot { max-width: 440px; text-align: center; margin: 0; }
@media (max-width: 480px) {
  .auth { justify-content: flex-start; padding-top: 28px; }
  .auth-card { padding: 28px 22px; border-radius: 1.5rem; }
  h1 { font-size: 1.65rem; }
}

/* --- Signed in ---------------------------------------------------------------------------------- */
/* Header: the mark, the shop, the profile menu (as the header of the site and of the back office). */
.app { min-height: 100vh; background: var(--surface); }
.top { position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 20px; background: var(--background); border-bottom: 1px solid var(--border); }
.shop { font-weight: 500; font-size: 14px; color: var(--muted); padding-left: 14px; border-left: 1px solid var(--border); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.icon { padding: 8px; border: 0; border-radius: 9999px; background: none; color: var(--brand); }
button.icon:hover { background: var(--surface); }
.menu-toggle { display: none; }
.profile { position: relative; margin-left: auto; }
.profile-button { gap: 10px; padding: 5px 12px 5px 5px; border: 1px solid var(--border); background: #ffffff; text-transform: none; letter-spacing: 0; font-family: var(--font-sans); color: var(--brand); }
.profile-button:hover { border-color: var(--input); background: var(--surface); }
.profile-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.profile-text strong { font-size: 13px; font-weight: 600; }
.profile-text small { font-size: 11px; color: var(--muted); font-weight: 500; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9999px; background: var(--brand); color: #ffffff; font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; flex: none; }
.avatar.big { width: 64px; height: 64px; font-size: 20px; }
.profile-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 270px; background: #ffffff; border: 1px solid var(--border); border-radius: 1.25rem; padding: 8px; box-shadow: 0 24px 48px -24px rgba(22, 37, 47, 0.45); }
.profile-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.profile-head strong { color: var(--brand); font-family: var(--font-display); }
.profile-head span:not(.badge) { font-size: 13px; color: var(--muted); word-break: break-all; }
.profile-head .badge { align-self: flex-start; margin-top: 6px; }
.profile-menu a, .profile-menu button { display: flex; width: 100%; justify-content: flex-start; padding: 9px 12px; border: 0; border-radius: 12px; background: none; color: var(--foreground); font: 500 14px var(--font-sans); text-transform: none; letter-spacing: 0; text-decoration: none; }
.profile-menu a:hover, .profile-menu button:hover { background: var(--surface); color: var(--brand); }
.profile-menu #logout { color: var(--primary); border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; margin-top: 6px; }

/* Side menu: sections, as the back office; a drawer on a phone. */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.side { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; background: var(--background); border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; }
.side nav { flex: 1; }
.side-title { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 18px 12px 6px; }
.side-title:first-child { margin-top: 0; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9999px; color: var(--foreground); text-decoration: none; font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.side nav a svg { color: var(--ardoise); flex: none; }
.side nav a:hover { background: var(--surface); color: var(--brand); }
.side nav a.on { background: var(--brand); color: #ffffff; }
.side nav a.on svg { color: #ffffff; }
.side-foot { margin: 18px 12px 0; }
.scrim { display: none; }
.view { padding: 32px 32px 64px; max-width: 1180px; width: 100%; }

@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; top: 0; left: 0; height: 100vh; width: 280px; transform: translateX(-100%); transition: transform 200ms var(--ease); box-shadow: 0 0 60px -20px rgba(11, 19, 25, 0.5); }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(11, 19, 25, 0.45); }
  .view { padding: 24px 16px 56px; }
}
@media (max-width: 640px) {
  .top { padding: 0 12px; gap: 8px; }
  .shop, .profile-text { display: none; }
  .profile-button { padding: 4px; }
  .profile-button svg { display: none; }
  .brand .wordmark { font-size: 1rem; }
  h1 { font-size: 1.65rem; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
textarea { border-radius: 1.25rem; resize: vertical; min-height: 110px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.two.tight { gap: 0 16px; margin-bottom: 0; }
.grid.two > .card { margin-bottom: 0; }
h3.spaced { margin-top: 22px; }
.section-title { margin: 28px 0 14px; }
dl.facts { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 8px 16px; margin: 0 0 12px; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; color: var(--foreground); font-weight: 500; word-break: break-word; }
.profile-card { display: flex; align-items: center; gap: 20px; }
.profile-card h2 { margin: 0 0 2px; }
.profile-card p { margin: 0 0 8px; }
ul.rights, ul.rules { list-style: none; margin: 0; padding: 0; font-size: 14px; }
ul.rights li, ul.rules li { padding: 7px 0; border-bottom: 1px solid var(--border); }
ul.rights li:last-child, ul.rules li:last-child { border-bottom: 0; }
ul.rights li.yes span { color: var(--ok); font-weight: 700; }
ul.rights li.no { color: var(--muted); }
ul.rules li::before { content: "//"; font-family: var(--font-mono); color: var(--primary); margin-right: 8px; }

/* « Premiers pas » on the dashboard. */
ol.steps { list-style: none; margin: 0; padding: 0; }
ol.steps li { display: grid; grid-template-columns: 28px 1fr auto; align-items: start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
ol.steps li:last-child { border-bottom: 0; }
ol.steps strong { color: var(--brand); font-family: var(--font-display); }
ol.steps p { margin: 2px 0 0; }
ol.steps .check { width: 26px; height: 26px; border-radius: 9999px; border: 2px solid var(--input); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #ffffff; }
ol.steps li.done .check { background: var(--ok); border-color: var(--ok); }
ol.steps li.done strong { color: var(--muted); }
ol.steps a { font-size: 14px; white-space: nowrap; align-self: center; }
@media (max-width: 480px) { ol.steps li { grid-template-columns: 28px 1fr; } ol.steps a { grid-column: 2; } }

/* Actus. */
.previews { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 10px; }
.previews img { width: 72px; height: 72px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); }
.previews .file { font-size: 13px; padding: 6px 12px; border-radius: 9999px; background: var(--surface); }
.post .post-text { white-space: pre-line; }
.post .counts { font-size: 13px; color: var(--muted); }
.post .product { font-size: 14px; }
ul.comments, ul.activity { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; }
ul.comments li, ul.activity li { padding: 8px 0; border-top: 1px solid var(--border); }
ul.comments li.reply { padding-left: 22px; }
ul.activity li.unread { font-weight: 600; }
ul.activity li.unread::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 9999px; background: var(--primary); margin-right: 8px; vertical-align: middle; }
button.link.small-link { font-size: 12px; margin-left: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.card { background: #ffffff; border: 1px solid var(--border); border-radius: 2rem; padding: 24px 28px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card .head h3 { margin: 0; }
.card h3 { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat { border-radius: 1.5rem; padding: 20px 24px; margin: 0; }
.stat .value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; color: var(--brand); letter-spacing: -0.02em; }
.banner { background: var(--warn-bg); color: var(--warn); border-radius: 16px; padding: 12px 18px; margin-bottom: 20px; }
@media (max-width: 480px) { .card { padding: 20px 18px; border-radius: 1.5rem; } }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.num { font-weight: 600; color: var(--brand); }
td.in { color: var(--ok); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 9999px; font-family: var(--font-display); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; background: var(--surface); color: var(--ardoise); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); }
.pager .actions { justify-content: flex-start; }

.qr { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.qr > div:last-child { flex: 1 1 260px; }
.qr-poster { width: 300px; max-width: 100%; text-align: center; border: 1px solid var(--border); border-radius: 2rem; padding: 24px; background: #ffffff; color: var(--foreground); box-shadow: var(--shadow); }
.qr-poster img.code { width: 100%; height: auto; display: block; }
.qr-poster .name { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--brand); margin-top: 10px; letter-spacing: -0.02em; }
.qr-poster .hint { font-size: 13px; color: var(--muted); }
.qr-poster .brand { justify-content: center; margin-bottom: 12px; }

dialog { border: 1px solid var(--border); border-radius: 2rem; background: #ffffff; color: var(--foreground); padding: 28px; width: min(540px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(11, 19, 25, 0.55); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--night); color: #ffffff; padding: 12px 22px; border-radius: 9999px; max-width: calc(100vw - 32px); font-size: 14px; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
@media print {
  body * { visibility: hidden; }
  .qr-poster, .qr-poster * { visibility: visible; }
  .qr-poster { position: absolute; left: 0; top: 0; box-shadow: none; }
}
