/* =========================================================================
   Système de design — impression A4
   Aucune ressource externe : la CSP n'autorise que ce qui vient d'ici.
   ========================================================================= */

/* Le site est volontairement clair : un service d'impression se lit mieux
   sur du papier blanc. Pas de bascule automatique en sombre — elle donnait
   une interface lourde selon le réglage du téléphone. */
:root {
  color-scheme: light;

  /* Neutres */
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-2: #f4f7f9;
  --border: #e6ebf0;
  --border-strong: #ccd5dd;
  --text: #12161c;
  --text-muted: #667283;

  /* Marque, en deux tons.
     Le bleu porte l'action et la confiance ; l'ambre attire l'œil sur ce qui
     presse ou mérite un coup d'œil (priorité, étape en cours, accent du logo).
     Deux tons suffisent : au troisième, plus rien ne ressort.
     Le vert reste réservé au sens « c'est fait » (voir --ok plus bas) : le
     confondre avec la couleur des boutons brouillerait les deux messages. */
  --brand: #1560cc;
  --brand-hover: #104ba4;
  --brand-soft: #e9f1fd;
  --brand-ring: rgba(21, 96, 204, 0.24);
  --on-brand: #ffffff;

  --accent: #ef8b1f;
  --accent-hover: #d97706;
  --accent-soft: #fff3e2;
  --on-accent: #3d2202;

  --duo: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);

  /* Sémantique. Le vert ne sert plus qu'à dire « c'est fait » : commande
     imprimée, remise, payée, compte actif. */
  --ok: #0f7a5f;
  --ok-bg: #e6f5ef;
  --ok-border: #b6ddcc;
  --warn: #8a5a06;
  --warn-bg: #fdf4e0;
  --warn-border: #ecd5a3;
  --danger: #a52d2d;
  --danger-bg: #fceded;
  --danger-border: #ecc3c3;

  /* Formes */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-full: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 20, 28, 0.05);
  --shadow: 0 1px 3px rgba(16, 20, 28, 0.06), 0 8px 24px -12px rgba(16, 20, 28, 0.12);
  --shadow-lg: 0 2px 6px rgba(16, 20, 28, 0.07), 0 24px 48px -20px rgba(16, 20, 28, 0.22);

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------- ossature -- */

/* ------------------------------------------------------------ logo ------- */

.logo {
  width: 1em;
  height: 1em;
  flex: none;
  display: block;
}
/* Le logo porte les deux tons : corps vert, voyant ambre, lignes ambrées
   sur la feuille qui sort — l'œil suit le papier. */
.logo-body {
  fill: var(--brand);
}
.logo-paper {
  fill: #ffffff;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linejoin: round;
}
.logo-lines {
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  fill: none;
}
.logo-dot {
  fill: var(--accent);
}

/* --------------------------------------------------------- en-tête ------- */

/* Bandeau des deux tons : la signature de la marque, tout en haut. */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--duo);
  z-index: 30;
}

.topbar {
  position: sticky;
  top: 4px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand .logo {
  font-size: 2.6rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.brand-text strong {
  font-size: 1.2rem;
  font-weight: 680;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-text span {
  color: var(--text-muted);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 30rem) {
  .brand .logo {
    font-size: 2.1rem;
  }
  .brand-text strong {
    font-size: 1.05rem;
  }
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-link {
  padding: 0.45rem 0.8rem;
  border-radius: var(--r-full);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-link.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}
/* La déconnexion est un bouton (POST), mais doit ressembler aux autres liens. */
button.nav-link {
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

.nav-sep {
  width: 1px;
  height: 1.4rem;
  margin: 0 0.25rem;
  background: var(--border);
}

.locale-form {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}
.locale-form select {
  width: auto;
  padding: 0.35rem 1.9rem 0.35rem 0.65rem;
  font-size: 0.85rem;
  border-radius: var(--r-full);
}

.page {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 5rem;
}

.footer {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) 2.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer p {
  margin: 0.2rem 0;
}

/* ----------------------------------------------------------- typographie -- */

h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  font-weight: 660;
  letter-spacing: -0.022em;
  line-height: 1.2;
}
h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  font-size: 1.12rem;
  font-weight: 640;
  letter-spacing: -0.012em;
}

/* Icône de section : posée sur une pastille claire, elle situe la carte
   d'un coup d'œil sans alourdir le titre. */
h2 > .icon {
  flex: none;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0.45rem;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
}
h3 {
  margin: 1.4rem 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-head .lede {
  margin: 0;
  color: var(--text-muted);
  max-width: 46ch;
}

.muted {
  color: var(--text-muted);
}
.small {
  font-size: 0.84rem;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.grow {
  flex: 1;
  min-width: 0;
}

code,
.code-input {
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
}
code {
  font-size: 0.88em;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
code.big {
  font-size: 1rem;
  letter-spacing: 0.1em;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- cartes -- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card-narrow {
  max-width: 27rem;
  margin: clamp(1rem, 5vh, 3rem) auto;
  box-shadow: var(--shadow);
}
.card-narrow h1 {
  font-size: 1.45rem;
}

.card-logo {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--brand-soft);
}
.logo-card {
  font-size: 2.4rem;
}

.split {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 48rem) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

.centered {
  text-align: center;
}
.centered .actions-stack {
  align-items: stretch;
}

.state-icon {
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}
.state-icon.ok {
  color: var(--brand);
}
.state-icon.warn {
  color: var(--warn);
}

.empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r);
  background: var(--surface-2);
}

/* ----------------------------------------------------------- formulaires -- */

label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 550;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='tel'],
input[type='number'],
input[type='date'],
input:not([type]),
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--text-muted) 75%, transparent);
}

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border-strong));
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

/* Le focus clavier reste visible partout ailleurs. */
a:focus-visible,
button:focus-visible,
.dropzone:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

select {
  appearance: none;
  padding-right: 2.1rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 1.05rem center, right 0.8rem center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

.narrow {
  max-width: 7.5rem;
}
.code-input {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.85rem 0.9rem;
  margin: 0;
  background: var(--surface-2);
}
legend {
  padding: 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Rangée sélectionnable : bordure et fond changent au clic, pour qu'on voie
   ce qui est retenu sans avoir à chercher le petit rond noirci. */
label.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0.3rem 0;
  padding: 0.6rem 0.7rem;
  border: 1.5px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface);
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
label.check:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
}
label.check span {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
label.check input {
  width: auto;
  margin-top: 0.28rem;
  accent-color: var(--brand);
  flex: none;
}
label.check:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  font-weight: 550;
}

/* ------------------------------------------------- tuiles de choix ------- */
/* Un choix qui coûte quelque chose se présente comme un produit : une tuile
   cliquable, avec son icône, son intitulé et son prix bien lisible. Toute la
   tuile est cliquable — la case elle-même n'est plus la cible à viser. */

.choice-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1rem 0;
}

.choice {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  font-weight: 400;
  cursor: pointer;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-body {
  display: grid;
  gap: 0.35rem;
  height: 100%;
  padding: 1.1rem 1.15rem;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease),
    transform 0.12s var(--ease);
}
.choice:hover .choice-body {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.choice input:focus-visible + .choice-body {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.choice input:checked + .choice-body {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow);
}

/* Pastille de sélection, en haut à droite de la tuile cochée. */
.choice input:checked + .choice-body::after {
  content: '✓';
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.8rem;
  font-weight: 700;
}

.choice-icon .icon {
  width: 1.9rem;
  height: 1.9rem;
  color: var(--brand);
}
.choice input:checked + .choice-body .choice-icon .icon {
  color: var(--brand-hover);
}
.choice-title {
  font-weight: 620;
  letter-spacing: -0.01em;
  padding-right: 2rem;
}
.choice-price {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.choice-note {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.choice-wide {
  display: block;
  max-width: 26rem;
  margin: 1rem 0;
}

.row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}
.row-form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.stack {
  margin-top: 1.25rem;
}
.inline {
  display: inline-block;
}

.with-unit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.unit {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.settings-form .setting {
  display: grid;
  gap: 0.3rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.settings-form .setting:last-of-type {
  border-bottom: 0;
}
.settings-form .setting label {
  margin: 0;
  font-weight: 500;
}
@media (min-width: 42rem) {
  .settings-form .setting {
    grid-template-columns: 1fr 12rem;
    align-items: center;
    gap: 1.5rem;
  }
}

/* --------------------------------------------------------------- boutons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.58rem 1.1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
    transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--brand);
}
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

/* L'action décisive du parcours porte les deux tons : on ne la rate pas. */
.btn-duo {
  background: var(--duo);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 22px -12px var(--accent);
}
.btn-duo:hover {
  border-color: transparent;
  filter: saturate(1.1) brightness(1.05);
}

.btn-danger {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border-strong));
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.btn-small {
  padding: 0.32rem 0.7rem;
  font-size: 0.84rem;
}
.btn-big {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}
.btn-block {
  width: 100%;
  margin-top: 1.25rem;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-plain {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-plain.danger {
  color: var(--danger);
}
.btn-plain:hover {
  text-decoration-thickness: 2px;
}

form {
  margin: 0;
}
.action-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.actions-stack .btn {
  width: 100%;
}

/* --------------------------------------------------------------- alertes -- */

.alert {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid;
  border-radius: var(--r);
  font-size: 0.92rem;
}
.alert-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}
.alert-success {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok);
}
.alert-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn);
}
ul.alert {
  padding-left: 2.25rem;
}
ul.alert li {
  margin: 0.15rem 0;
}

/* -------------------------------------------------------------- tableaux -- */

.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  text-align: left;
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table thead th {
  padding-top: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom-color: var(--border-strong);
  white-space: nowrap;
}
.table tbody tr {
  transition: background 0.12s var(--ease);
}
.table tbody tr:hover {
  background: var(--surface-2);
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tr.row-attention td {
  background: color-mix(in srgb, var(--warn-bg) 70%, transparent);
}

/* Sur petit écran, chaque ligne devient une fiche lisible. */
@media (max-width: 46rem) {
  .table.stacked thead {
    display: none;
  }
  .table.stacked,
  .table.stacked tbody,
  .table.stacked tr,
  .table.stacked td {
    display: block;
    width: 100%;
  }
  .table.stacked tr {
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface-2);
  }
  .table.stacked td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--border);
    text-align: right;
  }
  .table.stacked tr td:last-child {
    border-bottom: 0;
  }
  .table.stacked td::before {
    content: attr(data-label);
    flex: none;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
  }
  .table.stacked td:empty {
    display: none;
  }
}

/* --------------------------------------------------------------- badges -- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 550;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
}

.badge-submitted,
.badge-pending {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn);
}
.badge-approved,
.badge-printed,
.badge-ready,
.badge-delivered,
.badge-paid,
.badge-active {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok);
}
.badge-rejected,
.badge-blocked,
.badge-unpaid,
.badge-cancelled {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

/* Suivi manuel : où en est réellement le travail. */
.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.flow li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.flow-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
}
.flow li.is-done .flow-dot,
.flow li.is-current .flow-dot {
  border-color: var(--brand);
  background: var(--brand);
}
.flow li.is-current {
  color: var(--brand);
  font-weight: 650;
}
/* La priorité est le seul badge en ambre : elle doit sauter aux yeux
   dans une liste de commandes. */
.badge-priority {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
}

.pill {
  display: inline-block;
  min-width: 1.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: var(--r-full);
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.72rem;
  font-weight: 650;
  text-align: center;
  line-height: 1.5;
}

/* --------------------------------------------------------- onglets & nav -- */

.tabs,
.subnav {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin: 0 0 1.5rem;
}
.subnav {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.tabs a,
.subnav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--r-full);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tabs a:hover,
.subnav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.tabs a.is-active,
.subnav a.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

/* --------------------------------------------------------------- totaux -- */

.totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1.5rem;
  margin: 1.25rem 0 1rem;
}
.totals dt {
  color: var(--text-muted);
  font-size: 0.92rem;
}
.totals dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.totals .grand {
  padding-top: 0.7rem;
  border-top: 2px solid var(--accent);
  font-size: 1.2rem;
  font-weight: 680;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Détail du total : les intitulés de section portent le regard,
   les formules restent en retrait. */
.breakdown td,
.breakdown th {
  padding: 0.45rem 0.5rem;
}
.breakdown .breakdown-head th {
  padding-top: 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.breakdown .breakdown-head td {
  font-weight: 600;
}
.breakdown .breakdown-head:first-child th,
.breakdown .breakdown-head:first-child td {
  padding-top: 0;
}
.breakdown .breakdown-label {
  word-break: break-word;
}
.breakdown .breakdown-detail {
  white-space: nowrap;
}
.breakdown tfoot th,
.breakdown tfoot td {
  padding-top: 0.8rem;
  border-top: 2px solid var(--border-strong);
  font-size: 1.1rem;
  font-weight: 660;
}

@media (max-width: 40rem) {
  .breakdown .breakdown-detail {
    white-space: normal;
  }
}

.quote {
  margin: 0.5rem 0;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface-2);
  color: var(--text-muted);
}
address {
  font-style: normal;
  color: var(--text-muted);
}

/* ---------------------------------------------------------- écran d'accès --
   Volontairement nu : ni tarifs, ni adresse, ni description du service.
   Le nom, et les deux portes d'entrée. */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(60vh, 30rem);
  padding: clamp(2rem, 7vw, 4.5rem) 0;
  text-align: center;
}

/* Le logo posé sur un disque clair : il respire au lieu de flotter. */
/* Disque en dégradé des deux tons, logo posé en blanc dessus. */
.hero-logo {
  display: grid;
  place-items: center;
  width: clamp(7rem, 22vw, 9.5rem);
  height: clamp(7rem, 22vw, 9.5rem);
  margin-bottom: 1.75rem;
  border-radius: 50%;
  background: var(--duo);
  box-shadow: 0 20px 45px -22px var(--brand);
}
.hero-logo .logo-body {
  fill: #ffffff;
}
.hero-logo .logo-paper {
  stroke: #ffffff;
  fill: color-mix(in srgb, #ffffff 92%, transparent);
}
.hero-logo .logo-lines {
  stroke: var(--accent-hover);
}
.hero-logo .logo-dot {
  fill: var(--brand);
}

.hero h1 {
  background: var(--duo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo-hero {
  font-size: clamp(4rem, 13vw, 5.5rem);
}

.hero h1 {
  font-size: clamp(2rem, 1.3rem + 3.4vw, 3.25rem);
  letter-spacing: -0.03em;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2.25rem;
}

/* ------------------------------------------------- constructeur de commande */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 2.25rem 1rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.dropzone:hover,
.dropzone.is-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropzone svg {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.35rem;
  color: var(--brand);
}
.dropzone strong {
  font-size: 1rem;
}

.items {
  display: grid;
  gap: 0.9rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.item {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.item-head {
  display: flex;
  gap: 0.5rem 0.85rem;
  align-items: baseline;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.item-name {
  flex: 1;
  min-width: 8rem;
  font-weight: 600;
  word-break: break-word;
}

.item-thumb {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  align-self: center;
}

.item-view {
  flex: none;
  font-size: 0.88rem;
}

/* auto-fit : quand le choix des pages disparaît (cas d'une image),
   les colonnes restantes se répartissent au lieu de laisser un trou. */
.item-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.item-note:empty {
  display: none;
}
.item-note {
  margin: 0.75rem 0 0;
}
.item-grid .numbers {
  display: grid;
  gap: 0.6rem;
  align-content: start;
}
.item-grid .numbers label {
  display: grid;
  gap: 0.25rem;
  margin: 0;
}
.pages-input {
  margin-top: 0.6rem;
}

.item-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.item-total {
  font-size: 1.05rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.item-error {
  margin: 0.75rem 0 0;
}

.order-form .card {
  scroll-margin-top: 5rem;
}

/* ------------------------------------------------------------- étapes -- */

.stepper {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  overflow-x: auto;
}
.stepper li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: max-content;
  padding: 0.55rem 0.75rem;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  white-space: nowrap;
}
.stepper li.is-reachable {
  cursor: pointer;
}
.stepper li.is-reachable:hover {
  background: var(--surface-2);
}
/* Étape en cours en ambre, étapes franchies en vert : d'un coup d'œil,
   on sait où on est et ce qui est déjà fait. */
.stepper li.is-current {
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 600;
}
.stepper li.is-current .stepper-num {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.stepper-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 0.78rem;
  font-weight: 650;
}
.stepper li.is-current .stepper-num {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.stepper li.is-done .stepper-num {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}
/* Étape franchie : le numéro cède la place à une coche. */
.stepper li.is-done .stepper-num {
  font-size: 0;
}
.stepper li.is-done .stepper-num::after {
  content: '✓';
  font-size: 0.8rem;
}

@media (max-width: 34rem) {
  .stepper li:not(.is-current) span:not(.stepper-num) {
    display: none;
  }
  .stepper li {
    flex: 0;
  }
  .stepper li.is-current {
    flex: 1;
  }
}

/* Barre de parcours : sur grand écran elle referme la carte ; sur téléphone
   elle se colle en bas, comme un panier — le total et le bouton suivant
   restent sous le pouce, sans avoir à faire défiler. */
.step-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.step-nav [data-next],
.step-nav [type='submit'] {
  margin-left: auto;
}
.step-total {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  color: var(--text);
}

@media (max-width: 40rem) {
  .order-form .step {
    padding-bottom: 0.5rem;
  }
  .step-nav {
    position: sticky;
    bottom: 0;
    z-index: 15;
    margin: 1.5rem -1.1rem -1.1rem;
    padding: 0.85rem 1.1rem;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 20px -16px rgba(16, 20, 28, 0.5);
  }
  .step-nav .btn {
    flex: 1;
  }
  .step-total {
    width: 100%;
    text-align: right;
  }
}
.step-nav .btn-big {
  margin-top: 0;
}

.review {
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}
.review li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.review li:last-child {
  border-bottom: 0;
}
.review-name {
  font-weight: 550;
  word-break: break-word;
}
.review .small {
  grid-column: 1;
}
.review-total {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
