/*
 * Charte du générateur de composition (bleu nuit / or / rouge, comme fnfl.app).
 * Pour aligner exactement sur le site principal, ne modifier que ce bloc de variables.
 */
:root {
  color-scheme: dark;
  --bg: #0a1224;
  --bg-soft: #0f1b34;
  --panel: #13213f;
  --panel-2: #182a4d;
  --line: #2b4070;
  --text: #e8edf7;
  --muted: #9db0d1;
  --gold: #d4af37;
  --gold-soft: #f0d271;
  --red: #c8323c;
  --red-soft: #ff7a82;
  --ok: #5fcf8a;
  --radius: 8px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 500px at 50% -150px, #16284d 0%, var(--bg) 70%);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- en-tête / pied de page */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 24px;
  background: rgba(10, 18, 36, 0.92);
  border-bottom: 2px solid var(--gold);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--gold-soft); text-decoration: none; font-weight: 700; letter-spacing: 0.04em; }
.brand img { border-radius: 50%; }
.header-title { color: var(--muted); font-size: 0.95rem; }
.site-footer { margin-top: auto; padding: 22px 16px; text-align: center; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); }

main { width: min(1100px, 100% - 32px); margin: 0 auto; padding: 28px 0 48px; }
.hero { text-align: center; margin-bottom: 26px; }
.eyebrow { margin: 0; color: var(--gold); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.8rem; }
h1 { margin: 6px 0 10px; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.lead { margin: 0 auto; max-width: 720px; color: var(--muted); }
h2 { margin: 0 0 14px; font-size: 1.15rem; color: var(--gold-soft); letter-spacing: 0.03em; }

/* ---------- panneaux */
.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.card.section { border-left: 4px solid var(--gold); padding: 0; overflow: visible; }
.card-head { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 2fr) auto; gap: 12px; align-items: end; padding: 16px 18px; background: var(--panel-2); border-radius: var(--radius) var(--radius) 0 0; }
.groups { padding: 12px 18px 6px; }
.section-foot { padding: 0 18px 16px; }
.group { background: var(--bg-soft); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.group-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin-bottom: 12px; }
.member { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 10px; align-items: end; padding: 10px 0; border-top: 1px dashed var(--line); }
.member:first-of-type { border-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.empty { text-align: center; color: var(--muted); padding: 22px; border: 1px dashed var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.banner { margin-bottom: 18px; padding: 12px 16px; border: 1px solid var(--red); background: rgba(200, 50, 60, 0.12); border-radius: var(--radius); color: var(--red-soft); }

/* ---------- champs */
label, .cb-label { display: block; margin-bottom: 4px; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
input[type="text"], .cb-input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a1429;
  color: var(--text);
  font: inherit;
}
input[type="text"]:focus, .cb-input:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.field { min-width: 0; }

/* ---------- liste déroulante avec recherche */
.cb { position: relative; min-width: 0; }
.cb-box { position: relative; }
.cb-input { padding-right: 32px; }
.cb-caret { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 28px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.9rem; }
.cb.is-picked .cb-input { border-color: var(--gold); }
.cb.is-manual .cb-input { border-style: dashed; border-color: #6f86b5; }
.cb-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 4px; list-style: none;
  max-height: 260px; overflow-y: auto;
  background: #0b1630; border: 1px solid var(--gold); border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.cb-list[hidden] { display: none; }
.cb-option { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 4px; cursor: pointer; }
.cb-option.is-active, .cb-option:hover { background: #1c3363; }
.cb-hint { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.cb-empty { padding: 8px 10px; color: var(--muted); font-size: 0.88rem; }

/* ---------- boutons */
.btn { padding: 10px 18px; border-radius: 6px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--gold); color: #1a1405; }
.btn.primary:hover { background: var(--gold-soft); }
.btn.secondary { background: transparent; border-color: var(--gold); color: var(--gold-soft); }
.btn.secondary:hover { background: rgba(212, 175, 55, 0.12); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { border-color: var(--muted); color: var(--text); }
.btn.small { padding: 6px 12px; font-size: 0.88rem; }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red-soft); padding: 8px 12px; }
.btn.danger:hover { background: rgba(200, 50, 60, 0.18); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }

/* ---------- résultat */
.warn { margin: 0 0 14px; padding: 10px 14px 10px 30px; border: 1px solid var(--gold); border-radius: var(--radius); background: rgba(212, 175, 55, 0.1); color: var(--gold-soft); }
.msg { margin-bottom: 18px; }
.msg-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.msg-title { font-weight: 600; }
.msg-count { color: var(--muted); font-size: 0.85rem; margin-left: 8px; }
textarea { min-height: 120px; resize: vertical; font-family: Consolas, "Courier New", monospace; font-size: 0.92rem; white-space: pre; overflow: auto; }
.copied { background: var(--ok); color: #06210f; border-color: var(--ok); }

@media (max-width: 900px) {
  .member { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member .member-del { grid-column: 1 / -1; justify-self: end; }
  .card-head { grid-template-columns: 1fr; }
  .header-title { display: none; }
}
