/* ============================================================
   legal.css
   Modal Syarat & Ketentuan / Kebijakan Privasi / SLA, footer halaman
   login, dan bottom bar aplikasi. Memakai token warna dari style.css
   (--primary, --border, --muted, --text) dan pola .modal-overlay /
   .modal-box yang sudah ada. Dimuat setelah style-patch.css.
   ============================================================ */

/* ---------- Tombol tautan (membuka modal, bukan navigasi) ---------- */
.legal-link {
  background: none; border: none; padding: 2px 0; margin: 0;
  font: inherit; font-size: inherit; color: inherit; cursor: pointer;
  text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s;
}
.legal-link:hover { color: var(--primary); text-decoration-color: currentColor; }
.legal-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }

/* ---------- Footer halaman login ---------- */
.login-legal {
  margin-top: 18px; text-align: center; font-size: 12px; line-height: 1.6; color: #94a3b8;
}
.login-legal-links { display: flex; flex-wrap: nowrap; justify-content: center; gap: 4px 14px; margin-top: 8px; font-size: 12px; }
.login-legal-links .legal-link { white-space: nowrap; }
.login-legal-copy { margin-top: 8px; font-size: 11px; color: #94a3b8; }
/* Kartu login sempit: dua bagian teks hak cipta tampil bertumpuk, pemisah "|" disembunyikan. */
.login-legal-copy span { display: block; }
.login-legal-copy .lg-sep { display: none; }

/* ---------- Bottom bar aplikasi ---------- */
.app-bottombar {
  margin-top: 36px; padding: 14px 0 6px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; font-size: 12px; color: var(--muted);
}
.app-bottombar-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* ---------- Modal ---------- */
.modal-box.legal-box {
  display: flex; flex-direction: column; overflow: hidden;
  max-height: 90vh; padding-bottom: 12px;
}
.legal-box .modal-head { margin-bottom: 10px; flex: 0 0 auto; }

.legal-tabs {
  flex: 0 0 auto; display: flex; gap: 4px; margin: 0 -4px;
  border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
}
.legal-tabs::-webkit-scrollbar { display: none; }
.legal-tab {
  background: none; border: none; cursor: pointer; white-space: nowrap;
  padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600; color: var(--muted);
  transition: color .15s, border-color .15s;
}
.legal-tab:hover { color: var(--text); }
.legal-tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.legal-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 6px; }

.legal-panel {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 18px 10px 8px 2px; max-height: 62vh;
  font-size: 13.5px; line-height: 1.7; color: #334155;
}
.legal-panel::-webkit-scrollbar { width: 6px; }
.legal-panel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
.legal-panel:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

.legal-title { font-family: 'Inter', sans-serif; font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; margin: 0; }
.legal-meta { font-size: 12px; color: var(--muted); margin: 4px 0 6px; }

.legal-pasal { margin-top: 22px; }
.legal-h { margin: 0 0 8px; font-family: 'Inter', sans-serif; font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.4; }
.legal-no { display: block; font-size: 11.5px; font-weight: 600; color: var(--primary); margin-bottom: 1px; }

.legal-ol { list-style: none; margin: 0; padding: 0; counter-reset: ay; }
.legal-ay { position: relative; padding-left: 32px; margin-bottom: 8px; counter-increment: ay; max-width: 78ch; }
.legal-ay::before { content: "(" counter(ay) ")"; position: absolute; left: 0; top: 0; color: var(--muted); }
.legal-ol-solo .legal-ay { padding-left: 0; }
.legal-ol-solo .legal-ay::before { content: none; }
.legal-blk { list-style: none; margin: 4px 0 12px; }

.legal-sub { list-style: none; margin: 6px 0 2px; padding: 0; counter-reset: sb; }
.legal-sub li { position: relative; padding-left: 26px; margin-bottom: 4px; counter-increment: sb; }
.legal-sub li::before { content: counter(sb, lower-alpha) "."; position: absolute; left: 0; top: 0; color: var(--muted); }

.legal-tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.legal-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 1.55; }
.legal-tbl th {
  text-align: left; font-weight: 600; color: var(--text); background: #f8fafc;
  padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.legal-tbl td { padding: 9px 12px; vertical-align: top; border-bottom: 1px solid var(--border); }
.legal-tbl tr:last-child td { border-bottom: none; }
.legal-tbl td:first-child { font-weight: 600; color: var(--text); }

.legal-foot {
  flex: 0 0 auto; display: flex; justify-content: flex-end; padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ---------- Layar sempit ---------- */
@media (max-width: 768px) {
  .modal-box.legal-box { overflow: hidden !important; padding-bottom: 16px !important; }
  .legal-panel { max-height: none; padding-right: 4px; font-size: 13px; }
  .legal-tbl th, .legal-tbl td { padding: 8px 10px; }
  .app-bottombar { flex-direction: column; align-items: flex-start; margin-top: 28px; }
}
