/* ==========================================================
   bisagratis.com — sistem desain (glassmorphism)
   Latar gradasi lembut + permukaan kaca transparan dengan blur.
   Dipakai semua halaman. Ikon: shared/js/icons.js (Lucide).
   ========================================================== */

/* Plus Jakarta Sans untuk antarmuka, Poppins untuk tulisan logo */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Poppins:wght@700&display=swap');

:root {
  /* Warna merek (diambil dari logo: hijau toska ke biru) */
  --brand: #10B981;
  --brand-dark: #047857;
  --brand-2: #14B8A6;
  --brand-3: #2563EB;
  --logo-blue: #1E44B0;
  --logo-green: #0FBF91;
  --brand-soft: rgba(16, 185, 129, .12);
  --grad: linear-gradient(135deg, #1ED69A 0%, #14B8A6 42%, #2563EB 100%);
  --grad-soft: linear-gradient(135deg, rgba(16, 185, 129, .16), rgba(37, 99, 235, .14));

  /* Teks */
  --ink: #0F172A;
  --muted: #64748B;

  /* Kaca */
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-border: rgba(255, 255, 255, .75);
  --line: rgba(148, 163, 184, .28);
  --blur: blur(18px) saturate(160%);
  --shadow: 0 12px 32px -14px rgba(15, 23, 42, .22), 0 2px 6px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .32);

  --bg: #F3F6FB;
  --card: var(--glass);
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 64px;
  --wa: #22C55E;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: transparent;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Latar gradasi + "blob" warna yang membuat efek kaca terlihat */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(42rem 42rem at 8% -12%, rgba(16, 185, 129, .30), transparent 60%),
    radial-gradient(38rem 38rem at 100% 0%, rgba(99, 102, 241, .24), transparent 62%),
    radial-gradient(44rem 44rem at 55% 115%, rgba(20, 184, 166, .22), transparent 60%),
    radial-gradient(30rem 30rem at 0% 80%, rgba(236, 72, 153, .10), transparent 60%),
    var(--bg);
  pointer-events: none;
}

[hidden] { display: none !important; }

/* Teks hanya untuk pembaca layar & mesin pencari */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; }
a { color: var(--brand-dark); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.micro { font-size: 11.5px; color: var(--muted); }

/* Ikon SVG (shared/js/icons.js) */
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  vertical-align: -.2em;
}

/* Permukaan kaca yang bisa dipakai ulang */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* ---------- Header (dibuat oleh shared/js/layout.js) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 clamp(14px, 3vw, 28px);
  background: rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 6px 24px -18px rgba(15, 23, 42, .35);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.03em;
  white-space: nowrap;
}
/* Ikon logo (assets/brand/logo-mark.png) */
.logo-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(16, 185, 129, .25));
}
/* Tulisan logo: "bisa" biru, "gratis" hijau seperti logo asli */
.logo-text {
  font-family: Poppins, var(--font);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.01em;
  color: var(--logo-blue);
}
.logo-text span { color: var(--logo-green); }
.logo small {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 24px;
  padding: 28px 16px 36px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, .45);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-top: 1px solid var(--glass-border);
}
.site-footer a { color: var(--brand-dark); text-decoration: none; font-weight: 600; }
.footer-logo { display: block; width: 190px; height: auto; margin: 0 auto 8px; }
.site-footer p { margin: 4px 0; }
.footer-donate {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #f97316 !important;
  font-weight: 700 !important;
}
.footer-donate .icon { width: 15px; height: 15px; stroke: #f97316; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary {
  background: var(--grad);
  background-size: 140% 140%;
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(16, 185, 129, .75);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(16, 185, 129, .85); }
.btn-ghost {
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-color: var(--glass-border);
  color: var(--ink);
  box-shadow: 0 2px 8px -4px rgba(15, 23, 42, .15);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .85); border-color: rgba(16, 185, 129, .35); }
.btn-wa { background: var(--wa); color: #fff; margin-bottom: 10px; box-shadow: 0 10px 22px -10px rgba(34, 197, 94, .7); }
.btn-donate {
  background: linear-gradient(135deg, #f97316, #ec4899);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(249, 115, 22, .65);
  font-weight: 700;
}
.btn-donate:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(249, 115, 22, .75); }
.btn-donate .icon { stroke: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--brand-dark); font-weight: 700; text-decoration: underline;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--glass-border);
  font-size: 18px;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--ink);
}
.icon-btn:hover { background: #fff; }

/* ---------- Modal setelah unduh (shared/js/download.js) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 28px 24px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.modal-card h2 { font-size: 21px; margin: 14px 0 12px; }
.modal-card h3 { font-size: 14.5px; margin: 18px 0 10px; text-align: left; }
.check {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  border-radius: 18px;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 26px -10px rgba(16, 185, 129, .8);
}
.check .icon { width: 30px; height: 30px; stroke-width: 2.6; }
.modal-actions { display: grid; gap: 8px; margin-top: 18px; }
.modal-actions .btn-wa { margin-bottom: 0; }
.donate-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 2px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(249, 115, 22, .08), rgba(236, 72, 153, .08));
  border: 1px solid rgba(249, 115, 22, .2);
  border-radius: 12px;
  text-align: left;
}
.donate-block > .icon { flex-shrink: 0; width: 22px; height: 22px; color: #f97316; stroke: #f97316; }
.donate-label { margin: 0 0 8px; font-size: 13px; color: var(--muted); line-height: 1.4; }

/* ---------- Zona Sponsor ---------- */
.sponsor-zone {
  box-sizing: border-box;
  width: min(760px, calc(100% - 24px));
  margin: 16px auto;
  padding: 8px;
  background: rgba(255,255,255,.45);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}
#sponsor-home:empty { display: none; }
.sponsor-zone-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.sponsor-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.sponsor-banner-link { display: block; min-width: 0; }
.sponsor-banner {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.modal-sponsor {
  display: block;
  margin-top: 14px;
  text-align: left;
  text-decoration: none;
}
.modal-sponsor[hidden] { display: none; }
.sponsor-open {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: min(760px, calc(100% - 24px));
  margin: 16px auto;
  padding: 14px 16px;
  border: 1.5px dashed rgba(5, 150, 105, .5);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .55);
  text-align: center;
  text-decoration: none;
  color: var(--ink);
}
.sponsor-open strong { font-size: 15px; font-weight: 800; }
.sponsor-open > span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.sponsor-open .sp-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.sponsor-open .sp-wa .icon { width: 14px; height: 14px; }
.modal-sponsor.sponsor-open { width: 100%; margin: 14px 0 0; padding: 12px; }
.modal-sponsor .sponsor-label { display: block; margin-bottom: 6px; }
.modal-sponsor img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  background: #fff;
}
.sponsor-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  opacity: .75;
  transition: opacity .15s;
}
.sponsor-cta:hover { opacity: 1; color: var(--brand-dark); }
.sponsor-cta .icon { width: 13px; height: 13px; }

@media (max-width: 767px) {
  .sponsor-zone { margin: 14px auto; padding: 8px; }
  .sponsor-zone-top { flex-wrap: wrap; }
  .sponsor-cta { white-space: normal; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, .86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 11px 18px;
  border-radius: 14px;
  z-index: 60;
  max-width: 90vw;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
}

/* ---------- Halaman alat (judul, panel, panduan) ---------- */
.tool-page { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }
.tool-head { text-align: center; padding: 36px 0 22px; max-width: 720px; margin: 0 auto; }
.tool-head h1 { font-size: clamp(26px, 5vw, 40px); font-weight: 800; letter-spacing: -.03em; }
.tool-head p { color: var(--muted); margin-top: 10px !important; font-size: 15.5px; }
.panel {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel h3 { font-size: 14px; margin: 0 0 10px; }
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 180px;
  padding: 22px;
  border: 2px dashed rgba(16, 185, 129, .35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .45);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: rgba(16, 185, 129, .08); }
.dropzone.drag { transform: scale(1.01); }
.dropzone .dz-icon {
  width: 52px;
  height: 52px;
  padding: 12px;
  border-radius: 16px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(16, 185, 129, .8);
}
.dropzone strong { font-size: 16px; }
.field-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field select, .field input[type="number"] {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .8);
}
.field select:focus, .field input:focus, textarea:focus, input:focus {
  outline: 2px solid rgba(16, 185, 129, .35);
  outline-offset: 1px;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .2s, color .2s, box-shadow .2s;
}
.opt-chip:hover { background: rgba(255, 255, 255, .9); }
.opt-chip[aria-pressed="true"] {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(16, 185, 129, .9);
}
.opt-chip .dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); }

.guide {
  max-width: 760px;
  margin: 36px auto 0;
  padding: 24px 26px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.guide h2 { font-size: 20px; margin: 18px 0 8px; }
.guide h2:first-child { margin-top: 0; }
.guide p, .guide li { color: #334155; font-size: 15px; line-height: 1.7; }
.guide ol, .guide ul { padding-left: 20px; }

/* ---------- Bantuan AI Mengambang di Kanvas (shared/js/ai.js) ---------- */
.ai-float {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px;
  max-width: calc(100vw - 20px);
  border-radius: 14px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}
.ai-float-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ai-float-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0 4px; font-size: 12px; font-weight: 800; color: var(--brand-dark);
}
.ai-float-tag .icon { width: 14px; height: 14px; }
.ai-float .btn-sm { padding: 5px 10px; font-size: 12px; }
.ai-float-prompt { display: flex; gap: 6px; align-items: center; }
.ai-float-input {
  width: min(260px, 60vw);
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.ai-float-input:focus { outline: none; border-color: var(--brand); }

@media (max-width: 767px) {
  .modal-card { padding: 22px 16px; }
  .toast { bottom: 100px; }
  .topbar { height: auto; min-height: var(--header-h); flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .logo { font-size: 17px; gap: 7px; }
  .logo-mark { width: 28px; height: 28px; }
  .logo-text { font-size: 17px; }
  .logo small { display: none; }
  .topbar-actions { gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
  .topbar-actions .btn-sm { padding: 5px 9px; font-size: 12px; gap: 4px; }
  .topbar-actions .btn-sm .icon { width: 14px; height: 14px; }
  .guide { padding: 18px 16px; margin-left: 12px; margin-right: 12px; }
}

@media (max-width: 420px) {
  .topbar-actions .btn-sm .icon { display: none; }
}

/* Kurangi efek berat untuk pengguna yang meminta animasi minimal */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
