/* Udhibiti LivePost : pensé d'abord pour le téléphone. Couleurs : bleu ciel, jaune et rouge, comme le drapeau de la RDC. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #12151c;
  --muted: #5b6475;
  --line: #e2e6ef;
  --primary: #0b5fb4;
  --primary-strong: #084a8d;
  --primary-soft: #e5f0fc;
  --accent: #f7c531;
  --accent-soft: #fff6da;
  --danger: #c8102e;
  --danger-soft: #fdecee;
  --ok: #137a3a;
  --ok-soft: #e6f6ec;
  --dark: #121212;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1117;
    --surface: #171b23;
    --text: #eef1f6;
    --muted: #a3acbb;
    --line: #2a303b;
    --primary: #4ea3f5;
    --primary-strong: #7cbcf8;
    --primary-soft: #14273d;
    --accent: #f7c531;
    --accent-soft: #2e2711;
    --danger: #ff6b7f;
    --danger-soft: #3a1219;
    --ok: #52c47c;
    --ok-soft: #12301f;
    --dark: #f2f2f2;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
img, video { max-width: 100%; }
a { color: var(--primary); text-underline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 1.2rem 0 .8rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .7rem; }
p { margin: 0 0 .8rem; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.hp { position: absolute; left: -9999px; }
.inline { display: inline; margin: 0; }
.count { display: inline-block; min-width: 1.6em; padding: 0 .45em; border-radius: 99px; background: var(--primary-soft); color: var(--primary-strong); font-size: .8rem; text-align: center; vertical-align: middle; }
[hidden] { display: none !important; }

/* Bandeaux */
.demo-bar { background: var(--accent); color: #2b2100; text-align: center; font-size: .85rem; font-weight: 600; padding: 6px 12px; }
.announce { background: var(--primary); color: #fff; text-align: center; font-size: .9rem; padding: 8px 12px; }

/* En-tête */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 1.05rem; white-space: nowrap; }
.brand b { color: var(--primary); }
.brand small { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-left: 2px; }
.top-nav { display: flex; align-items: center; gap: 14px; }
.top-nav a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.top-nav a[aria-current] { color: var(--text); }
@media (max-width: 479px) { .top-nav .nav-text { display: none; } }   /* sur téléphone : le logo mène déjà au tableau */
.admin-nav { border-top: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-nav-in { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.admin-nav a { display: inline-block; padding: 10px 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; }
.admin-nav a[aria-current] { color: var(--primary); border-bottom-color: var(--primary); }
.admin-nav form { margin-left: auto; }
.area-admin .wrap { max-width: 1100px; }

/* Pied de page */
.foot { margin-top: 48px; padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.foot nav a { font-weight: 600; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .05s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-dark { background: var(--dark); border-color: var(--dark); color: var(--bg); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn-big { min-height: 54px; font-size: 1.05rem; padding: 14px 22px; }
.btn-block { display: flex; width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: var(--danger); }
.row, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Messages */
.flash { margin: 16px 0; padding: 12px 14px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--primary-soft); color: var(--primary-strong); }
.notice { margin: 14px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.notice p:last-child { margin-bottom: 0; }
.notice-warn { background: var(--accent-soft); border-color: transparent; }
.notice-info { background: var(--primary-soft); border-color: transparent; }
.notice-error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.error-text { color: var(--danger); font-weight: 600; }

/* Cartes et blocs */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 16px 0; box-shadow: var(--shadow); }
.card.narrow { max-width: 440px; margin: 28px auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.block { margin: 26px 0; }
.empty { text-align: center; padding: 36px 8px; }

/* Formulaires (16 px : l'iPhone ne zoome pas) */
.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field > label:not(.check):not(.switch), .field > legend, .when-later label { display: block; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); margin-top: 6px; font-size: .85rem; }
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
input[readonly] { color: var(--muted); }
.two { display: grid; gap: 0 14px; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
.check-block { display: flex; margin-bottom: 8px; }
.check.is-off { opacity: .5; cursor: not-allowed; }
.checks-row { display: flex; flex-wrap: wrap; gap: 8px; }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { flex: none; width: 48px; height: 28px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; margin-top: 2px; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--primary); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Pastilles d'état */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: var(--line); color: var(--text); }
.badge-wait { background: var(--accent-soft); color: #7a5a00; }
.badge-progress { background: var(--primary-soft); color: var(--primary-strong); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-error { background: var(--danger-soft); color: var(--danger); }
.badge-muted { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .badge-wait { color: var(--accent); }
  .btn-primary, .btn-primary:hover, .filters a[aria-current], .how-steps li::before, .steps li[aria-current] b, .steps li.done b { color: #06121f; }
  .btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
}

/* Photo de profil */
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 34px; height: 34px; font-size: .85rem; }
.avatar.lg { width: 60px; height: 60px; font-size: 1.4rem; }
.account { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.small-account { margin: 0; }

/* Accueil */
.hero { padding: 28px 0 8px; }
.eyebrow { color: var(--primary); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.hero h1 { font-size: 2.05rem; margin-top: .4rem; }
.hero h1 span { color: var(--primary); }
.lead { font-size: 1.1rem; color: var(--muted); }
.how, .for-who, .trust { margin: 36px 0; }
.how-steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 10px; }
.how-steps li { counter-increment: s; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 14px 60px; }
.how-steps li::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.how-steps b, .cards-4 b { display: block; }
.how-steps span, .cards-4 span { color: var(--muted); font-size: .95rem; }
.cards-4 { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cards-4 li { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 14px; }
.checks { list-style: none; padding: 0; margin: 0 0 18px; }
.checks li { position: relative; padding: 6px 0 6px 30px; }
.checks li::before { content: "✓"; position: absolute; left: 4px; top: 6px; color: var(--ok); font-weight: 800; }

/* Tableau du créateur */
.hello { display: flex; align-items: center; gap: 14px; margin: 20px 0 16px; }
.hello h1 { margin: 0 0 2px; font-size: 1.4rem; }
.hello p { margin: 0; font-size: .9rem; }
.post-list { display: grid; gap: 10px; }
.post-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.post-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.post-card .caption { margin: 0 0 4px; overflow-wrap: anywhere; }
.post-card .detail { margin: 0; color: var(--muted); font-size: .92rem; }
.card-link { display: inline-block; margin-top: 8px; font-weight: 600; font-size: .92rem; }
.card-link::after { content: ""; position: absolute; inset: 0; }
.video-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.video-row b { display: block; overflow-wrap: anywhere; }
.detail.big { font-size: 1.05rem; color: var(--text); }
.facts { display: grid; grid-template-columns: 1fr; gap: 2px 14px; margin: 16px 0; }
.facts dt { font-weight: 700; font-size: .85rem; color: var(--muted); margin-top: 10px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }

/* Étapes */
.steps { list-style: none; padding: 0; margin: 0 0 18px; display: flex; gap: 6px; font-size: .82rem; color: var(--muted); }
.steps li { flex: 1; padding-top: 8px; border-top: 4px solid var(--line); }
.steps li b { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; background: var(--line); color: var(--text); font-size: .75rem; margin-right: 2px; }
.steps li[aria-current], .steps li.done { color: var(--text); border-top-color: var(--primary); font-weight: 600; }
.steps li[aria-current] b, .steps li.done b { background: var(--primary); color: #fff; }

/* Envoi de la vidéo */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 190px; padding: 24px 16px; border: 2px dashed var(--primary); border-radius: 18px; background: var(--primary-soft); cursor: pointer; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; }
.drop-icon { font-size: 2.4rem; line-height: 1; }
.drop-title { font-size: 1.2rem; font-weight: 700; color: var(--primary-strong); }
.progress-box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; box-shadow: var(--shadow); }
.file-name { font-weight: 700; overflow-wrap: anywhere; }
.bar { height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 10px 0; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #1e88e5); border-radius: 99px; transition: width .3s; }
.progress-box.is-done .bar span { background: var(--ok); }
.progress-box.is-waiting .bar span { background: var(--accent); }
.tips { margin: 18px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: .92rem; }
.tips p:last-child { margin: 0; }

/* Écran de publication */
.post-screen .notice { margin-top: 0; }
.post-grid { display: grid; gap: 18px; }
.post-preview video { display: block; width: 100%; max-height: 48vh; background: #000; border-radius: var(--radius); }
@media (min-width: 900px) { .post-preview video { max-height: 70vh; } }
.post-preview p { margin-top: 6px; overflow-wrap: anywhere; }
.disclose { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.disclose-opts { margin-top: 14px; padding-left: 12px; border-left: 3px solid var(--line); }
.disclose-need { color: var(--danger); font-weight: 600; }
.disclose-promo, .disclose-paid { font-weight: 600; color: var(--primary-strong); }
.when-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 10px; }
.when-later { margin-top: 6px; }
.declare { font-size: .9rem; color: var(--muted); }
.submit-row { display: grid; gap: 10px; margin-top: 8px; }
.submit-row p { margin: 0; text-align: center; }
/* avec JavaScript : seules les explications utiles restent visibles */
.js .post-screen .disclose-opts, .js .post-screen .disclose-need, .js .post-screen .disclose-promo, .js .post-screen .disclose-paid,
.js .post-screen .only-branded, .js .post-screen .declare-branded, .js .post-screen .when-later { display: none; }
.js .post-screen.is-disclose .disclose-opts, .js .post-screen.needs-choice .disclose-need, .js .post-screen.is-organic:not(.is-branded) .disclose-promo,
.js .post-screen.is-branded .disclose-paid, .js .post-screen.is-branded .only-branded, .js .post-screen.is-branded .declare-branded { display: block; }
.js .post-screen.is-later .when-later { display: block; }
.js .post-screen.is-branded .declare-music { display: none; }

/* Administration */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.tile b { font-size: 1.7rem; line-height: 1.1; }
.tile-label { font-weight: 600; font-size: .85rem; color: var(--muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.is-blocked td { opacity: .6; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.filters a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 600; font-size: .88rem; }
.filters a[aria-current] { background: var(--primary); border-color: var(--primary); color: #fff; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.log-error { border-left: 3px solid var(--danger); padding-left: 10px !important; }
.log-warning { border-left: 3px solid var(--accent); padding-left: 10px !important; }
.message.is-unread { border-left: 4px solid var(--primary); }
.forgot { margin-top: 14px; text-align: center; }
.debug { text-align: left; white-space: pre-wrap; font-size: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; }

/* Pages légales */
.legal { max-width: 680px; }
.legal h2 { margin-top: 1.8rem; }
.legal li { margin-bottom: .45rem; }
.fake-consent { max-width: 520px; margin: 28px auto; }

/* Écrans plus larges */
@media (min-width: 640px) {
  h1 { font-size: 1.9rem; }
  .hero h1 { font-size: 2.6rem; }
  .cards-4 { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .facts { grid-template-columns: 170px 1fr; }
  .facts dt { margin-top: 0; }
  .card { padding: 22px; }
}
@media (min-width: 900px) {
  .area-site .wrap { max-width: 900px; }
  .post-grid { grid-template-columns: 300px 1fr; align-items: start; }
  .post-preview { position: sticky; top: 16px; }
  .how-steps { grid-template-columns: 1fr 1fr; }
}
