@charset "UTF-8";
/* ===================== 2-up Studio ===================== */
:root {
  /* ---- Palette Wael Academy, carte de marque officielle --------------
     Un seul endroit porte les couleurs de la marque ; tout le reste de
     l'application s'y branche par les jetons generiques definis dessous.
     Le bleu 700 est LA couleur : boutons, barres, elements actifs. */
  --wl-blue-900: #0E2440;
  --wl-blue-800: #123A63;
  --wl-blue-700: #17497E;
  --wl-blue-600: #1B5A96;
  --wl-blue-500: #2570B8;
  --wl-blue-400: #4A90CE;
  --wl-blue-300: #8FBEE0;
  --wl-blue-200: #C5DDEF;
  --wl-blue-100: #E5F1F8;
  --wl-blue-050: #F2F8FC;
  --wl-muted: #7C93AC;
  --wl-line: #E1EAF3;
  --wl-ember: #E0682F;
  --wl-green: #2FA36B;

  /* ---- Theme sombre : noir neutre --------------------------------
     Le navy de la marque est une couleur d'encre, pas une couleur de
     fond : etale sur un ecran entier il vire au delave. Le fond reste
     donc noir et c'est le bleu qui ressort dessus. */
  --bg: #0A0A0B;
  --bg-glow-1: rgba(74, 144, 206, .12);
  --bg-glow-2: rgba(47, 163, 107, .07);
  --surface: #141417;
  --surface-2: #1C1C21;
  --line: #2B2B33;
  --text: #F2F3F5;
  --muted: #9B9BA6;
  --accent: #5AA0DC;
  --accent-fonce: #3F87C6;
  --accent-2: #2FBF9E;
  --ok: #45C98A;
  --danger: #F2736B;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .55);
}

[data-theme="light"] {
  --bg: #F2F8FC;
  --bg-glow-1: rgba(23, 73, 126, .14);
  --bg-glow-2: rgba(47, 163, 107, .12);
  --surface: #ffffff;
  --surface-2: #E5F1F8;
  --line: #D7E5F1;
  --text: #0E2440;
  --muted: #7C93AC;
  --accent: #17497E;
  --accent-fonce: #0E2440;
  --accent-2: #17A67F;
  --ok: #2FA36B;
  --danger: #D64545;
  --shadow: 0 14px 34px rgba(14, 36, 64, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 12% -12%, var(--bg-glow-1), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, var(--bg-glow-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; }
p { margin: 0; }

/* ---------------------- barre du haut ---------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 18px 26px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}
.brand { display: flex; align-items: center; gap: 14px; }
/* Le sceau de la marque, toujours blanc sur sa pastille navy. */
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px; padding: 8px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(155deg, var(--wl-blue-600) 0%,
              var(--wl-blue-700) 45%, var(--wl-blue-900) 100%);
  box-shadow: 0 8px 22px rgba(23, 73, 126, .38);
}
.brand-mark img { width: 100%; height: auto; display: block; }
.brand h1 { font-size: 19px; letter-spacing: -.2px; }
.brand p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.badge-host {
  font-size: 12px; color: var(--muted); padding: 6px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-family: ui-monospace, Consolas, monospace;
}

/* ---------------------- structure ---------------------- */
.layout {
  display: grid; grid-template-columns: 372px minmax(0, 1fr);
  gap: 22px; padding: 22px 26px 60px; align-items: start;
}
@media (max-width: 1080px) { .layout { grid-template-columns: 1fr; } }

.panel { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 92px; }
@media (max-width: 1080px) { .panel { position: static; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card h2 {
  font-size: 14px; display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px; letter-spacing: .1px;
}
.card h2 em { font-style: normal; font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); padding: 2px 7px; border-radius: 999px; }
.step {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  font-size: 12px; color: #fff; background: linear-gradient(140deg, var(--accent), var(--accent-2));
}

/* ---------------------- zones de dépôt ---------------------- */
.drop {
  border: 1.5px dashed var(--line); border-radius: 13px;
  padding: 26px 16px; text-align: center; cursor: pointer;
  background: var(--surface-2); transition: .18s ease;
}
.drop.small { padding: 18px 14px; }
.drop:hover, .drop:focus-visible {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface-2));
  outline: none;
}
.drop.over {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
  transform: scale(1.01);
}
.drop-icon { font-size: 26px; line-height: 1; margin-bottom: 8px; color: var(--accent); }
.drop-title { font-size: 13.5px; font-weight: 600; }
.drop-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.filecard {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2);
}
.filecard-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
}
.filecard-thumb {
  width: 38px; height: 38px; flex: none; border-radius: 8px;
  object-fit: cover; border: 1px solid var(--line); background: #fff;
}
.filecard-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.filecard-body strong {
  font-size: 12.8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.filecard-body span { font-size: 11.5px; color: var(--muted); }

/* ------------- liste des PDF source (assemblage) ------------- */
.filelist {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 7px;
  max-height: 262px; overflow-y: auto;
}
.fitem {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2);
}
.fnum {
  width: 22px; height: 22px; flex: none; border-radius: 7px; display: grid;
  place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
}
.finfo { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.finfo strong {
  font-size: 12.3px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.finfo span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.icon-btn.tiny { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.icon-btn:disabled:hover { color: var(--muted); border-color: var(--line); }

.filelist-foot {
  display: flex; flex-direction: column; gap: 9px;
  margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line);
}
.filelist-foot > span { font-size: 11.3px; color: var(--muted); line-height: 1.5; }
.filelist-actions { display: flex; align-items: center; gap: 8px; }
.filelist-actions .ghost { flex: 1; }
.ghost.small { padding: 7px 10px; font-size: 11.8px; }

/* ---------------------- champs ---------------------- */
.field { margin-top: 14px; }
.field:first-of-type { margin-top: 0; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field label, .field-title {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.field label b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

select, input[type="number"] {
  width: 100%; padding: 9px 11px; font-size: 13px; font-family: inherit;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px;
}
select:focus, input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); }

input[type="range"] {
  width: 100%; height: 5px; -webkit-appearance: none; appearance: none;
  background: var(--line); border-radius: 999px; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  border: 2px solid var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface);
  background: var(--accent);
}

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented input { display: none; }
.segmented span {
  display: block; text-align: center; font-size: 11.8px; padding: 9px 6px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  background: var(--surface-2); color: var(--muted); transition: .15s;
}
.segmented input:checked + span {
  border-color: transparent; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
}

/* ---------------------- boutons ---------------------- */
button, .primary { font-family: inherit; }
.primary {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px 18px; border: 0; border-radius: 13px;
  font-size: 14.5px; font-weight: 650; color: #fff; cursor: pointer;
  text-decoration: none; box-shadow: 0 10px 26px rgba(111, 124, 255, .34);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  transition: transform .12s ease, box-shadow .12s ease, filter .12s;
}
.primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.ghost {
  padding: 9px 14px; font-size: 12.5px; border-radius: 10px; cursor: pointer;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  transition: .15s;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn {
  width: 30px; height: 30px; flex: none; border-radius: 9px; cursor: pointer;
  font-size: 15px; line-height: 1; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

.hint { font-size: 11.5px; color: var(--muted); text-align: center; }

/* ---------------------- zone de travail ---------------------- */
.workspace {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-height: 560px; padding: 20px;
}

.placeholder, .loading {
  min-height: 500px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center;
}
.placeholder h3 { font-size: 16px; }
.placeholder p { font-size: 13px; color: var(--muted); line-height: 1.65; }
.sheet {
  width: 118px; height: 158px; border-radius: 10px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px; justify-content: center;
  border: 1.5px dashed var(--line); background: var(--surface-2);
}
.sheet span {
  display: block; height: 42%; border-radius: 6px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 45%, transparent),
                                       color-mix(in srgb, var(--accent-2) 35%, transparent));
}

.spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.spinner.big {
  width: 40px; height: 40px; border-width: 3px;
  border-color: var(--line); border-top-color: var(--accent);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { font-size: 13px; color: var(--muted); }

/* ---------------------- barre d'outils ---------------------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.counts { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  font-size: 11.8px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pill.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.pill.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.slider-inline { display: flex; flex-direction: column; gap: 3px; min-width: 172px; }
.slider-inline label { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; }
.slider-inline b { color: var(--text); font-weight: 600; }

.tip { font-size: 11.8px; color: var(--muted); margin: 12px 0 14px; }

/* ---------------------- grille de pages ---------------------- */
.grid {
  display: grid; gap: 13px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
/* separateur : debut d'un des PDF assembles */
.grp-sep {
  grid-column: 1 / -1;
  display: flex; align-items: baseline; gap: 10px;
  margin: 8px 0 2px; padding-bottom: 7px; border-bottom: 1px solid var(--line);
}
.grp-sep b {
  font-size: 12.5px; font-weight: 650; color: var(--accent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grp-sep span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.grid > .grp-sep:first-child { margin-top: 0; }

.pcard {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--surface-2); cursor: pointer; position: relative;
  transition: transform .13s ease, border-color .13s ease, box-shadow .13s;
}
.pcard:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.pcard img { display: block; width: 100%; background: #fff; }
.pcard .cap {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 7px 9px; font-size: 11.5px; color: var(--muted);
}
.pcard .cap b { color: var(--text); font-weight: 600; }
.pcard .tag {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
  padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line);
}
.pcard .tag:empty { display: none; }
.pcard .tag.empty { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.pcard .tag.repl { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.pcard.removed img { opacity: .28; filter: grayscale(1); }
.pcard.removed { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.pcard.removed::after {
  content: "supprim\e9 e"; position: absolute; top: 42%; left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: #fff; background: var(--danger); padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}

/* ---------------------- résultat ---------------------- */
.result-head { display: flex; align-items: center; gap: 14px; }
.result-check {
  width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center;
  font-size: 22px; color: #fff; background: linear-gradient(140deg, var(--ok), var(--accent-2));
  box-shadow: 0 10px 24px rgba(52, 211, 153, .3);
}
.result-head h3 { font-size: 17px; }
.result-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.stats {
  display: grid; gap: 10px; margin: 18px 0;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}
.stat {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2);
}
.stat b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--muted); }

.result-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.result-actions .primary { width: auto; padding: 13px 26px; }
.preview-title { font-size: 13px; margin: 24px 0 12px; color: var(--muted); font-weight: 600; }
.result-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.result-grid .pcard { cursor: default; }
.result-grid .pcard:hover { transform: none; border-color: var(--line); box-shadow: none; }

/* ---------------------- notifications ---------------------- */
.toast-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; flex-direction: column; gap: 10px; max-width: 380px;
}
.toast {
  padding: 12px 15px; border-radius: 12px; font-size: 12.8px; line-height: 1.5;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  animation: slide-in .22s ease;
}
.toast.err { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); color: var(--danger); }
.toast.ok { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); color: var(--ok); }
@keyframes slide-in { from { opacity: 0; transform: translateY(10px); } }

.hidden { display: none !important; }
