/* Served to every Fidelyo surface (customer pages, counter, owner, account and sign-in pages), under each
   surface's own sheet. It lives in fidelyo_accounts because that app holds the frame every other page extends
   (holder/base.html) and the fonts it names sit beside it in fonts/, so each url() is one relative path and the
   preloads name the same URLs. The demo's base.css, uncut (design audit round 2, decision 0: Edem, 2026-11-12),
   only its font paths changed; tests/fidelyo_accounts/test_stylesheets.py checks it against the demo. */
/* Fidelyo demo: what every surface shares. App and customer tokens of DESIGN.md: 2 px slabs, pressed-edge
   buttons, no shadows, circles only for stamps. One family, Fidelyo Atkinson 400/600/800, same origin
   (Edem, 2026-11-09, in place of Anybody and Atkinson Mono for the prototype). No JavaScript. */
@font-face { font-family: "Fidelyo Atkinson"; src: url("fonts/atkinson-next-400.woff2?v=3") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fidelyo Atkinson"; src: url("fonts/atkinson-next-600.woff2?v=3") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fidelyo Atkinson"; src: url("fonts/atkinson-next-800.woff2?v=3") format("woff2"); font-weight: 800; font-display: swap; }
:root {
  --primary: #4b0082;
  --primary-deep: #33005a;
  --on-primary: #ffffff;
  --on-primary-soft: #e6dcf0;
  --text: #16121d;
  --text-soft: #3a3542;
  --text-muted: #5a5563;
  --surface: #ffffff;
  --surface-soft: #f1f1f4;
  --line: #d9d8de;
  --selected: #f0efff;
  --counter-ground: #f3dc7a;
  --counter-line: rgba(22, 18, 29, 0.28);  /* the counter's hairline: ink at 28 % on the yellow, 7:1 rule kept for text */
  --success: #00695c;
  --success-bg: #e3f1ee;
  --warning-bg: #fff4c2;
  --warning-text: #5c4300;
  --error: #b3261e;
  --error-bg: #fbe9e7;
  --whatsapp: #0b6b3a;
  --whatsapp-hover: #095c32;
  --whatsapp-active: #074a28;
  --device: #1b1720;
  --accent: var(--primary);  /* customer pages set the shop preset on <body> */
  --font: "Fidelyo Atkinson", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 2px;
  --gutter: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--text-muted) var(--surface-soft); }
body { margin: 0; min-height: 100vh; background: var(--surface); color: var(--text); font: 400 1rem/1.5 var(--font); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; }
::selection { background: var(--selected); color: var(--text); }
input, textarea { caret-color: var(--accent); }
a { color: var(--primary); text-underline-offset: 3px; }
a:visited { color: var(--primary-deep); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: break-word; color: var(--text); }
h1 { font-weight: 800; font-size: 1.625rem; line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-weight: 800; font-size: 1.25rem; line-height: 1.25; }
h3 { font-weight: 700; font-size: 1.0625rem; line-height: 1.3; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.mono, .score, .masked { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 24px; }
.actions { display: grid; gap: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons: slabs with a pressed bottom edge that flattens on :active (DESIGN.md Elevation) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px; border: 0; border-radius: var(--r); font: 700 1.0625rem/1.2 var(--font); text-decoration: none; text-align: center; cursor: pointer; width: 100%; }
.btn:visited { color: inherit; }
.btn svg { flex: none; }
.btn-primary { background: var(--accent); color: var(--on-primary); box-shadow: inset 0 -4px 0 rgba(22, 18, 29, 0.35); }
.btn-primary:visited { color: var(--on-primary); }
.btn-secondary { background: var(--surface); color: var(--text); border: 2px solid var(--text); box-shadow: inset 0 -3px 0 var(--text); }
.btn-secondary:visited { color: var(--text); }
.btn-whatsapp { background: var(--whatsapp); color: var(--on-primary); min-height: 56px; box-shadow: inset 0 -4px 0 var(--whatsapp-active); }
.btn-whatsapp:visited { color: var(--on-primary); }
.btn-whatsapp:hover { background: var(--whatsapp-hover); }
.btn:active { box-shadow: none; transform: translateY(2px); }
.btn:disabled { background: var(--surface-soft); color: var(--text-muted); border-color: var(--line); box-shadow: none; cursor: not-allowed; transform: none; }
.btn.is-pending:disabled { background: var(--text-soft); color: var(--on-primary); }
.ghost { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; color: var(--primary); text-decoration: underline; }
.ghost:visited { color: var(--primary-deep); }

/* Fields: always-visible label, 2 px border, red border plus a bold red hint that says what to do */
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 0.95rem; }
.optional { font-weight: 400; color: var(--text-soft); }
.field input, .field select, .field textarea, .prefixed select { width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--text-soft); border-radius: var(--r); background: var(--surface); color: var(--text); font: 400 1.0625rem/1.3 var(--font); }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.field input:disabled { background: var(--surface-soft); color: var(--text-muted); }
.is-mono input { letter-spacing: 0.06em; font-weight: 600; }
.field input[autocomplete="one-time-code"] { letter-spacing: 0.2em; font-size: 1.25rem; max-width: 14rem; }
.prefixed { display: flex; gap: 8px; }
.prefixed select { width: auto; flex: none; padding-right: 4px; font-weight: 600; }
.prefixed .prefix { display: inline-flex; align-items: center; padding: 0 12px; border: 2px solid var(--text-soft); border-radius: var(--r); background: var(--surface-soft); font-weight: 600; }
.hint { color: var(--text-soft); font-size: 1rem; }
.error-hint { color: var(--error); font-weight: 700; }
.is-error input, .is-error select { border-color: var(--error); }
/* Check rows (design audit round 2, decision 3): at least 48 px, and the label fills the row, reaching back under
   the box's column (28 px plus the 10 px gap), so a thumb anywhere on the row toggles it. The box stays on top of
   the label, so a tap on the box is the box's own. It sits on the label's first line, so a label on two lines
   still reads from its box. */
.check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; min-height: 48px; }
.check input { position: relative; z-index: 1; width: 24px; height: 24px; margin: 12px 0 0; accent-color: var(--accent); }
.check label { display: block; min-height: 48px; margin-left: -38px; padding: 12px 0 12px 38px; font-weight: 400; cursor: pointer; }
/* A native checkbox draws no border-color, so a group in error (no shop chosen) rings each box in the error
   colour, and so does a single row in error (the counter's consent box left unticked, `.check.is-error`); the
   keyboard's focus ring still replaces it on the focused box */
.is-error .check input:not(:focus-visible),
.check.is-error input:not(:focus-visible) { outline: 2px solid var(--error); outline-offset: 2px; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
legend { font-weight: 700; font-size: 0.95rem; padding: 0; margin-bottom: 6px; }
/* Disclosures: a drawn chevron that turns when open (the marker is replaced, so the fold still reads as one) */
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.chevron { flex: none; transition: transform 150ms ease-out; }
details[open] > summary .chevron { transform: rotate(90deg); }
details.fold summary { min-height: 48px; display: flex; align-items: center; gap: 6px; font-weight: 700; cursor: pointer; color: var(--text); }

/* Notes: each tinted from its own hue, never grey */
.note { padding: 12px 14px; border-radius: var(--r); display: grid; gap: 4px; }
.note-success { background: var(--success-bg); color: var(--success); }
.note-warning { background: var(--warning-bg); color: var(--warning-text); }
.note-error { background: var(--error-bg); color: var(--error); }
.note-info { background: var(--selected); color: var(--primary-deep); }
.note strong { font-weight: 800; }
.slab { background: var(--text); color: var(--on-primary); padding: 14px 16px; border-radius: var(--r); font-weight: 700; display: grid; gap: 4px; }
.slab .soft { color: var(--on-primary-soft); font-weight: 400; }

/* Final action: DESIGN.md says why */
.final-entry { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.final-link, .final-link:visited, body.client .final-link, body.client .final-link:visited { justify-self: start; display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; color: var(--text); text-decoration: underline 2px var(--error); text-underline-offset: 5px; }
.note-final { background: var(--error-bg); color: var(--text); border-top: 4px solid var(--error); border-radius: 0 0 var(--r) var(--r); }
.final-title { color: var(--error); font-weight: 800; font-size: 1.125rem; }
.note-final ul { list-style: square; padding-left: 20px; }
.note-final li::marker { color: var(--error); }
.btn-final { background: var(--text); box-shadow: inset 0 -4px 0 var(--error); padding-block: 8px 12px; }
.btn-final, .btn-final:visited, body.client .btn-final, body.client .btn-final:visited { color: var(--on-primary); }
.live { min-height: 1.5em; }

/* Rows: content is not boxed; full-bleed rows split by 1 px lines */
.rows > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows > li:first-child { border-top: 1px solid var(--line); }
.defs { display: grid; }
.defs > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.defs dt { color: var(--text-soft); }
.defs dd { margin: 0; font-weight: 700; text-align: right; }
.score { font-weight: 800; white-space: nowrap; }

/* Keypad: the counter and the tablet share it; 64 px keys with the pressed edge (DESIGN.md Layout) */
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.key { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 64px; background: var(--surface); color: var(--text); border: 2px solid var(--text); border-radius: var(--r); box-shadow: inset 0 -3px 0 var(--text); font-weight: 800; font-size: 1.75rem; text-decoration: none; }
.key:visited { color: var(--text); }
.key:active { box-shadow: none; transform: translateY(2px); }
.key.is-blank { background: transparent; border: 0; box-shadow: none; }
.key.is-erase { font-size: 1rem; }

/* The demo bar: dark device chrome after the page, never mistaken for the product */
.demo { margin-top: auto; background: var(--device); color: #f4f2f7; font-size: 1rem; }
.demo-in { max-width: 1160px; margin: 0 auto; padding: 14px var(--gutter) 18px; display: grid; gap: 6px; }
body aside.demo a, body aside.demo a:visited { color: #fff; } /* beats the customer pages' accent links */
.demo :focus-visible { outline-color: #fff; }
.demo-title { font-weight: 600; }
.demo-title a { font-weight: 800; }
.demo summary { min-height: 48px; padding: 10px 0; cursor: pointer; font-weight: 700; display: flex; gap: 6px; align-items: flex-start; text-decoration: underline; text-underline-offset: 3px; }
.demo summary .chevron { margin-top: 2px; }
.demo-now { display: block; font-weight: 400; color: #cfc8d8; text-decoration: none; }
.demo-count { font-weight: 400; color: #cfc8d8; }
.demo-states { display: grid; gap: 2px; padding: 4px 0 8px; }
.demo-states a { display: flex; gap: 8px; min-height: 48px; align-items: center; text-decoration: none; }
.demo-states a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; font-weight: 700; }
.demo-kind { display: inline-block; min-width: 7.5rem; color: #cfc8d8; }
.demo-shops { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.demo-shops a { min-height: 48px; display: inline-flex; align-items: center; }
.demo-shops a[aria-current="page"] { font-weight: 800; text-decoration-thickness: 2px; }
.demo-ata a { display: inline-flex; min-height: 48px; align-items: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* ---- Fidelyo additions: markup the app has and the demo doesn't */
/* `.button` is the class of the platform's sign-in templates, and of Fidelyo's own until they move to .btn:
   the .btn-primary slab, and `.secondary` the .btn-secondary one. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px; border: 0; border-radius: var(--r); background: var(--accent); color: var(--on-primary); font: 700 1.0625rem/1.2 var(--font); text-decoration: none; text-align: center; cursor: pointer; width: 100%; box-shadow: inset 0 -4px 0 rgba(22, 18, 29, 0.35); }
.button:visited { color: var(--on-primary); }
.button.secondary, .button.secondary:visited { background: var(--surface); color: var(--text); border: 2px solid var(--text); box-shadow: inset 0 -3px 0 var(--text); }
.button:active { box-shadow: none; transform: translateY(2px); }
/* A form button drawn as a ghost link: the owner's « Changer de boutique » posts, as do « Refuser » and
   « Renvoyer le code » */
button.ghost { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
