/* ── Djeli Studio ─────────────────────────────────────────────────────────────
   Salle de montage : sombre, calme, l'image passe avant l'interface.          */

:root {
  --bg:        #0a0b0d;
  --bg-2:      #101215;
  --panel:     #15181d;
  --panel-2:   #1b1f26;
  --line:      #262b34;
  --line-soft: #1e222a;
  --text:      #e8eaed;
  --muted:     #8b93a1;
  --dim:       #5c6472;
  --gold:      #e0a83c;
  --gold-soft: #f0c877;
  --green:     #35c48a;
  --red:       #e8695b;
  --blue:      #5aa0e8;
  --radius:    14px;
  --shadow:    0 18px 50px rgba(0,0,0,.55);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  /* halo chaud très discret, comme une lampe de studio */
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(224,168,60,.07), transparent 60%),
    radial-gradient(700px 500px at 95% 8%, rgba(90,160,232,.05), transparent 60%);
}
a { color: var(--gold-soft); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── Connexion ─────────────────────────────────────────────────────────────── */

.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(1000px 600px at 50% 30%, #14171c, #08090b 70%);
}
.gate-card {
  width: min(400px, 90vw);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 34px 30px; box-shadow: var(--shadow);
  animation: rise .5s cubic-bezier(.2,.8,.2,1);
}
.gate-card h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.gate-card p { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ── Structure ─────────────────────────────────────────────────────────────── */

.app { position: relative; z-index: 1; display: grid; grid-template-columns: 246px 1fr; min-height: 100vh; }

.side {
  border-right: 1px solid var(--line-soft);
  background: rgba(13,15,18,.72);
  backdrop-filter: blur(14px);
  padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, var(--gold), #b8791f);
  display: grid; place-items: center; font-weight: 800; color: #1a1206; font-size: 17px;
  box-shadow: 0 4px 16px rgba(224,168,60,.28);
}
.brand b { display: block; font-size: 15.5px; letter-spacing: -.01em; }
.brand span { display: block; font-size: 11px; color: var(--dim); letter-spacing: .06em; text-transform: uppercase; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  color: var(--muted); font-size: 14px; border: 1px solid transparent;
  transition: background .16s, color .16s, border-color .16s;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.on { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.nav-item .ic { width: 18px; text-align: center; opacity: .9; }
.nav-sep { height: 1px; background: var(--line-soft); margin: 12px 4px; }
.side-foot { margin-top: auto; font-size: 11.5px; color: var(--dim); padding: 0 8px; }
.side-foot .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--dim); }
.dot.ok { background: var(--green); box-shadow: 0 0 8px rgba(53,196,138,.6); }
.dot.ko { background: var(--red); }

.main { padding: 30px 36px 70px; max-width: 1220px; width: 100%; }
.page-head { margin-bottom: 26px; }
.page-head h2 { margin: 0 0 5px; font-size: 25px; letter-spacing: -.02em; font-weight: 650; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; max-width: 65ch; }

/* ── Éléments ──────────────────────────────────────────────────────────────── */

.card {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 22px;
}
.card + .card { margin-top: 16px; }
.card h3 { margin: 0 0 3px; font-size: 15px; font-weight: 620; }
.card h3 + .hint { margin: 0 0 18px; }
.hint { color: var(--dim); font-size: 12.5px; margin: 4px 0 0; }

label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; letter-spacing: .01em; }

input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  border-color: #46505f; box-shadow: 0 0 0 3px rgba(224,168,60,.1);
}
input::placeholder, textarea::placeholder { color: #4d5563; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: right 15px center, right 10px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 10px; cursor: pointer; font-size: 14px;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { background: #232833; border-color: #313846; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(140deg, var(--gold), #c98f26);
  color: #1a1206; border-color: transparent; font-weight: 620;
  box-shadow: 0 6px 20px rgba(224,168,60,.2);
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: rgba(232,105,91,.3); }
.btn.sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button {
  background: transparent; border: 0; padding: 8px 15px; border-radius: 8px;
  cursor: pointer; color: var(--muted); font-size: 13.5px; transition: background .15s, color .15s;
}
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.4); }

.switch { display: flex; align-items: center; gap: 10px; padding: 9px 0; cursor: pointer; }
.switch input { display: none; }
.switch i {
  width: 38px; height: 22px; border-radius: 11px; background: #2a303a; flex: none;
  position: relative; transition: background .18s;
}
.switch i::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #7b838f; transition: transform .18s, background .18s;
}
.switch input:checked + i { background: rgba(224,168,60,.3); }
.switch input:checked + i::after { transform: translateX(16px); background: var(--gold); }
.switch span { font-size: 13.5px; }
.switch small { display: block; color: var(--dim); font-size: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--muted); letter-spacing: .02em;
}
.chip.ok { color: var(--green); border-color: rgba(53,196,138,.28); }
.chip.run { color: var(--gold); border-color: rgba(224,168,60,.3); }
.chip.err { color: var(--red); border-color: rgba(232,105,91,.3); }

.cost {
  display: flex; align-items: baseline; gap: 8px; margin-top: 6px;
  padding: 13px 16px; border-radius: 11px;
  background: linear-gradient(120deg, rgba(224,168,60,.09), rgba(224,168,60,.02));
  border: 1px solid rgba(224,168,60,.16);
}
.cost b { font-size: 21px; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.cost small { color: var(--muted); font-size: 12.5px; }

/* ── Bibliothèque ──────────────────────────────────────────────────────────── */

.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 18px; }
.tile {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s;
}
.tile:hover { transform: translateY(-3px); border-color: #303743; box-shadow: var(--shadow); }
.tile .thumb {
  aspect-ratio: 16/9; background: #0d0f12 center/cover no-repeat;
  display: grid; place-items: center; position: relative; border-bottom: 1px solid var(--line-soft);
}
.tile .thumb .ph { font-size: 30px; opacity: .16; }
.tile .thumb .len {
  position: absolute; right: 8px; bottom: 8px; font-size: 11px; font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.75); padding: 2px 7px; border-radius: 5px; backdrop-filter: blur(4px);
}
.tile .body { padding: 13px 15px 15px; }
.tile .body b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .body .meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--dim); }

.bar { height: 3px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); transition: width .5s cubic-bezier(.3,1,.4,1); }

/* ── Vue projet ────────────────────────────────────────────────────────────── */

.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1000px) { .hero { grid-template-columns: 1fr; } }

.player { background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.player video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }
.stage-empty {
  aspect-ratio: 16/9; display: grid; place-items: center; gap: 14px;
  background: linear-gradient(160deg, #101318, #0a0c0f); text-align: center; padding: 24px;
}
.stage-empty .big { font-size: 15px; color: var(--text); }
.stage-empty .sub { font-size: 13px; color: var(--dim); max-width: 40ch; }

.steps { display: flex; flex-direction: column; gap: 2px; }
.step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.step .n {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 11.5px; border: 1px solid var(--line); color: var(--dim); background: var(--bg-2);
}
.step.done .n { background: rgba(53,196,138,.14); border-color: rgba(53,196,138,.35); color: var(--green); }
.step.now { background: var(--panel-2); }
.step.now .n { border-color: var(--gold); color: var(--gold); animation: pulse 1.6s ease-in-out infinite; }
.step .lbl { font-size: 13.5px; color: var(--muted); }
.step.now .lbl, .step.done .lbl { color: var(--text); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(224,168,60,.09); } }

.log {
  font-family: var(--mono); font-size: 12px; line-height: 1.65;
  background: #08090b; border: 1px solid var(--line-soft); border-radius: 11px;
  padding: 13px 15px; max-height: 260px; overflow-y: auto; color: #9aa3b1;
}
.log div { white-space: pre-wrap; word-break: break-word; }
.log .t { color: #4a515e; margin-right: 8px; }
.log .warn { color: var(--gold); }
.log .error { color: var(--red); }
.log::-webkit-scrollbar { width: 8px; }
.log::-webkit-scrollbar-thumb { background: #232833; border-radius: 8px; }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.shot {
  position: relative; aspect-ratio: 16/9; border-radius: 9px; overflow: hidden;
  background: #0d0f12 center/cover no-repeat; border: 1px solid var(--line-soft);
  animation: fade .45s ease both;
}
.shot.pending { display: grid; place-items: center; }
.shot.pending::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.045) 50%, transparent 80%);
  background-size: 220% 100%; animation: shimmer 1.7s linear infinite;
}
.shot .idx {
  position: absolute; left: 6px; top: 6px; font-size: 10px; font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.68); padding: 1px 6px; border-radius: 4px; color: #c9cfd8;
}
.shot .dur {
  position: absolute; right: 6px; bottom: 6px; font-size: 10px;
  background: rgba(0,0,0,.68); padding: 1px 6px; border-radius: 4px; color: #c9cfd8;
}
.shot .cap {
  position: absolute; inset: auto 0 0 0; padding: 16px 8px 7px; font-size: 10.5px; line-height: 1.4;
  background: linear-gradient(transparent, rgba(0,0,0,.9)); color: #d5dae2;
  opacity: 0; transition: opacity .2s;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.shot:hover .cap { opacity: 1; }
@keyframes fade { from { opacity: 0; transform: scale(.97); } }
@keyframes shimmer { to { background-position: -220% 0; } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 13px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 70px 20px; color: var(--dim); }
.empty .ic { font-size: 40px; opacity: .2; display: block; margin-bottom: 12px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); padding: 12px 20px;
  border-radius: 11px; box-shadow: var(--shadow); z-index: 200; font-size: 13.5px;
  animation: rise .3s cubic-bezier(.2,.8,.2,1);
}
.toast.err { border-color: rgba(232,105,91,.4); color: #ffb3aa; }

.drop {
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 26px 20px; text-align: center;
  cursor: pointer; transition: border-color .18s, background .18s; background: var(--bg-2);
}
.drop:hover, .drop.over { border-color: var(--gold); background: rgba(224,168,60,.05); }
.drop .ic { font-size: 26px; opacity: .5; display: block; margin-bottom: 8px; }
.drop b { font-size: 13.5px; }
.drop small { display: block; color: var(--dim); font-size: 12px; margin-top: 4px; }

@media (max-width: 780px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; overflow-x: auto; align-items: center; padding: 12px; }
  .brand { padding: 0 12px 0 4px; }
  .nav-sep, .side-foot { display: none; }
  .main { padding: 20px 16px 60px; }
}
