/* AI Image Studio — gaya tampilan */
:root {
  --bg: #0b1020;
  --bg-2: #121a31;
  --panel: #16203a;
  --panel-2: #1b2745;
  --line: #27324f;
  --text: #e8edf7;
  --dim: #93a0bd;
  --accent: #ff9f1c;
  --accent-2: #ffbf69;
  --ok: #2ec4a6;
  --warn: #ffb703;
  --err: #ef476f;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 10% -10%, #1a2547 0%, var(--bg) 60%);
  color: var(--text);
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

a { color: var(--accent-2); }
h1, h2, h3 { margin: 0 0 .4em; font-weight: 650; letter-spacing: .2px; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
.muted { color: var(--dim); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Kerangka ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: rgba(11,16,32,.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-badge {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #e63946);
  display: grid; place-items: center; font-size: 16px;
}
.spacer { flex: 1; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 20px; }
.grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(340px,1fr); gap: 18px; }
@media (max-width: 1000px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 18px;
}
.card > h2 { display: flex; align-items: center; gap: 8px; }
.step {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #1a1206; font-size: .78rem; font-weight: 800;
}

/* ---------- Kontrol ---------- */
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 9px;
  padding: 9px 15px; background: var(--panel-2); color: var(--text);
  transition: .15s transform, .15s filter;
}
button:hover:not(:disabled) { filter: brightness(1.18); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #f4741f); color: #1a1206; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { background: transparent; border-color: #6b2233; color: #ff8098; }
.btn-sm { padding: 6px 11px; font-size: .87rem; }

input[type=text], input[type=number], select, textarea {
  font: inherit; width: 100%; padding: 9px 11px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px;
}
textarea { resize: vertical; min-height: 74px; }
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; margin-bottom: 5px; font-size: .87rem; color: var(--dim); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.tight { gap: 6px; }
.col { flex: 1; min-width: 130px; }

/* ---------- Pesan ---------- */
.note {
  padding: 10px 12px; border-radius: 9px; margin: 10px 0; font-size: .9rem;
  border: 1px solid var(--line); background: var(--bg-2);
}
.note.ok { border-color: #1c6b5c; background: #0e2c27; color: #a8f0e0; }
.note.err { border-color: #6b2233; background: #2c0e15; color: #ffb3c6; }
.note.warn { border-color: #6b5520; background: #2c2410; color: #ffe1a8; }
.hidden { display: none !important; }

/* ---------- Kanvas mask ---------- */
.canvas-shell {
  position: relative; background: #080c17; border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; min-height: 260px;
  display: grid; place-items: center;
}
.canvas-shell.dragover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,159,28,.18) inset; }
.canvas-stack { position: relative; line-height: 0; }
.canvas-stack canvas { display: block; max-width: 100%; height: auto; touch-action: none; }
.canvas-stack canvas.mask { position: absolute; inset: 0; opacity: .55; pointer-events: none; }
.canvas-stack canvas.paint { position: absolute; inset: 0; cursor: crosshair; }
.drop-hint { text-align: center; color: var(--dim); padding: 44px 20px; }
.drop-hint .big { font-size: 2rem; display: block; margin-bottom: 8px; }

.tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.tools .tool { padding: 6px 11px; font-size: .87rem; }
.tools .tool.active { background: var(--accent); color: #1a1206; border-color: transparent; }
.tools .sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }
.swatch { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--line); }

/* ---------- Daftar pekerjaan ---------- */
.job {
  display: flex; gap: 12px; padding: 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg-2); margin-bottom: 9px;
}
.job img { width: 62px; height: 62px; object-fit: cover; border-radius: 7px; background: #000; flex: none; }
.job .meta { flex: 1; min-width: 0; }
.job .meta .t { font-weight: 600; font-size: .92rem; }
.job .meta .d { color: var(--dim); font-size: .8rem; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .74rem; font-weight: 700; }
.tag.queued { background: #3a3210; color: #ffd76a; }
.tag.running { background: #103a4a; color: #6fd8ff; }
.tag.done { background: #0e382f; color: #6cf0cf; }
.tag.failed { background: #3a1020; color: #ff92ab; }
.tag.cancelled { background: #262b3a; color: #9aa6c0; }

/* ---------- Login ---------- */
.login-wrap { max-width: 430px; margin: 8vh auto; padding: 20px; }
.login-wrap .card { padding: 24px; }
.code-input {
  font: 700 1.7rem/1 ui-monospace, Menlo, monospace; letter-spacing: .5rem;
  text-align: center; padding: 12px !important;
}
.pill-list { display: flex; gap: 7px; flex-wrap: wrap; margin: 4px 0 12px; }
.pill {
  padding: 6px 13px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--bg-2); cursor: pointer; font-size: .88rem; font-weight: 600;
}
.pill.sel { background: var(--accent); color: #1a1206; border-color: transparent; }

.spin {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff; border-radius: 50%; display: inline-block;
  animation: sp .7s linear infinite; vertical-align: -2px;
}
@keyframes sp { to { transform: rotate(360deg); } }

footer { text-align: center; color: var(--dim); font-size: .82rem; padding: 22px; }
