/* Design Machine — stylesheet sendiri. Kecil, satu layar, gak ada sisa dashboard. */
:root {
  --bg:      #f6f6f8;
  --surface: #ffffff;
  --sunken:  #f2f2f5;
  --border:  #e4e4e9;
  --text:    #17171a;
  --text-2:  #6b6b74;
  --text-3:  #a3a3ad;
  --accent:  #1d1d1f;
  --blue:    #0071e3;
  --green:   #1f9d4d;
  --red:     #d92c20;
  --radius:  14px;
  --shadow:  0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#0e0e10; --surface:#171719; --sunken:#141416; --border:#2a2a2f;
    --text:#f2f2f4; --text-2:#9a9aa4; --text-3:#65656e; --accent:#f2f2f4; --blue:#4a9dff;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }

/* ── Header ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 22px; height: 58px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; letter-spacing: -.02em;
}
.brand-name { font-weight: 650; letter-spacing: -.015em; font-size: 15px; }
.brand-sub  { color: var(--text-3); font-size: 12.5px; }
@media (max-width: 620px) { .brand-sub { display: none; } }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.wrap {
  max-width: 1240px; margin: 0 auto; padding: 22px;
  display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start;
}
@media (max-width: 980px) { .wrap { grid-template-columns: 1fr; } }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-title { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.card-meta { font-size: 12px; color: var(--text-2); }
.step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: var(--sunken); color: var(--text-2);
  font-size: 10.5px; font-weight: 700; margin-right: 7px;
}

/* ── Form ───────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input {
  width: 100%; padding: 9px 11px; font-size: 13px; border-radius: 10px;
  background: var(--sunken); border: 1px solid transparent; color: var(--text);
  transition: border-color .12s, background .12s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--blue); background: var(--surface); }
textarea.input { resize: vertical; min-height: 62px; }

.drop {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 128px; border-radius: 12px; cursor: pointer; overflow: hidden;
  background: var(--sunken); border: 1.5px dashed var(--border);
  transition: border-color .12s, background .12s;
}
.drop:hover, .drop.dragover { border-color: var(--blue); background: var(--surface); }
.drop-hint {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  color: var(--text-3); font-size: 12px; text-align: center; padding: 12px;
}
.drop-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.btn {
  border: none; border-radius: 10px; padding: 9px 15px; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: opacity .12s, transform .06s;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover:not(:disabled) { opacity: .88; }
.btn-ghost { background: var(--sunken); color: var(--text); text-decoration: none; }
.btn-ghost:hover { background: var(--border); }
.btn-mini {
  background: none; border: none; cursor: pointer; padding: 3px 7px; border-radius: 7px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
}
.btn-mini:hover { background: var(--sunken); color: var(--text); }
.grow { flex: 1; }

.note { font-size: 12px; color: var(--text-2); min-height: 16px; }
.note.ok  { color: var(--green); }
.note.err { color: var(--red); }

/* ── Katalog ────────────────────────────────────────────────────────────── */
.catalog { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; margin: -4px; padding: 4px; }
.item {
  display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 11px;
  cursor: pointer; border: 1px solid transparent; transition: background .12s, border-color .12s;
}
.item:hover { background: var(--sunken); }
.item.active { background: var(--sunken); border-color: var(--blue); }
.thumb { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; flex: none; background: var(--sunken); }
.thumb-ph {
  display: flex; align-items: center; justify-content: center;
  font-weight: 650; color: var(--text-3); font-size: 15px;
}
.item-body { flex: 1; min-width: 0; }
.item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-del {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  padding: 5px; border-radius: 7px; opacity: 0; transition: opacity .12s, color .12s;
}
.item:hover .item-del { opacity: 1; }
.item-del:hover { color: var(--red); background: var(--sunken); }
.empty { padding: 22px 12px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* ── Konsep ─────────────────────────────────────────────────────────────── */
.controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.control { display: flex; flex-direction: column; gap: 5px; }
.label { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.select { padding: 9px 11px; font-size: 13px; border-radius: 10px; background: var(--sunken); border: 1px solid transparent; cursor: pointer; }

.concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.concept {
  position: relative; padding: 13px; border-radius: 12px; cursor: pointer;
  background: var(--sunken); border: 1.5px solid transparent;
  transition: border-color .12s, opacity .12s;
  opacity: .5;
}
.concept.on { opacity: 1; border-color: var(--accent); }
.concept-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.angle { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.check {
  width: 17px; height: 17px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--border); color: transparent;
  display: flex; align-items: center; justify-content: center;
}
.concept.on .check { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.headline { font-size: 13.5px; font-weight: 650; line-height: 1.35; letter-spacing: -.01em; }
.subhead { font-size: 12px; color: var(--text-2); margin-top: 5px; }
.cta-chip {
  display: inline-block; margin-top: 9px; padding: 3px 9px; border-radius: 20px;
  background: var(--surface); font-size: 11px; font-weight: 650;
}
.rationale { font-size: 11.5px; color: var(--text-3); margin-top: 9px; font-style: italic; line-height: 1.45; }

/* ── Hasil ──────────────────────────────────────────────────────────────── */
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.progress { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--sunken); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .35s ease; }
.result img { width: 100%; border-radius: 11px; display: block; background: var(--sunken); }
.result-cap { margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-2); }

/* ── Menu user ──────────────────────────────────────────────────────────── */
.user { position: relative; }
.user-btn { background: none; border: none; cursor: pointer; padding: 0; border-radius: 50%; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; display: flex;
  align-items: center; justify-content: center; background: var(--sunken);
  color: var(--text-2); font-weight: 650; font-size: 12.5px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-drop {
  position: absolute; right: 0; top: 40px; min-width: 216px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); display: none;
}
.user-drop.show { display: block; }
.user-head { padding: 9px 10px 11px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.user-name { font-size: 13px; font-weight: 650; }
.user-email { font-size: 11.5px; color: var(--text-2); word-break: break-all; }
.user-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px;
  background: none; border: none; cursor: pointer; font-size: 13px;
  color: var(--text); text-decoration: none;
}
.user-item:hover { background: var(--sunken); }

.spinner {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* Penanda kalau gerbang login lagi dimatiin — biar nggak kelupaan nyalain lagi. */
.open-badge {
  font-size: 11px; font-weight: 650; letter-spacing: .02em;
  padding: 4px 10px; border-radius: 20px;
  background: var(--sunken); color: var(--text-3);
}
