/* Vérif'Carton : feuille de style unique, mobile d'abord (maquette validée, docs/DESIGN.md).
   Aucune couleur en dur hors de :root. Aucune ombre portée : seuls des contours (box-shadow inset)
   et le voile de la caméra utilisent box-shadow. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/vendor/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/vendor/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Base (docs/DESIGN.md §2) */
  --sapin: #163a32;
  --sapin-clair: #22503f;
  --pion: #2f7a5c;
  --action: #1c6048;
  --fond: #f4f6f3;
  --surface: #ffffff;
  --encre: #17231f;
  --texte-2: #3f5149;
  --texte-3: #5b6b64;
  --bordure: #d9e2dc;
  --bordure-champ: #c9d5cd;
  --separateur: #e3e9e5;
  --entete-texte-2: #c4dacd;
  --onglet-actif: #8fc4a6;
  --selection: #e9f3ed;

  /* États */
  --valide-fond: #dcefe3;
  --valide: #17613b;
  --refus-fond: #fbe3e3;
  --refus: #9a2424;
  --refus-texte: #7d1d1d;
  --inconnu-fond: #fff0d9;
  --inconnu: #7a4700;
  --alerte-fond: #fff3dc;
  --alerte-texte: #6e4300;

  /* Caméra */
  --voile-camera: rgba(15, 38, 31, 0.5);
  --bandeau-camera: rgba(15, 38, 31, 0.78);

  /* Compléments lus dans la maquette, absents de DESIGN.md §2 */
  --etiquette-texte: #d6e7dd;
  --anneau-logo: #e9f2ec;
  --bordure-erreur: #ecc9c9;
  --separateur-erreur: #f1d5d5;
  --alerte-texte-fort: #4a2f00;
  --fond-camera: #0f261f;
  --voile-menu: rgba(10, 28, 22, 0.62);
  --halo-marqueur: rgba(28, 96, 72, 0.75);

  --police: "Atkinson Hyperlegible", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police);
  font-size: 17px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
p,
dl,
dd,
fieldset,
ul {
  margin: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

.topbar :focus-visible,
.screen--boot :focus-visible,
.screen--login .login__head :focus-visible,
.cam :focus-visible {
  outline-color: var(--surface);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.noscript {
  padding: 20px;
  font-size: 18px;
}

/* Cadre de l'application */

.app {
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  position: relative;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 18px 20px;
}

.page--manual {
  gap: 16px;
}

.page--photo {
  gap: 12px;
  padding: 18px 18px 20px;
}

.page--proposals {
  gap: 18px;
  padding: 24px 18px 22px;
}

.page--absent {
  gap: 18px;
}

.page--result {
  padding: 22px 18px 20px;
}

.page--info {
  padding: 28px 20px 20px;
}

.page--test {
  gap: 12px;
  padding: 14px 16px 16px;
}

.page--form {
  gap: 14px;
  padding: 18px 16px 18px;
}

.page--admin {
  gap: 12px;
  padding: 16px 16px 18px;
}

.admin-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loading {
  padding: 24px 18px;
  font-size: 16px;
  color: var(--texte-3);
}

.loading--inline {
  padding: 0;
  text-align: center;
}

/* Marque, icônes, textes courants */

.logo {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.logo--lg {
  width: 52px;
  height: 52px;
}

.logo__disk {
  fill: var(--pion);
}

.logo__ring {
  fill: none;
  stroke: var(--anneau-logo);
  stroke-width: 2;
}

.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--14 {
  width: 14px;
  height: 14px;
}

.icon--18 {
  width: 18px;
  height: 18px;
}

.icon--20 {
  width: 20px;
  height: 20px;
}

.icon--22 {
  width: 22px;
  height: 22px;
}

.icon--28 {
  width: 28px;
  height: 28px;
}

.icon--36 {
  width: 36px;
  height: 36px;
  stroke-width: 1.8;
}

.icon--bold {
  stroke-width: 2;
}

.icon--heavy {
  stroke-width: 3.2;
}

.title {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--sapin);
}

.title--lg {
  margin-bottom: 8px;
  font-size: 27px;
}

.title--md {
  font-size: 24px;
}

.title--sm {
  font-size: 22px;
}

.subtitle {
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--sapin);
}

.lead {
  font-size: 16px;
  line-height: 1.45;
  color: var(--texte-3);
}

.lead--md {
  font-size: 17px;
  color: var(--texte-2);
}

.lead--sm {
  font-size: 15px;
}

/* Barres d'en-tête */

.topbar {
  flex-shrink: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sapin);
  color: var(--surface);
}

.topbar--brand {
  padding: 0 12px 0 18px;
}

.topbar--back {
  padding: 0 16px 0 4px;
}

.topbar--admin {
  height: auto;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.topbar__row {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 18px;
}

.topbar__lead {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar--back .topbar__lead {
  gap: 4px;
}

.topbar__title {
  font-size: 19px;
  font-weight: 700;
}

.topbar--brand .topbar__title {
  letter-spacing: -0.01em;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.topbar__chip {
  max-width: 40vw;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--sapin-clair);
  color: var(--etiquette-texte);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__note {
  font-size: 14px;
  color: var(--entete-texte-2);
}

.icon-btn {
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn--dark {
  color: var(--sapin);
}

.tabs {
  display: flex;
  overflow-x: auto;
  padding: 0 6px;
  font-size: 16px;
}

.tabs__link {
  flex-shrink: 0;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: var(--entete-texte-2);
  cursor: pointer;
}

.tabs__link--current {
  color: var(--surface);
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--onglet-actif);
}

/* Boutons */

.btn {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.btn--primary {
  background: var(--action);
  color: var(--surface);
}

.btn--secondary {
  background: var(--surface);
  color: var(--sapin);
  box-shadow: inset 0 0 0 1.5px var(--action);
}

.btn--danger-outline {
  background: var(--surface);
  color: var(--refus);
  box-shadow: inset 0 0 0 1.5px var(--refus);
}

.btn--lg {
  min-height: 58px;
  font-size: 19px;
}

.btn--half {
  min-height: 54px;
}

.btn--md {
  font-size: 17px;
}

.btn--export {
  min-height: 52px;
  margin-top: auto;
  gap: 10px;
  font-size: 17px;
}

.btn--link {
  min-height: 48px;
  background: transparent;
  color: var(--action);
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--action);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.link--center {
  align-self: center;
  font-size: 16px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.actions--end {
  margin-top: auto;
}

.actions--tight {
  gap: 6px;
}

.actions--pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.actions--reverse {
  flex-direction: column-reverse;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 20px;
}

.links .btn {
  width: auto;
}

/* Champs de formulaire */

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--sapin);
}

.field__label--sm {
  font-size: 15px;
}

.field__input {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--bordure-champ);
  font-size: 17px;
}

.field__input--lg {
  height: 50px;
  padding: 0 14px;
  font-size: 18px;
}

.field__input--search {
  height: 46px;
  padding: 0 14px;
}

.field__input--number {
  height: 62px;
  padding: 0 14px;
  font-size: 34px;
  font-weight: 700;
  color: var(--sapin);
}

.field__input--pin {
  height: 50px;
  padding: 0 14px;
  font-size: 20px;
  letter-spacing: 0.3em;
}

.field__input--spaced {
  margin-top: 10px;
}

.field__hint {
  margin-top: 6px;
  font-size: 14px;
  color: var(--texte-3);
}

.field__hint--md {
  margin-top: 0;
  font-size: 15px;
  line-height: 1.45;
}

.field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--alerte-texte-fort);
  cursor: pointer;
}

.check input {
  width: 22px;
  height: 22px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--action);
}

/* Messages */

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.4;
}

.alert--error {
  background: var(--refus-fond);
  color: var(--refus-texte);
}

.alert--warning {
  background: var(--alerte-fond);
  color: var(--alerte-texte);
}

.alert--small {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.alert--stack {
  flex-direction: column;
  gap: 10px;
}

.alert__icon {
  margin-top: 1px;
}

.alert__title {
  font-size: 19px;
  font-weight: 700;
}

.alert__text {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.4;
}

.toast {
  position: fixed;
  top: calc(68px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 30;
  max-width: 496px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}

.toast--error {
  background: var(--refus-fond);
  color: var(--refus-texte);
  box-shadow: inset 0 0 0 1.5px var(--refus);
}

.toast--success {
  background: var(--valide-fond);
  color: var(--valide);
  box-shadow: inset 0 0 0 1.5px var(--valide);
}

.banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--inconnu-fond);
  color: var(--alerte-texte);
  font-size: 16px;
  font-weight: 700;
}

/* Chargement et connexion */

.screen--boot {
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background: var(--sapin);
  color: var(--surface);
  text-align: center;
}

.screen--boot .btn {
  max-width: 280px;
}

.boot__message {
  font-size: 17px;
}

.screen--login {
  background: var(--sapin);
}

.login__head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 56px 24px 34px;
  color: var(--surface);
}

.login__title {
  font-size: 34px;
  line-height: 1.1;
}

.login__subtitle {
  margin-top: 6px;
  font-size: 17px;
  color: var(--entete-texte-2);
}

.login__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 20px 20px;
  border-radius: 26px 26px 0 0;
  background: var(--fond);
}

.pin {
  display: flex;
  justify-content: space-between;
}

.pin__box {
  width: 30px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--bordure-champ);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin__box--active {
  box-shadow: inset 0 0 0 1.5px var(--action);
}

.pin__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sapin);
}

.pin__input:focus-visible ~ .pin .pin__box--active {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.keypad--disabled {
  opacity: 0.4;
}

.keypad__key {
  height: 58px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--sapin);
  box-shadow: inset 0 0 0 1px var(--bordure);
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
}

.keypad__key--ghost {
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keypad__key--enter {
  background: var(--action);
  box-shadow: none;
  color: var(--surface);
  font-size: 19px;
}

/* Viseur et caméras */

.cam {
  position: relative;
  height: clamp(300px, calc(100dvh - 260px), 584px);
  flex-shrink: 0;
  overflow: hidden;
  container-type: size;
  background: var(--fond-camera);
}

.cam--compact {
  height: 190px;
}

.cam--test {
  height: 150px;
}

.viewfinder {
  position: absolute;
  inset: 0;
}

.viewfinder video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--fond-camera);
}

.viewfinder__frame {
  position: absolute;
  left: 50%;
  top: 51cqh;
  width: 66.67cqw;
  margin-left: -33.335cqw;
  aspect-ratio: 3.2 / 1;
  border: 3px solid var(--surface);
  border-radius: 14px;
  box-shadow: 0 0 0 100vmax var(--voile-camera);
}

.cam--compact .viewfinder__frame,
.cam--test .viewfinder__frame {
  width: 56.4cqw;
  margin-left: -28.2cqw;
  border-radius: 12px;
}

.cam--compact .viewfinder__frame {
  top: 31.6cqh;
}

.cam--test .viewfinder__frame {
  top: 26.6cqh;
}

.cam__consigne {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 20px;
  background: var(--bandeau-camera);
  color: var(--surface);
  font-size: 17px;
  line-height: 1.35;
}

.cam__below {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(51cqh + 20.84cqw + 20px);
  display: flex;
  justify-content: center;
}

.cam__badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--sapin);
  font-size: 14px;
  font-weight: 700;
}

.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--sapin);
  font-size: 16px;
  font-weight: 700;
}

.pill__spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--action);
  stroke-width: 2.5;
  stroke-dasharray: 26 12;
}

.hint {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--encre);
  font-size: 16px;
  line-height: 1.4;
}

.hint__icon {
  color: var(--action);
}

.tools {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 16px 12px 10px;
  align-content: start;
}

.tool {
  height: 76px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--sapin);
  box-shadow: inset 0 0 0 1px var(--bordure);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.tool[aria-pressed="true"] {
  background: var(--selection);
  box-shadow: inset 0 0 0 2px var(--action);
}

.tool--advised {
  background: var(--action);
  color: var(--surface);
  box-shadow: none;
}

.stats-line {
  padding: 0 20px 22px;
  font-size: 14px;
  color: var(--texte-3);
  text-align: center;
}

/* Saisie à la main */

.number-input {
  width: 100%;
  height: 84px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--action);
  color: var(--sapin);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Photo */

.photo {
  position: relative;
  height: 470px;
  max-height: 55dvh;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--fond-camera);
}

.photo__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.photo__marker {
  position: absolute;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--halo-marqueur);
  pointer-events: none;
}

.photo__marker[hidden] {
  display: none;
}

.photo__busy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--bandeau-camera);
  color: var(--surface);
  font-size: 16px;
  font-weight: 700;
}

.photo__busy .pill__spinner {
  stroke: var(--surface);
}

.photo__title {
  margin-bottom: 12px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--sapin);
}

/* Liste de propositions */

.choices {
  list-style: none;
  padding: 0;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
  overflow: hidden;
}

.choices > li + li {
  border-top: 1px solid var(--separateur);
}

.choice {
  width: 100%;
  min-height: 84px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
}

.choice--featured {
  background: var(--selection);
}

.choice--small {
  min-height: 64px;
  padding: 10px 16px;
}

.choice__text {
  flex: 1;
}

.choice__line {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.choice__number {
  display: block;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: var(--sapin);
}

.choice__detail {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  color: var(--texte-3);
}

.choice--featured .choice__detail {
  color: var(--texte-2);
}

.choice--small .choice__number {
  display: inline;
  font-size: 28px;
}

.choice--small .choice__detail {
  display: inline;
  margin-top: 0;
}

.choice__chevron {
  color: var(--texte-3);
}

.choice--featured .choice__chevron {
  color: var(--action);
}

/* Numéro absent, numéro lu, résultat */

.number-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
}

.number-card__label {
  font-size: 16px;
  color: var(--texte-3);
}

.number-card__value {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  color: var(--sapin);
}

.verdict {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 34px 20px 28px;
}

.verdict--valid {
  background: var(--valide-fond);
  color: var(--valide);
}

.verdict--invalid {
  background: var(--refus-fond);
  color: var(--refus);
}

.verdict--unknown {
  background: var(--inconnu-fond);
  color: var(--inconnu);
}

.stamp {
  padding: 5px;
  border: 5px solid currentColor;
  border-radius: 18px;
  transform: rotate(-4deg);
  animation: stamp-pose 180ms ease-out;
}

.stamp__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 26px 12px;
  border: 2px solid currentColor;
  border-radius: 12px;
}

.stamp__icon {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: currentColor;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stamp__word {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.verdict--invalid .stamp__inner {
  gap: 12px;
  padding: 10px 20px 12px;
}

.verdict--invalid .stamp__icon {
  width: 34px;
  height: 34px;
  stroke-width: 7;
}

.verdict--invalid .stamp__word {
  font-size: 36px;
  letter-spacing: 0.03em;
}

.verdict--unknown .stamp__inner {
  padding: 10px 24px 12px;
}

.verdict--unknown .stamp__icon {
  width: 40px;
  height: 40px;
}

.verdict--unknown .stamp__word {
  font-size: 46px;
}

.verdict__subtitle {
  font-size: 21px;
  font-weight: 700;
}

@keyframes stamp-pose {
  from {
    transform: rotate(-4deg) scale(1.08);
  }

  to {
    transform: rotate(-4deg) scale(1);
  }
}

.card-number {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.card-number__label {
  font-size: 17px;
  color: var(--texte-3);
}

.card-number__value {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  color: var(--sapin);
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
}

.details dt {
  font-size: 14px;
  color: var(--texte-3);
}

.details dd {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.details--soft {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--fond);
  box-shadow: none;
}

.details--soft dd {
  font-size: 17px;
}

.details__wide {
  grid-column: span 2;
}

.explain {
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
  font-size: 17px;
  line-height: 1.45;
}

.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.4;
  color: var(--texte-2);
}

.note .icon {
  margin-top: 1px;
}

.info-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--separateur);
  color: var(--sapin);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Test caméra */

.facts {
  padding: 4px 14px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
}

.facts__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 15px;
}

.facts__row + .facts__row {
  border-top: 1px solid var(--separateur);
}

.facts dt {
  color: var(--texte-3);
}

.facts dd {
  font-weight: 700;
  text-align: right;
}

.crop {
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
}

.crop__label {
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--texte-3);
}

.crop__canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: var(--separateur);
}

.cameras {
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
  overflow: hidden;
}

.cameras__legend {
  float: left;
  width: 100%;
  padding: 12px 14px 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--sapin);
}

.camera-option {
  clear: both;
  min-height: 52px;
  padding: 6px 14px;
  border-top: 1px solid var(--separateur);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.camera-option input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--action);
}

.camera-option__text {
  flex: 1;
}

.camera-option__name {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.camera-option__detail {
  display: block;
  font-size: 14px;
  color: var(--texte-3);
}

/* Listes, pastilles, segments */

.list {
  list-style: none;
  padding: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
  overflow: hidden;
}

.list > li + li {
  border-top: 1px solid var(--separateur);
}

.list__row {
  width: 100%;
  min-height: 58px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.list__main {
  flex: 1;
  min-width: 0;
  display: block;
}

.list__title {
  display: block;
  font-size: 21px;
  font-weight: 700;
  color: var(--sapin);
}

.list__title--sm {
  font-size: 19px;
}

.list__sub {
  display: block;
  font-size: 14px;
  color: var(--texte-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.badge--valid {
  background: var(--valide-fond);
  color: var(--valide);
}

.badge--invalid {
  background: var(--refus-fond);
  color: var(--refus);
}

.badge--unknown {
  background: var(--inconnu-fond);
  color: var(--inconnu);
}

.segmented {
  display: grid;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--separateur);
}

.segmented--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segment {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--texte-2);
  font-size: 15px;
  cursor: pointer;
}

.segmented--4 .segment {
  font-size: 14px;
}

.segment--on {
  background: var(--surface);
  color: var(--sapin);
  font-weight: 700;
}

.summary {
  font-size: 17px;
}

.summary__big {
  font-size: 22px;
  color: var(--sapin);
}

.bar {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--separateur);
  overflow: hidden;
  appearance: none;
}

.bar::-webkit-progress-bar {
  background: var(--separateur);
}

.bar::-webkit-progress-value {
  border-radius: 999px;
  background: var(--action);
}

.bar::-moz-progress-bar {
  border-radius: 999px;
  background: var(--action);
}

.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 10px 14px;
}

.history-row__when {
  width: 52px;
  flex-shrink: 0;
  font-size: 15px;
  color: var(--texte-3);
}

.history-row__when > span {
  display: block;
}

.history-row__day {
  font-size: 14px;
}

.event {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1.35;
}

.event__time {
  width: 46px;
  flex-shrink: 0;
  color: var(--texte-3);
}

/* Import */

.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
}

.file-card__icon {
  color: var(--action);
  stroke-width: 1.8;
}

.file-card__text {
  flex: 1;
  min-width: 0;
}

.file-card__name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card__meta {
  display: block;
  font-size: 14px;
  color: var(--texte-3);
}

.ready__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--sapin);
}

.ready__text {
  margin-top: 2px;
  font-size: 16px;
  color: var(--texte-2);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--separateur);
  color: var(--sapin);
  font-size: 14px;
}

.tag--extra {
  background: var(--alerte-fond);
  color: var(--alerte-texte);
}

.list--errors {
  box-shadow: inset 0 0 0 1px var(--bordure-erreur);
}

.list--errors > li + li {
  border-top-color: var(--separateur-erreur);
}

.error-row {
  padding: 12px 14px;
}

.error-row__line {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--refus);
}

.error-row__message {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.4;
}

/* Fiche carton et ajout de cartons */

.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.sheet-head__number {
  font-size: 52px;
  font-weight: 700;
  line-height: 1;
  color: var(--sapin);
}

.sheet-head__supplier {
  font-size: 16px;
  color: var(--texte-3);
}

.states {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--separateur);
}

.state {
  height: 50px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--texte-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  cursor: pointer;
}

.state--on {
  background: var(--surface);
  font-weight: 700;
}

.state--sold.state--on {
  color: var(--valide);
  box-shadow: inset 0 0 0 2px var(--valide);
}

.state--unsold.state--on {
  color: var(--refus);
  box-shadow: inset 0 0 0 2px var(--refus);
}

.state:not(.state--on) .icon {
  display: none;
}

.sheet {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: -18px;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
}

.sheet__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 18px;
}

.sheet .field__input {
  background: var(--fond);
}

.chips {
  padding: 0;
  border: 0;
}

.chips legend {
  padding: 0;
  margin-bottom: 8px;
}

.chips__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--fond);
  color: var(--sapin);
  box-shadow: inset 0 0 0 1.5px var(--bordure-champ);
  font-size: 16px;
  cursor: pointer;
}

.chip--on {
  background: var(--sapin);
  color: var(--surface);
  box-shadow: none;
  font-weight: 700;
}

.existing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.existing-head__number {
  display: block;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--sapin);
}

.existing-head__supplier {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  color: var(--texte-3);
}

/* Menu */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--voile-menu);
}

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(304px, 88vw);
  display: flex;
  flex-direction: column;
  padding: 0 12px 20px;
  overflow-y: auto;
  background: var(--fond);
}

.drawer__head {
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 8px;
}

.drawer__title {
  font-size: 19px;
  font-weight: 700;
  color: var(--sapin);
}

.device-card {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
}

.device-card__meta {
  font-size: 14px;
  color: var(--texte-3);
}

.device-card__meta--spaced {
  margin-top: 6px;
}

.device-card__row {
  margin-top: 2px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.device-card__row strong {
  font-size: 19px;
  color: var(--sapin);
  overflow-wrap: anywhere;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu--foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--bordure);
}

.menu__link {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--sapin);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 18px;
  text-align: left;
  cursor: pointer;
}

.menu__link--current {
  background: var(--selection);
  font-weight: 700;
}

.menu__link--danger {
  color: var(--refus);
}

/* Petits écrans et mouvements réduits */

@media (max-height: 700px) {
  .verdict {
    gap: 12px;
    padding: 20px 20px 16px;
  }

  .login__head {
    padding-top: 28px;
    padding-bottom: 20px;
  }
}

@media (max-width: 359px) {
  .choice__number {
    font-size: 32px;
  }

  .card-number__value,
  .number-card__value {
    font-size: 52px;
  }

  .stamp__word {
    font-size: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stamp {
    animation: none;
  }
}

/* Reste caché jusqu'au démarrage d'Alpine : doit rester la dernière règle pour l'emporter. */
[x-cloak] {
  display: none;
}
