/* ==========================================================
   PRD Pake AI — Design System
   Bahasa desain: dark navy + aksen oranye (tiruan gaya
   ngodingpakeai.com: tokens identik, brand/logo sendiri)
   ========================================================== */
:root {
  --background: #0a1128;
  --foreground: #f3f4f6;
  --card: #141b31;
  --muted: #22293e;
  --muted-foreground: #9ca3af;
  --border: #2c3246;
  --primary: #ff5c20;
  --primary-foreground: #fff7f3;
  --accent: #1c2440;
  --accent-foreground: #f3f4f6;
  --ring: #ff5c20;
  --radius: .75rem;
  --danger: #f43f5e;
  --ok: #22c55e;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted-foreground); }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 30;
  width: 100%;
  background: rgba(10, 17, 40, .8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-in {
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; position: relative;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-weight: 800; letter-spacing: -.02em; font-size: 15px; min-width: 0; }
.brand svg { height: 26px; width: auto; flex-shrink: 0; }
.brand-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-stats { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; gap: 18px; }
.header-stats .st { display: flex; align-items: baseline; gap: 5px; }
.header-stats b { font-size: 13px; font-weight: 700; }
.header-stats span { font-size: 11px; color: var(--muted-foreground); }
@media (min-width: 900px) { .header-stats { display: flex; } }

/* ---------- Buttons (shadcn-like) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  border: 1px solid var(--border); background: var(--background); color: var(--foreground);
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--accent); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #ff7038; border-color: #ff7038; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--accent); }
.btn-danger { border-color: rgba(244,63,94,.4); color: #fb7185; }
.btn-danger:hover { background: rgba(244,63,94,.12); }
.btn-block { width: 100%; }

/* ---------- Card / surface ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(255,92,32,.12); color: #ff8a5c; border: 1px solid rgba(255,92,32,.28);
}
.badge-soon {
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px; background: var(--muted); color: var(--muted-foreground);
  border: 1px solid var(--border);
}

/* ---------- Forms ---------- */
.label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); margin: 0 0 6px 4px; }
.input, .textarea, .select {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--foreground);
  background: var(--background); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: #64748b; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,92,32,.16); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.select { appearance: none; cursor: pointer; }

/* ---------- Layout helpers ---------- */
.center-page { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 16px; }
.max-sm { width: 100%; max-width: 384px; }
.footer { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted-foreground); flex-wrap: wrap; }
.footer .chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px 3px 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); }
.footer .chip img { width: 22px; height: 22px; border-radius: 999px; }

/* ---------- Toast ---------- */
#toast-wrap { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--card); border: 1px solid var(--border); color: var(--foreground);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: tin .18s ease-out;
  max-width: 92vw;
}
.toast.ok { border-color: rgba(34,197,94,.45); }
.toast.err { border-color: rgba(244,63,94,.5); color: #fda4af; }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3,7,18,.72); backdrop-filter: blur(4px); }
.modal-box { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.modal-box h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.01em; }
.modal-box p { margin: 0 0 14px; font-size: 13px; color: var(--muted-foreground); }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ---------- Markdown ---------- */
.md { font-size: 14px; line-height: 1.7; color: #e5e7eb; word-wrap: break-word; }
.md h1, .md h2, .md h3, .md h4 { letter-spacing: -.02em; line-height: 1.28; margin: 1.3em 0 .5em; color: #fff; }
.md h1 { font-size: 22px; } .md h2 { font-size: 18px; } .md h3 { font-size: 15.5px; } .md h4 { font-size: 14px; }
.md h1:first-child, .md h2:first-child { margin-top: 0; }
.md p { margin: .6em 0; }
.md ul, .md ol { margin: .6em 0; padding-left: 1.35em; }
.md li { margin: .25em 0; }
.md code { background: var(--muted); padding: 1.5px 5px; border-radius: 5px; font-size: 12.5px; font-family: ui-monospace, "SF Mono", Consolas, monospace; color: #ffb08c; }
.md pre { background: #0d1428; border: 1px solid var(--border); border-radius: 10px; padding: 12px; overflow-x: auto; margin: .8em 0; }
.md pre code { background: none; padding: 0; color: #d5dbea; font-size: 12.5px; }
.md blockquote { margin: .8em 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--primary); color: var(--muted-foreground); }
.md table { width: 100%; border-collapse: collapse; margin: .8em 0; font-size: 13px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; }
.md th { background: var(--muted); font-weight: 700; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }
.md a { color: var(--primary); text-decoration: underline; }

/* ---------- Spinner ---------- */
.spin { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 999px; animation: sp .7s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--muted) 25%, #2a3350 37%, var(--muted) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
