/* Campagne 108 — charte « Violet minimal » (rouge réservé aux alertes) */
:root {
  --bg: #F6F5FB;
  --surface: #FFFFFF;
  --surface-2: #F8F7FD;
  --border: #ECE9F5;
  --border-strong: #CFC8EC;
  --text: #1E1B2E;
  --text-2: #4A4760;
  --muted: #6B6880;
  --primary: #5B3FD9;
  --primary-hover: #4428B8;
  --primary-soft: #EEEAFE;
  --on-primary: #FFFFFF;
  --ok: #2E7D5B;
  --danger: #C2362F;
  --danger-soft: #FCE9E7;
  --focus: rgba(91, 63, 217, .35);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(30, 27, 46, .04);

  --s-a_contacter-bg: #EEEAFE; --s-a_contacter-fg: #4428B8;
  --s-contacte-bg: #E6F0FB;    --s-contacte-fg: #1F5A96;
  --s-interesse-bg: #E5F4EC;   --s-interesse-fg: #226447;
  --s-rdv_fixe-bg: #DFF3EE;    --s-rdv_fixe-fg: #11604F;
  --s-pas_interesse-bg: #EFEEF3; --s-pas_interesse-fg: #55536A;
  --s-injoignable-bg: #FCEFDD; --s-injoignable-fg: #8A4B0C;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121019; --surface: #1B1824; --surface-2: #221E2D; --border: #2E2A3B; --border-strong: #3B3650;
    --text: #EDEBF5; --text-2: #C4C0D6; --muted: #9A96AE;
    --primary: #8C74FF; --primary-hover: #A493FF; --primary-soft: #2A2445; --on-primary: #120E24;
    --ok: #5CC491; --danger: #FF6B61; --danger-soft: #3A1D1B; --focus: rgba(140, 116, 255, .45);
    --s-a_contacter-bg: #2A2445; --s-a_contacter-fg: #BBA9FF;
    --s-contacte-bg: #1C2A3B;    --s-contacte-fg: #8FC0F2;
    --s-interesse-bg: #19302A;   --s-interesse-fg: #7FD6A8;
    --s-rdv_fixe-bg: #163330;    --s-rdv_fixe-fg: #6FD9C2;
    --s-pas_interesse-bg: #2A2834; --s-pas_interesse-fg: #B3B0C4;
    --s-injoignable-bg: #3A2A16; --s-injoignable-fg: #F2B66B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121019; --surface: #1B1824; --surface-2: #221E2D; --border: #2E2A3B; --border-strong: #3B3650;
  --text: #EDEBF5; --text-2: #C4C0D6; --muted: #9A96AE;
  --primary: #8C74FF; --primary-hover: #A493FF; --primary-soft: #2A2445; --on-primary: #120E24;
  --ok: #5CC491; --danger: #FF6B61; --danger-soft: #3A1D1B; --focus: rgba(140, 116, 255, .45);
  --s-a_contacter-bg: #2A2445; --s-a_contacter-fg: #BBA9FF;
  --s-contacte-bg: #1C2A3B;    --s-contacte-fg: #8FC0F2;
  --s-interesse-bg: #19302A;   --s-interesse-fg: #7FD6A8;
  --s-rdv_fixe-bg: #163330;    --s-rdv_fixe-fg: #6FD9C2;
  --s-pas_interesse-bg: #2A2834; --s-pas_interesse-fg: #B3B0C4;
  --s-injoignable-bg: #3A2A16; --s-injoignable-fg: #F2B66B;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: clamp(22px, 4vw, 30px); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 600; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Champs */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .field > legend { font-size: 13px; font-weight: 500; color: var(--text-2); padding: 0; margin-bottom: 6px; }
fieldset.field > legend { float: left; width: 100%; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
}
textarea { padding: 10px 12px; min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
input[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: 12px; color: var(--muted); min-height: 0; }
.hint.ok { color: var(--ok); }
.hint.err, .err-text { color: var(--danger); }

.seg { display: flex; flex-wrap: wrap; gap: 8px; clear: both; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 14px;
}
.seg input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus); }

/* Cartes & sections */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); min-width: 0; }
details.card { padding: 0; gap: 0; }
details.card > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 18px 20px; font-weight: 600; font-size: 16px;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 400; font-size: 20px; }
details.card[open] > summary::after { content: "–"; }
details.card > .body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.num { width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.done { font-size: 12px; font-weight: 500; color: var(--ok); }

.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge[data-s] { background: var(--s-bg); color: var(--s-fg); }
.badge-alert { background: var(--danger-soft); color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s-fg, var(--primary)); flex: none; }
[data-s="a_contacter"] { --s-bg: var(--s-a_contacter-bg); --s-fg: var(--s-a_contacter-fg); }
[data-s="contacte"] { --s-bg: var(--s-contacte-bg); --s-fg: var(--s-contacte-fg); }
[data-s="interesse"] { --s-bg: var(--s-interesse-bg); --s-fg: var(--s-interesse-fg); }
[data-s="rdv_fixe"] { --s-bg: var(--s-rdv_fixe-bg); --s-fg: var(--s-rdv_fixe-fg); }
[data-s="pas_interesse"] { --s-bg: var(--s-pas_interesse-bg); --s-fg: var(--s-pas_interesse-fg); }
[data-s="injoignable"] { --s-bg: var(--s-injoignable-bg); --s-fg: var(--s-injoignable-fg); }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.alert-err { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--s-interesse-bg); color: var(--s-interesse-fg); }

/* Formulaire public */
.public { max-width: 780px; margin: 0 auto; padding: 32px 16px 120px; display: flex; flex-direction: column; gap: 16px; }
.tag { align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); background: var(--primary-soft); padding: 6px 10px; border-radius: 999px; }
.lead { margin: 0; color: var(--muted); }
.progress { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.progress .bar { flex: 1; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress .bar > i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .2s; }
.actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 20px 0 12px; }
.small { font-size: 12px; color: var(--muted); }

.files { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.drop { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--surface); min-width: 0; }
.drop.has { border-style: solid; background: var(--surface-2); }
.drop strong { font-size: 14px; }
.drop .add { align-self: flex-start; font-size: 14px; color: var(--primary); font-weight: 500; cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; }
.drop input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumb { position: relative; width: 56px; height: 56px; border-radius: 8px; background: var(--primary-soft); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--text-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }
.cf-turnstile { min-height: 65px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; }
.logo { width: 40px; height: 40px; border-radius: 11px; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* Back office */
.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; color: var(--text); }
.brand .logo { width: 32px; height: 32px; font-size: 12px; border-radius: 9px; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.main { max-width: 1240px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.head .actions { justify-content: flex-start; }

.relances { display: flex; gap: 10px; flex-wrap: wrap; }
.relance { flex: 1 1 240px; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); text-decoration: none; color: var(--text); min-width: 0; }
.relance:hover { border-color: var(--primary); color: var(--text); }
.relance .meta { font-size: 13px; color: var(--muted); }
.relance.late .meta { color: var(--danger); font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.stat b { font-size: 24px; }
.stat span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.stat[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters input { flex: 1 1 280px; }
.filters select { flex: 0 1 200px; width: auto; }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 0; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); white-space: nowrap; }
th button { all: unset; display: block; padding: 12px 16px; cursor: pointer; }
th button:focus-visible { outline: 3px solid var(--focus); }
td { font-size: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
td a { color: var(--text); font-weight: 600; text-decoration: none; }
.late-text { color: var(--danger); font-weight: 500; }
.today-text { color: var(--primary); font-weight: 500; }
.cards { display: none; flex-direction: column; gap: 10px; }
.pcard { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-decoration: none; color: var(--text); }
.pcard .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pcard .top b { overflow-wrap: anywhere; }
.pcard .meta { font-size: 13px; color: var(--muted); }
.empty { padding: 32px; text-align: center; color: var(--muted); }

.fiche { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.fiche > .col { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.fiche > aside { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery a { display: flex; flex-direction: column; gap: 4px; width: 104px; text-decoration: none; color: var(--text-2); font-size: 11px; }
.gallery .g { width: 104px; height: 104px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.histo { display: flex; flex-direction: column; }
.histo .it { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.histo .it .badge { background: var(--primary-soft); color: var(--primary); align-self: flex-start; }
.histo .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.add-echange { display: flex; gap: 8px; flex-wrap: wrap; }
.add-echange select { width: auto; flex: 0 0 auto; }
.add-echange input { flex: 1 1 220px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 10; max-width: calc(100vw - 32px); }

@media (max-width: 760px) {
  .topbar { padding: 12px 16px; }
  .main { padding: 16px; }
  .table-wrap { display: none; }
  .cards { display: flex; }
  .filters select { flex: 1 1 140px; }
  .fiche > aside { position: static; }
  .card { padding: 16px; }
}

/* ================= Formulaire public : relief « Style 2026 » ================= */
:root {
  --grad: linear-gradient(135deg, #3B22B8 0%, #5B3FD9 48%, #8C6BFF 100%);
  --lift: 0 1px 2px rgba(30, 27, 46, .05), 0 12px 32px -14px rgba(59, 34, 184, .22);
  --lift-strong: 0 2px 4px rgba(30, 27, 46, .06), 0 22px 44px -18px rgba(59, 34, 184, .38);
}
.stack { display: flex; flex-direction: column; gap: 16px; }
body:is(.pub, .bo) {
  background:
    radial-gradient(1100px 560px at 105% -10%, rgba(140, 107, 255, .20), transparent 60%),
    radial-gradient(900px 520px at -15% 20%, rgba(91, 63, 217, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
:is(.pub, .bo) .public { gap: 20px; }

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 12px;
  padding: 32px 28px; border-radius: 24px; color: #fff;
  background: var(--grad);
  box-shadow: 0 24px 48px -22px rgba(59, 34, 184, .65);
}
.hero::before {
  content: ""; position: absolute; inset: -60%; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(255, 255, 255, .22) 70%, transparent 85%);
  animation: c108-spin 16s linear infinite;
}
.hero::after {
  content: ""; position: absolute; width: 320px; height: 320px; right: -80px; top: -120px; z-index: -1;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 65%);
}
.hero h1 { color: #fff; }
.hero .tag { color: #fff; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(6px); }
.hero .lead { color: rgba(255, 255, 255, .88); max-width: 60ch; }
.hero .progress { color: rgba(255, 255, 255, .9); margin-top: 4px; }
.hero .progress .bar { background: rgba(255, 255, 255, .22); height: 8px; }
.hero .progress .bar > i { background: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, .7); }
@keyframes c108-spin { to { transform: rotate(360deg); } }

:is(.pub, .bo) .card {
  border: 1px solid rgba(91, 63, 217, .08);
  box-shadow: var(--lift);
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
:is(.pub, .bo) details.card:hover { transform: translateY(-2px); box-shadow: var(--lift-strong); }
:is(.pub, .bo) details.card[open] { border-color: rgba(91, 63, 217, .22); box-shadow: var(--lift-strong); }
:is(.pub, .bo) details.card > summary { border-radius: var(--radius); transition: background .2s; }
:is(.pub, .bo) details.card > summary:hover { background: var(--surface-2); }
:is(.pub, .bo) details.card[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; margin-bottom: 18px; }
:is(.pub, .bo) details.card > summary::after {
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-size: 18px; transition: transform .25s;
}
:is(.pub, .bo) details.card[open] > summary::after { transform: rotate(180deg); }

:is(.pub, .bo) .num {
  width: 32px; height: 32px; border-radius: 10px; color: #fff; background: var(--grad);
  box-shadow: 0 6px 14px -6px rgba(91, 63, 217, .7);
}

:is(.pub, .bo) input:not([type="radio"]):not([type="file"]), :is(.pub, .bo) select, :is(.pub, .bo) textarea {
  background: var(--surface); border: 1.5px solid #CFC8EC;
  box-shadow: inset 0 1px 2px rgba(30, 27, 46, .06);
  transition: background .2s, border-color .2s, box-shadow .2s;
}
:is(.pub, .bo) input:not([type="radio"]):not([type="file"]):hover { border-color: #A99CE6; }
:is(.pub, .bo) input:not([type="radio"]):not([type="file"]):focus {
  background: var(--surface); border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus), 0 8px 20px -12px rgba(91, 63, 217, .5);
}
:is(.pub, .bo) input[aria-invalid="true"] { border-color: var(--danger) !important; }

:is(.pub, .bo) .seg span { background: var(--surface); border: 1.5px solid #CFC8EC; transition: all .2s; }
:is(.pub, .bo) .seg span:hover { border-color: var(--primary); color: var(--text); }
:is(.pub, .bo) .seg input:checked + span {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px -8px rgba(91, 63, 217, .75);
}

:is(.pub, .bo) .drop { border-color: var(--border-strong); background: var(--surface-2); transition: border-color .2s, background .2s, transform .2s; }
:is(.pub, .bo) .drop:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
:is(.pub, .bo) .drop.has { border-color: rgba(91, 63, 217, .3); background: var(--surface); box-shadow: var(--lift); }

:is(.pub, .bo) .sticky-actions {
  position: sticky; bottom: 12px; margin-top: 8px; padding: 16px 18px;
  background: rgba(255, 255, 255, .72); border: 1px solid rgba(91, 63, 217, .14); border-radius: 20px;
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: var(--lift-strong);
}
:is(.pub, .bo) .btn { transition: transform .15s, box-shadow .2s, background .2s; }
:is(.pub, .bo) .btn-primary { background: var(--grad); border: 0; box-shadow: 0 10px 22px -10px rgba(91, 63, 217, .8); }
:is(.pub, .bo) .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(91, 63, 217, .9); }
:is(.pub, .bo) .btn-primary:active { transform: translateY(0); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.pub, .bo) .sticky-actions { background: rgba(27, 24, 36, .72); }
  :root:not([data-theme="light"]) body:is(.pub, .bo) { background: radial-gradient(1100px 560px at 105% -10%, rgba(140, 107, 255, .16), transparent 60%), var(--bg); }
}
:root[data-theme="dark"] :is(.pub, .bo) .sticky-actions { background: rgba(27, 24, 36, .72); }

@media (max-width: 760px) {
  .hero { padding: 24px 20px; border-radius: 20px; }
  :is(.pub, .bo) .sticky-actions { bottom: 8px; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  :is(.pub, .bo) .card, :is(.pub, .bo) .drop, :is(.pub, .bo) .btn { transition: none; }
  :is(.pub, .bo) details.card:hover, :is(.pub, .bo) .drop:hover { transform: none; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.pub, .bo) input:not([type="radio"]):not([type="file"]),
  :root:not([data-theme="light"]) :is(.pub, .bo) .seg span { border-color: #4A4466; }
}
:root[data-theme="dark"] :is(.pub, .bo) input:not([type="radio"]):not([type="file"]),
:root[data-theme="dark"] :is(.pub, .bo) .seg span { border-color: #4A4466; }

/* ================= Back office : relief ================= */
.m0 { margin: 0; }
.self-start { align-self: flex-start; }
.th { display: block; padding: 12px 16px; }
.row-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-title .late-text { font-size: 13px; }
.back { font-size: 14px; text-decoration: none; font-weight: 500; }
.title-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.title-block h1 { overflow-wrap: anywhere; }
.title-block .small { font-size: 14px; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }

.bo .topbar {
  position: sticky; top: 0; z-index: 5; border: 0; color: #fff;
  background: var(--grad); box-shadow: 0 10px 30px -14px rgba(59, 34, 184, .7);
  overflow: hidden; isolation: isolate;
}
.bo .topbar::before {
  content: ""; position: absolute; inset: -200% -10%; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 60%, rgba(255, 255, 255, .18) 72%, transparent 85%);
  animation: c108-spin 18s linear infinite;
}
.bo .brand { color: #fff; }
.bo .brand .logo { background: #fff; color: var(--primary); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .3); }
.bo .who { color: rgba(255, 255, 255, .85); }
.bo .topbar .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: #fff; }
.bo .topbar .btn:hover { background: rgba(255, 255, 255, .24); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; margin-left: 16px; }
.nav a { color: rgba(255, 255, 255, .85); text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 999px; min-height: 36px; display: inline-flex; align-items: center; }
.nav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--primary); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .25); }

.bo .stat { box-shadow: var(--lift); border-color: rgba(91, 63, 217, .08); transition: transform .2s, box-shadow .2s; position: relative; overflow: hidden; }
.bo .stat::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--s-fg); opacity: .7; }
.bo .stat:hover { transform: translateY(-2px); box-shadow: var(--lift-strong); }
.bo .stat b { font-size: 28px; letter-spacing: -.02em; }
.bo .stat[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--primary), var(--lift-strong); }

.bo .table-wrap { box-shadow: var(--lift); border-color: rgba(91, 63, 217, .08); }
.bo .table-wrap.flat { box-shadow: none; }
.bo thead th { background: var(--surface-2); }
.bo tbody tr { transition: background .15s; }
.bo .pcard { box-shadow: var(--lift); transition: transform .2s, box-shadow .2s; }
.bo .pcard:hover, .bo .relance:hover { transform: translateY(-2px); box-shadow: var(--lift-strong); }
.bo .relance { background: var(--surface); box-shadow: var(--lift); transition: transform .2s, box-shadow .2s; }
.bo .relance.late { box-shadow: inset 3px 0 0 var(--danger), var(--lift); }
.bo .card:hover { box-shadow: var(--lift-strong); }
.bo .histo .it .badge { background: var(--grad); color: #fff; }

/* Photos back office */
.doc-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.doc-cat { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.doc-cat.has { background: var(--surface); border-color: rgba(91, 63, 217, .2); box-shadow: var(--lift); }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.doc-cat .gallery { gap: 8px; }
.g-item { position: relative; width: 76px; height: 76px; }
.g-item .g { width: 76px; height: 76px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; overflow: hidden; text-decoration: none; box-shadow: 0 4px 10px -6px rgba(30, 27, 46, .4); }
.g-item img { width: 100%; height: 100%; object-fit: cover; }
.g-del { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid var(--surface); background: var(--danger); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; opacity: .9; }
.g-del:hover { opacity: 1; transform: scale(1.08); }
.g-add { position: relative; width: 76px; height: 76px; border-radius: 10px; border: 1.5px dashed #B9B0E0; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 26px; cursor: pointer; transition: background .2s, border-color .2s; }
.g-add:hover { background: var(--primary-soft); border-color: var(--primary); }
.g-add input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.g-add:focus-within { box-shadow: 0 0 0 3px var(--focus); }

/* Comptes */
.pwd { display: flex; gap: 8px; flex-wrap: wrap; }
.pwd input { flex: 1 1 160px; }
.dlg { width: min(440px, calc(100vw - 32px)); border: 0; padding: 22px; }
.dlg::backdrop { background: rgba(18, 16, 25, .5); backdrop-filter: blur(3px); }
.dlg form { display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 760px) {
  .nav { order: 3; width: 100%; margin: 0; }
  .bo .topbar { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .bo .topbar::before { animation: none; }
  .bo .stat, .bo .pcard, .bo .relance { transition: none; }
}
.dlg:not([open]) { display: none; }
.dlg[open] { position: fixed; inset: 0; margin: auto; height: fit-content; z-index: 20; }
