/* ACCAAN Solutions - QRCode
   Disposition : deux colonnes alignées à gauche, les réglages d'un côté, le code sur sa feuille blanche de l'autre. */

@font-face { font-family: "Adventor"; font-weight: 700; font-style: normal; font-display: swap; src: url("polices/adventor-700.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("polices/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("polices/inter-600.woff") format("woff"); }

:root {
  --fond: #F3F4F8;
  --surface: #FFFFFF;
  --creux: #E7E9F1;
  --encre: #0B1020;
  --encre-2: #4A5166;
  --encre-3: #6B7187;
  --trait: #D9DCE7;
  --accent: #1433D6;
  --accent-encre: #FFFFFF;
  --accent-doux: #DFE5FD;
  --alerte: #9A4A06;
  --alerte-fond: #FCEFDD;
  --feuille: #FFFFFF;
  --feuille-encre: #4A5166;
  --damier: #E9EBF2;
  --ombre: 0 1px 2px rgba(11, 16, 32, .05), 0 18px 48px -12px rgba(11, 16, 32, .16);
  --ombre-pouce: 0 1px 2px rgba(11, 16, 32, .14);

  --titre: "Adventor", "Century Gothic", "Avenir Next", "Avenir", "Poppins", system-ui, sans-serif;
  --texte: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --t-petit: .8125rem;
  --t-base: .9375rem;
  --t-titre: 1.1875rem;
  --t-marque: 1.75rem;
  --rayon: 12px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0A0D17;
    --surface: #141828;
    --creux: #1A1F33;
    --encre: #EEF0F7;
    --encre-2: #AEB4C8;
    --encre-3: #868DA3;
    --trait: #282E45;
    --accent: #8A9DFF;
    --accent-encre: #0A0D17;
    --accent-doux: #1E2750;
    --alerte: #F4B271;
    --alerte-fond: #2E2114;
    --ombre: 0 1px 2px rgba(0, 0, 0, .5), 0 24px 60px -12px rgba(0, 0, 0, .6);
    --ombre-pouce: 0 1px 2px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #0A0D17;
  --surface: #141828;
  --creux: #1A1F33;
  --encre: #EEF0F7;
  --encre-2: #AEB4C8;
  --encre-3: #868DA3;
  --trait: #282E45;
  --accent: #8A9DFF;
  --accent-encre: #0A0D17;
  --accent-doux: #1E2750;
  --alerte: #F4B271;
  --alerte-fond: #2E2114;
  --ombre: 0 1px 2px rgba(0, 0, 0, .5), 0 24px 60px -12px rgba(0, 0, 0, .6);
  --ombre-pouce: 0 1px 2px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--texte);
  font-size: var(--t-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.page {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(16px, 5vw, 48px);
  padding-block: clamp(20px, 4vw, 44px) 32px;
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 5vw, 56px);
}

/* ---------- Marque ---------- */

.entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.marque { margin: 0; display: flex; align-items: center; gap: 14px; font-weight: 400; }
.vues { display: flex; gap: 24px; }
.vues a { padding-block: 6px; color: var(--encre-2); font-weight: 600; text-decoration: none; border-radius: 0; box-shadow: inset 0 -2px 0 transparent; transition: color .15s, box-shadow .15s; }
.vues a:hover { color: var(--encre); }
.vues a[aria-current="page"] { color: var(--encre); box-shadow: inset 0 -2px 0 var(--accent); }
.marque__signe { width: 40px; height: 40px; flex: none; fill: var(--accent); }
.marque__texte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.marque__maison { font-size: var(--t-petit); font-weight: 600; color: var(--encre-2); line-height: 1; letter-spacing: .01em; }
.marque__produit { font-family: var(--titre); font-weight: 700; font-size: var(--t-marque); line-height: .95; letter-spacing: -.02em; }

/* ---------- Grille ---------- */

.atelier {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "contenu" "apercu" "apparence";
  gap: 40px;
}
.bloc { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.bloc--contenu { grid-area: contenu; }
.bloc--apercu { grid-area: apercu; gap: 18px; }
.bloc--apparence { grid-area: apparence; }

@media (min-width: 56rem) {
  .atelier {
    grid-template-columns: minmax(0, 30rem) minmax(0, 27rem);
    grid-template-areas: "contenu apercu" "apparence apercu";
    grid-template-rows: auto 1fr;
    justify-content: space-between;
    column-gap: 48px;
    row-gap: 44px;
  }
  .bloc--apercu { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 28px); align-self: start; }
}

h2 {
  margin: 0;
  font-family: var(--titre);
  font-weight: 700;
  font-size: var(--t-titre);
  line-height: 1.2;
  letter-spacing: -.01em;
  text-wrap: balance;
}

/* ---------- Segments (choix exclusifs) ---------- */

.segments {
  display: flex;
  align-self: flex-start;
  max-width: 100%;
  padding: 3px;
  border-radius: 999px;
  background: var(--creux);
  overflow-x: auto;
  scrollbar-width: none;
}
.segments::-webkit-scrollbar { display: none; }
.segments--large { align-self: stretch; }
.segments input { position: absolute; opacity: 0; pointer-events: none; }
.segments label {
  flex: 1 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  text-align: center;
  font-size: var(--t-petit);
  font-weight: 600;
  line-height: 1.35;
  color: var(--encre-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.segments label:hover { color: var(--encre); }
.segments input:checked + label { background: var(--surface); color: var(--encre); box-shadow: var(--ombre-pouce); }
.segments input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Champs ---------- */

.champs { display: flex; flex-direction: column; gap: 14px; }
.champs__ligne { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.champs__ligne > .champ { flex: 1 1 12rem; }
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ label, .reglage label, .option__nom { font-size: var(--t-petit); font-weight: 600; color: var(--encre-2); }

input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="password"], textarea, select {
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--surface);
  color: var(--encre);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 5.5rem; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--encre-2) 50%), linear-gradient(135deg, var(--encre-2) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
input::placeholder, textarea::placeholder { color: var(--encre-3); opacity: 1; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-doux);
}
.aide { margin: 0; font-size: var(--t-petit); color: var(--encre-3); }

.case { display: flex; align-items: center; gap: 9px; padding-block: 12px; font-size: var(--t-base); cursor: pointer; flex: 0 0 auto; }
.case input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

/* ---------- Lien modifiable ---------- */

.modifiable { display: flex; flex-direction: column; gap: 4px; }
.modifiable .case { padding-block: 6px; align-self: flex-start; }
.modifiable__corps { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 16px; background: var(--creux); }
.modifiable__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.modifiable__actions .bouton--plein { flex: 0 0 auto; }
.modifiable .aide { color: var(--encre-2); overflow-wrap: anywhere; }
.modifiable .aide strong { color: var(--encre); font-weight: 600; }

/* ---------- Apparence ---------- */

.option { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: center; gap: 12px 16px; }
@media (max-width: 26rem) { .option { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

.formes { display: flex; gap: 8px; flex-wrap: wrap; }
.formes input { position: absolute; opacity: 0; pointer-events: none; }
.formes label {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 9px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--surface);
  font-size: var(--t-petit);
  font-weight: 600;
  color: var(--encre-2);
  cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s;
}
.formes svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.formes label:hover { color: var(--encre); }
.formes input:checked + label { border-color: var(--accent); background: var(--accent-doux); color: var(--encre); box-shadow: inset 0 0 0 1px var(--accent); }
.formes input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.pastilles { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pastilles > input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.pastilles label {
  position: relative;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--teinte, transparent);
  box-shadow: 0 0 0 1px var(--trait);
  cursor: pointer;
  transition: transform .15s;
}
.pastilles label:hover { transform: scale(1.08); }
.pastilles > input:checked + label { outline: 2px solid var(--accent); outline-offset: 3px; }
.pastilles > input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; box-shadow: 0 0 0 7px var(--accent-doux); }
.pastilles label.pastille-libre { background: conic-gradient(#E5484D, #F5A524, #3DD68C, #3E63DD, #8E4EC6, #E5484D); overflow: hidden; }
.pastille-libre input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.pastilles > input:checked + label.pastille-libre { background: var(--teinte); }

.logo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo__vignette { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: var(--feuille); border: 1px solid var(--trait); padding: 3px; }

/* ---------- Boutons ---------- */

.bouton {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--trait);
  border-radius: 999px;
  background: var(--surface);
  color: var(--encre);
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s, opacity .15s;
}
.bouton:hover { border-color: var(--encre-3); }
.bouton:active { transform: translateY(1px); }
.bouton:focus-visible, .lien:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.bouton--plein { flex: 1 1 auto; border-color: var(--accent); background: var(--accent); color: var(--accent-encre); }
.bouton--plein:hover { border-color: var(--accent); filter: brightness(1.08); }
.bouton--petit { padding: 8px 15px; font-size: var(--t-petit); }
.bouton:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
@media (max-width: 26rem) { .actions .bouton { padding-inline: 15px; } }
#logo-fichier:focus-visible + .lien, #logo-fichier:focus-visible ~ .bouton { outline: 2px solid var(--accent); outline-offset: 3px; }

.lien, a { color: var(--accent); font: inherit; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; border-radius: 4px; }
.lien { font-size: var(--t-petit); text-align: left; }

/* ---------- Aperçu ---------- */

.feuille {
  position: relative;
  width: 100%;
  max-width: 27rem;
  aspect-ratio: 1;
  margin-inline: auto;
  padding: 3.5%;
  border-radius: 28px;
  background: var(--feuille);
  box-shadow: var(--ombre);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.feuille[data-fond="transparent"] {
  background-color: var(--feuille);
  background-image: conic-gradient(var(--damier) 25%, transparent 0 50%, var(--damier) 0 75%, transparent 0);
  background-size: 22px 22px;
}
.feuille__code { width: 100%; height: 100%; }
.feuille__code:empty { display: none; }
.feuille__code svg { display: block; width: 100%; height: 100%; }
.feuille__vide { margin: 0; max-width: 16rem; text-align: center; color: var(--feuille-encre); font-size: var(--t-base); text-wrap: balance; }

.alerte { margin: 0; padding: 10px 14px; border-radius: var(--rayon); background: var(--alerte-fond); color: var(--alerte); font-size: var(--t-petit); font-weight: 600; }

.mesures { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mesures div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mesures dt { font-size: .75rem; color: var(--encre-3); }
.mesures dd { margin: 0; font-size: var(--t-base); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.reglage { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reglage select { width: auto; padding-block: 8px; font-size: var(--t-base); }

/* ---------- Mes codes ---------- */

.bibliotheque { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.bibliotheque__tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; }
.bibliotheque__outils { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.bibliotheque__vide { margin: 0; max-width: 34rem; color: var(--encre-2); }
.codes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--trait); }
.code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 15.5rem;
  align-items: center;
  gap: 14px 32px;
  padding-block: 18px;
  border-bottom: 1px solid var(--trait);
}
.code__texte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.code__nom { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }
.code__type { padding: 2px 9px; border-radius: 999px; background: var(--creux); color: var(--encre-2); font-size: .75rem; font-weight: 600; }
.code__etat { padding: 2px 9px; border-radius: 999px; background: var(--alerte-fond); color: var(--alerte); font-size: .75rem; font-weight: 600; }
.code__cible, .code__court { font-size: var(--t-petit); color: var(--encre-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code__court { color: var(--encre-3); }
.code__scans { margin: 0; display: grid; grid-template-columns: 4.5rem 4.5rem 7rem; gap: 16px; }
.code__scans div { display: flex; flex-direction: column; gap: 2px; }
.code__scans dt { font-size: .75rem; color: var(--encre-3); }
.code__scans dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.code__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.code[data-inactif] .code__nom span:first-child, .code[data-inactif] .code__cible { color: var(--encre-3); }
@media (max-width: 52rem) { .code { grid-template-columns: minmax(0, 1fr); gap: 12px; } }

/* ---------- Connexion ---------- */

.dialogue {
  width: min(26rem, calc(100% - 32px));
  padding: 26px;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  color: var(--encre);
  box-shadow: var(--ombre);
}
.dialogue::backdrop { background: rgba(11, 16, 32, .5); }
.dialogue form { display: flex; flex-direction: column; gap: 16px; }
.dialogue__texte { margin: 0; color: var(--encre-2); }
.dialogue__actions { display: flex; justify-content: flex-end; gap: 10px; }
.dialogue__actions .bouton--plein { flex: 0 0 auto; }

/* ---------- Pied ---------- */

.pied {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--trait);
  font-size: var(--t-petit);
  color: var(--encre-3);
}
.pied p { margin: 0; }
.pied__version { display: flex; gap: 14px; }

/* ---------- Message bref ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--encre);
  color: var(--fond);
  font-size: var(--t-petit);
  font-weight: 600;
  box-shadow: var(--ombre);
  animation: monter .22s ease-out;
  z-index: 10;
}
@keyframes monter { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

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