: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; color: var(--ink);
  text-decoration: none; display: inline-block; cursor: pointer; }
.brand span { background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
  font-size: 14px; font-weight: 600; text-decoration: none; margin-bottom: 4px; }
.back-link:hover { color: var(--brand); }
.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; }

/* Kartu jenis dokumen yang bisa diklik (landing) — beraksen biru + efek hover */
.jcard { display: block; text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 22px; color: inherit; position: relative; overflow: hidden;
  box-shadow: 0 6px 20px rgba(30, 30, 60, .07);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.jcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); opacity: 0; transition: opacity .2s ease; }
.jcard:hover { transform: translateY(-6px); border-color: var(--brand);
  box-shadow: 0 18px 42px rgba(79, 70, 229, .22); }
.jcard:hover::before { opacity: 1; }
.jcard .ico { display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 14px; background: #eef0ff; font-size: 27px;
  margin-bottom: 14px; transition: transform .2s ease, background .2s ease; }
.jcard:hover .ico { transform: scale(1.08) rotate(-4deg); background: #e4e6ff; }
.jcard h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.jcard p { color: var(--muted); margin: 0; font-size: 15px; }
.jcard .go { display: inline-block; margin-top: 14px; font-weight: 700; font-size: 14px;
  color: var(--brand); opacity: 0; transform: translateX(-6px);
  transition: opacity .2s ease, transform .2s ease; }
.jcard:hover .go { opacity: 1; transform: translateX(0); }
@media (hover: none) { .jcard .go { opacity: 1; transform: none; } }

/* 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; gap: 10px; min-height: 60px; }
.app-head .brand { margin-right: auto; }
.kuota-badge { background: #eef0ff; color: var(--brand); padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) {
  .app-head .container { flex-wrap: wrap; padding-block: 8px; gap: 8px 10px; }
  .app-head .brand { font-size: 18px; }
  .kuota-badge { order: 3; flex-basis: 100%; text-align: center; }
}
.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; }
/* Dashboard sambutan */
.dash-hi { font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 18px; }
.dash-stat { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px; text-align: center; }
.dash-stat b { display: block; font-size: 22px; color: var(--brand); line-height: 1.2; }
.dash-stat b span { font-size: 13px; color: var(--muted); font-weight: 600; }
.dash-stat small { color: var(--muted); font-size: 12px; }
.dash-tips { background: #eef0ff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.dash-tips-h { font-weight: 700; margin-bottom: 6px; }
.tips-list { margin: 0; padding-left: 18px; font-size: 14px; }
.tips-list li { margin-bottom: 6px; }
.doc-prog { height: 6px; background: var(--line); border-radius: 99px; margin: 8px 0 4px; overflow: hidden; }
.doc-prog-bar { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 99px; transition: width .3s; }
.doc-prog-bar.done { background: linear-gradient(90deg, #16a34a, #22c55e); }
@media (max-width: 560px) { .dash-stats { grid-template-columns: repeat(2, 1fr); } }
/* Kartu pilih jenis dokumen */
.jenis-cat { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.jenis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; align-items: stretch; }
.jenis-card { text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 14px 13px; cursor: pointer; background: #fff; font-family: inherit; transition: .15s; display: flex; flex-direction: column; align-items: center; }
.jenis-card:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(79,70,229,.14); transform: translateY(-1px); }
.jenis-card .ic { font-size: 22px; }
.jenis-card b { display: block; font-size: 14px; margin: 4px 0 2px; color: var(--ink); }
.jenis-card small { color: var(--muted); font-size: 12px; line-height: 1.35; display: block; }
@media (max-width: 560px) { .jenis-grid { grid-template-columns: 1fr; } }
.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-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ak-ava { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.ak-head b { font-size: 15px; }
.ak-head small { opacity: .9; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.ak-online { width: 7px; height: 7px; border-radius: 50%; background: #7CFFB2; box-shadow: 0 0 0 3px rgba(124,255,178,.3); display: inline-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: 86%; padding: 11px 14px; border-radius: 16px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 2px 8px rgba(30,30,60,.06); animation: akpop .18s ease; }
@keyframes akpop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ak-msg.bot { background: var(--card); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 5px; }
.ak-msg.me { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; box-shadow: 0 4px 12px rgba(79,70,229,.28); }
.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: 9px; padding: 12px; border-top: 1px solid var(--line); background: var(--card); align-items: center; }
.ak-input textarea { flex: 1 1 auto; min-width: 0; resize: none; height: 46px; max-height: 100px; border: 1px solid var(--line);
  border-radius: 23px; padding: 12px 16px; font-size: 15px; line-height: 1.4; font-family: inherit; background: var(--bg); box-sizing: border-box; }
.ak-input textarea:focus { outline: none; border-color: var(--brand); background: #fff; }
.ak-input button { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: none;
  display: grid; place-items: center; box-shadow: 0 4px 12px rgba(79,70,229,.35); transition: .15s; }
.ak-input button:hover { filter: brightness(1.06); }
.ak-input button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
@media (max-width: 560px) {
  .ak-panel { inset: 0; width: auto; height: auto; border-radius: 22px 22px 0 0; }
  /* HP: ikon lingkaran saja (tidak menutupi konten) */
  .ak-fab { right: 16px; bottom: 16px; width: 54px; height: 54px; padding: 0; border-radius: 50%; justify-content: center; gap: 0; }
  .ak-fab-label { display: none; }
}

@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; }
}
