:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1a1c2e;
  --muted: #6b7186;
  --line: #e6e8f0;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-ink: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(30, 30, 60, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.nav { position: sticky; top: 0; background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); z-index: 20; }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand span { background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); font-weight: 600; cursor: pointer; font-size: 15px; transition: .15s; }
.btn:hover { border-color: #cfd2e0; }
.btn-primary { background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: var(--brand-ink); border: none; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { color: var(--danger); border-color: #f3c9c9; }

/* Hero */
.hero { text-align: center; padding: 70px 0 40px; }
.pill { display: inline-block; background: #eef0ff; color: var(--brand);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.hero h1 { font-size: 46px; line-height: 1.1; margin: 0 0 16px; letter-spacing: -.03em; }
.hero h1 .grad { background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 auto 26px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero small { display: block; color: var(--muted); margin-top: 16px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 40px 0; }
.stat { text-align: center; }
.stat b { display: block; font-size: 30px; color: var(--brand); }
.stat span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }

/* Sections */
section { padding: 50px 0; }
.eyebrow { text-align: center; color: var(--brand); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; font-size: 13px; }
h2.title { text-align: center; font-size: 32px; margin: 8px 0 30px; letter-spacing: -.02em; }

/* Cards grid */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin: 6px 0 8px; font-size: 18px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.card .ico { font-size: 26px; }

/* Pricing */
.price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.price { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative; }
.price.pop { border-color: var(--brand); box-shadow: 0 10px 40px rgba(79,70,229,.18); }
.price .tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.price h3 { margin: 0 0 6px; }
.price .amt { font-size: 28px; font-weight: 800; }
.price .amt small { font-size: 14px; color: var(--muted); font-weight: 500; }
.price ul { list-style: none; padding: 0; margin: 16px 0; }
.price li { padding: 5px 0; color: var(--muted); font-size: 14px; }
.price li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: 8px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--muted); text-align: center; font-size: 14px; }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; margin: 0 0 4px; text-align: center; }
.auth-card p.sub { text-align: center; color: var(--muted); margin: 0 0 22px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
input, select, textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; font-family: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
textarea { resize: vertical; min-height: 80px; }
.msg { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin: 12px 0; display: none; }
.msg.show { display: block; }
.msg.err { background: #fef2f2; color: var(--danger); }
.msg.ok { background: #f0fdf4; color: var(--ok); }
.center-link { text-align: center; margin-top: 16px; font-size: 14px; }

/* App layout */
.app-head { background: #fff; border-bottom: 1px solid var(--line); }
.app-head .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.kuota-badge { background: #eef0ff; color: var(--brand); padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; }
.app-main { padding: 26px 0; }
.row { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 14px; font-size: 18px; }
.doc-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; cursor: pointer; transition: .15s; }
.doc-item:hover { border-color: var(--brand); }
.doc-item.active { border-color: var(--brand); background: #f8f8ff; }
.doc-item b { display: block; font-size: 14px; }
.doc-item small { color: var(--muted); }
.bab-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.bab-row.done { border-color: #cfe9d5; background: #f6fdf8; }
.bab-row .bab-title { font-weight: 600; font-size: 14px; }
.bab-row .bab-sub { color: var(--muted); font-size: 12px; }
.konten-view { white-space: pre-wrap; font-size: 15px; line-height: 1.75; }
.konten-view h4 { margin: 18px 0 6px; font-size: 15px; }
.tag-status { font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.tag-status.pending { background: #fef3c7; color: var(--warn); }
.tag-status.approved { background: #dcfce7; color: var(--ok); }
.tag-status.rejected { background: #fee2e2; color: var(--danger); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #fff;
  border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hide { display: none !important; }
.muted { color: var(--muted); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }

/* Cegah anak grid memaksa kolom melebar (sumber overflow di mobile) */
.grid > *, .price-grid > *, .stats > * { min-width: 0; }
.hero h1, .lead, h2.title, .card h3, .card p { overflow-wrap: break-word; }

/* ===== Chatbot widget ===== */
.ak-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; align-items: center; gap: 9px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff; border: none; border-radius: 999px; cursor: pointer;
  padding: 13px 20px; font-size: 15px; font-weight: 700; font-family: inherit;
  box-shadow: 0 8px 26px rgba(79,70,229,.4); transition: transform .15s, filter .15s;
}
.ak-fab:hover { transform: translateY(-2px); filter: brightness(1.05); }
.ak-fab .dot { width: 8px; height: 8px; border-radius: 50%; background: #7CFFB2; box-shadow: 0 0 0 3px rgba(124,255,178,.3); }
.ak-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 61;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 40px));
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(30,30,60,.25); display: none; flex-direction: column; overflow: hidden;
}
.ak-panel.open { display: flex; }
.ak-head {
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
.ak-head b { font-size: 15px; }
.ak-head small { opacity: .85; font-size: 12px; display: block; }
.ak-close { background: rgba(255,255,255,.2); border: none; color: #fff; width: 28px; height: 28px;
  border-radius: 8px; cursor: pointer; font-size: 16px; line-height: 1; }
.ak-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.ak-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.ak-msg.bot { background: var(--card); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.ak-msg.me { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ak-msg.typing { color: var(--muted); font-style: italic; }
.ak-form-btn, .ak-signup-btn {
  align-self: flex-start; margin-top: 2px; border: none; cursor: pointer; font-family: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 700;
}
.ak-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--card); }
.ak-input textarea { flex: 1; resize: none; height: 42px; max-height: 100px; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: inherit; }
.ak-input button { background: var(--brand); color: #fff; border: none; border-radius: 10px; width: 44px; cursor: pointer; font-size: 18px; }
.ak-input button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 560px) {
  .ak-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
  .ak-fab { right: 14px; bottom: 14px; padding: 12px 16px; font-size: 14px; }
}

@media (max-width: 860px) {
  .grid-3, .grid-2, .price-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
}

/* Layar HP: semua jadi 1 kolom biar tidak terpotong */
@media (max-width: 620px) {
  .price-grid, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .hero { padding: 46px 0 28px; }
  .hero h1 { font-size: 29px; }
  .hero p.lead { font-size: 16px; }
  .hero .cta { flex-direction: column; }
  .hero .cta .btn { width: 100%; }
  h2.title { font-size: 25px; }
  section { padding: 38px 0; }
  .price .amt { font-size: 26px; }
  .stat b { font-size: 26px; }
  .brand { font-size: 18px; }
  .nav-links { gap: 6px; }
  .nav-links .btn-sm { padding: 6px 11px; font-size: 13px; }
}

/* Layar sangat kecil: navigasi ringkas */
@media (max-width: 380px) {
  .nav-links .btn-sm { padding: 6px 9px; font-size: 12px; }
}
