/* BOP Studio — blanc, violet clair, coins arrondis, ombres diffuses colorées. */
:root {
  --violet: #7c5cfc;
  --violet-2: #a78bfa;
  --violet-deep: #6246ea;
  --lav: #ede9fe;
  --lav-2: #f5f3ff;
  --ink: #211d35;
  --muted: #6e6a85;
  --line: #eceafb;
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #ef4444;
  --r: 18px;
  --shadow-card: 0 4px 24px rgba(124, 92, 252, 0.06), 0 1px 2px rgba(33, 29, 53, 0.03);
  --shadow-pop: 0 18px 50px -12px rgba(124, 92, 252, 0.15);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(167, 139, 250, 0.16), transparent 60%),
    radial-gradient(700px 420px at -10% 20%, rgba(124, 92, 252, 0.10), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #fbfaff 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); }
::selection { background: rgba(124, 92, 252, 0.22); }
.hidden { display: none !important; }

/* ---------- boutons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 14px; font-weight: 600; font-size: 14.5px;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d5cfc 55%, #5c7cfc 120%);
  transition: transform 0.15s ease, filter 0.15s ease;
  isolation: isolate;
}
.btn::after {
  content: ""; position: absolute; inset: 8px -4px -8px -4px; z-index: -1;
  background: linear-gradient(135deg, #a78bfa, #7c5cfc 50%, #7cc0fc);
  filter: blur(18px); opacity: 0.15; border-radius: 18px;
  transition: opacity 0.2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn:hover::after { opacity: 0.24; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn:disabled::after { opacity: 0.06; }
.btn.big { width: 100%; padding: 15px 22px; font-size: 15.5px; border-radius: 16px; }
.btn.ghost {
  color: var(--violet-deep);
  background: linear-gradient(135deg, var(--lav-2), #fff);
  border: 1px solid var(--line);
}
.btn.ghost::after { opacity: 0.08; }
.btn.tiny { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.btn.danger { background: linear-gradient(135deg, #f87171, #ef4444); }
.btn.danger::after { background: #f87171; }

/* ---------- écran auth ---------- */
#auth-view { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line);
  border-radius: 26px; padding: 26px 30px 30px; box-shadow: var(--shadow-pop);
  text-align: initial;
}
.wizard { display: flex; justify-content: center; margin-bottom: 2px; }
.wizard svg { animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.wz-glow { animation: pulse 2.2s ease-in-out infinite; transform-origin: 38px 52px; }
.wz-glow2 { animation: pulse 2.2s ease-in-out infinite 0.3s; transform-origin: 38px 52px; }
@keyframes pulse { 0%, 100% { opacity: 0.35; transform: scale(1); } 50% { opacity: 0.9; transform: scale(1.35); } }
.ysnp {
  text-align: center; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
  color: var(--ink); margin-bottom: 6px;
}
.ysnp span {
  background: linear-gradient(90deg, #8b5cf6, #6d5cfc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* code refusé : Gandalf tape du bâton, la carte tremble */
.auth-card.deny { animation: shake 0.45s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.wizard.deny .wz-staff { animation: slam 0.45s ease; transform-origin: 38px 112px; }
@keyframes slam { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(-14deg); } 65% { transform: rotate(6deg); } }
.wizard.deny .wz-glow, .wizard.deny .wz-glow2 { animation-duration: 0.35s; }
.brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 6px; }
.brand .mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, #8b5cf6, #6d5cfc); color: #fff;
  box-shadow: 0 10px 26px -8px rgba(124, 92, 252, 0.15);
}
.brand h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.brand h1 span { color: var(--violet); }
.auth-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--lav-2); border: 1px solid var(--line); border-radius: 13px; padding: 4px; margin-bottom: 20px; }
.tabs button { padding: 9px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 10px rgba(124, 92, 252, 0.10); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #fdfdff; outline: none; transition: border 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--violet-2); box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.12);
}
.auth-err { color: var(--err); font-size: 13px; min-height: 18px; margin: 4px 0 10px; text-align: center; }

/* ---------- app ---------- */
#app-view { max-width: 1280px; margin: 0 auto; padding: 18px 22px 60px; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px; margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-card);
  position: sticky; top: 12px; z-index: 40;
}
.topbar .brand { margin: 0; }
.topbar .brand .mark { width: 36px; height: 36px; border-radius: 11px; }
.topbar .brand h1 { font-size: 17px; }
.spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--violet-deep);
  background: var(--lav-2); border: 1px solid var(--line);
}
.chip b { font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); }

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

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-card); padding: 22px;
}
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; letter-spacing: -0.01em; }

/* ---------- steps ---------- */
.step { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.step-head {
  display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 700;
  color: var(--ink); margin-bottom: 10px;
}
.step-num {
  width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;
  background: var(--lav); color: var(--violet-deep); font-size: 11.5px; font-weight: 800;
}

/* ---------- recipe cards ---------- */
.recipes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.recipe {
  display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px;
  border-radius: 15px; border: 1.5px solid var(--line); background: #fdfdff;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.recipe:hover { transform: translateY(-1px); border-color: var(--violet-2); }
.recipe.on {
  border-color: var(--violet); background: linear-gradient(150deg, #faf8ff, #fff);
  box-shadow: 0 2px 14px rgba(124, 92, 252, 0.10);
}
.r-ico { font-size: 17px; }
.r-name { font-size: 13.5px; font-weight: 700; }
.r-desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; }

.summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding: 10px 14px; border-radius: 13px;
  background: var(--lav-2); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--violet-deep);
}

/* ---------- motion chips ---------- */
.motions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.motion {
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line); background: #fdfdff; color: var(--muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.motion:hover { border-color: var(--violet-2); color: var(--violet-deep); }
.motion.on { background: var(--lav); border-color: var(--violet); color: var(--violet-deep); }

/* segmented modes */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--lav-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 18px; }
.seg button { padding: 10px; border-radius: 11px; font-weight: 650; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--violet-deep); box-shadow: 0 2px 12px rgba(124, 92, 252, 0.10); }
.seg.three { grid-template-columns: 1fr 1fr 1fr; }

/* dropzone */
.drop {
  border: 2px dashed #d8d2f7; border-radius: 18px; padding: 22px; text-align: center;
  color: var(--muted); font-size: 13.5px; background: var(--lav-2);
  transition: border-color 0.15s, background 0.15s; cursor: pointer;
}
.drop.over { border-color: var(--violet); background: #f3f0ff; }
.drop .ico { font-size: 26px; display: block; margin-bottom: 6px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 3/4; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(20, 16, 40, 0.55); color: #fff; font-size: 11px; display: grid; place-items: center;
}
.thumb .st { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9.5px; text-align: center; padding: 2px; color: #fff; background: rgba(124, 92, 252, 0.85); }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.opts .field { margin: 0; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237c5cfc' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px !important;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.engine-row { display: flex; gap: 8px; align-items: center; }
.vendor {
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 8px;
  background: var(--lav); color: var(--violet-deep); white-space: nowrap;
}
textarea { resize: vertical; min-height: 74px; line-height: 1.5; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.linkish { color: var(--violet); font-size: 12px; font-weight: 650; }
.linkish:hover { text-decoration: underline; }

.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .tr { width: 36px; height: 21px; border-radius: 999px; background: #e4e0f7; position: relative; transition: background 0.15s; }
.switch .tr::after { content: ""; position: absolute; top: 2.5px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); transition: left 0.15s; }
.switch input:checked + .tr { background: var(--violet); }
.switch input:checked + .tr::after { left: 17px; }

.progress { height: 8px; border-radius: 99px; background: var(--lav-2); border: 1px solid var(--line); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a78bfa, #7c5cfc); transition: width 0.2s; }

/* ---------- résultats ---------- */
.jobs { display: grid; gap: 14px; }
.job {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 16px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px;
  box-shadow: var(--shadow-card);
}
.job .jthumb { width: 84px; height: 106px; border-radius: 14px; overflow: hidden; background: var(--lav-2); border: 1px solid var(--line); position: relative; }
.job .jthumb img, .job .jthumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.job .jthumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; background: rgba(33, 29, 53, 0.25); }
.job h3 { font-size: 14px; font-weight: 700; }
.tagchip { font-size: 11px; font-weight: 600; color: var(--violet-deep); background: var(--lav); padding: 2px 7px; border-radius: 7px; }
.jsource { font-size: 12.5px; color: var(--ink); margin-top: 4px; display: flex; align-items: center; gap: 7px; }
.viachip {
  font-size: 10px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 7px; background: var(--lav-2);
  border: 1px solid var(--line); color: var(--muted);
}
.opt-tag { font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--lav-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 7px; text-transform: uppercase; letter-spacing: 0.03em; }
.jmeta { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; }
.jmeta span { background: var(--lav-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 8px; }
.jactions { display: flex; flex-direction: column; gap: 7px; align-items: stretch; min-width: 130px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; width: fit-content; margin-top: 7px;
}
.pill.run { color: var(--violet-deep); background: linear-gradient(90deg, #f1edff, #e6e0ff, #f1edff); background-size: 200% 100%; animation: shine 1.6s linear infinite; }
.pill.ok { color: #067a55; background: #e7f8f1; }
.pill.err { color: #b91c1c; background: #feecec; }
.pill.wait { color: #92670c; background: #fdf3dc; }
@keyframes shine { to { background-position: -200% 0; } }
.spin { width: 12px; height: 12px; border: 2px solid rgba(124, 92, 252, 0.3); border-top-color: var(--violet); border-radius: 50%; animation: rot 0.8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.drive-badge { font-size: 11.5px; font-weight: 700; color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.drive-badge.done { color: var(--ok); }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 14px; }
.empty .big-ico { font-size: 40px; display: block; margin-bottom: 10px; opacity: 0.5; }
.jerr { font-size: 12px; color: var(--err); margin-top: 5px; line-height: 1.4; }
.jnote { font-size: 12px; color: var(--warn); margin-top: 5px; }

/* modal vidéo */
#modal { position: fixed; inset: 0; background: rgba(20, 16, 40, 0.65); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 90; padding: 20px; }
#modal .box { background: #fff; border-radius: 22px; padding: 16px; max-width: min(520px, 96vw); width: 100%; box-shadow: var(--shadow-pop); }
#modal video { width: 100%; max-height: 74vh; border-radius: 14px; background: #000; }
#modal .mrow { display: flex; gap: 10px; margin-top: 12px; }

/* toasts */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 99; }
.toast {
  background: #211d35; color: #fff; font-size: 13.5px; padding: 11px 18px; border-radius: 13px;
  box-shadow: 0 10px 30px rgba(33, 29, 53, 0.35); animation: pop 0.2s ease;
}
.toast.err { background: #b91c1c; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
