/* Patungan.id theme overlay: memakai warna logo (hijau #8cc63f, biru #29abe2, biru tua #2596be).
   Dimuat setelah main.css sehingga bisa menimpa gaya lama tanpa mengubah bundle JS. */

:root {
  --pt-blue: #2596be;
  --pt-blue-light: #29abe2;
  --pt-green: #8cc63f;
  --pt-ink: #1f2d3a;
  --pt-muted: #5b6b78;
  --pt-line: #e3eaef;
  --pt-bg: #f7fafc;
  --pt-radius: 16px;
}

html, body {
  background: var(--pt-bg);
  color: var(--pt-ink);
  -webkit-text-size-adjust: 100%;
}

body { font-family: "Signika", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* Tombol utama: bentuk pil dengan kontras yang jelas */
button, a[role="button"] {
  border-radius: 999px;
  transition: background-color .2s ease, transform .15s ease, box-shadow .2s ease;
}
button:not(:disabled):active { transform: scale(.98); }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--pt-blue-light);
  outline-offset: 2px;
}

/* Kartu dan panel: sudut lebih lembut, bayangan halus */
.bg-white {
  border-radius: var(--pt-radius);
}
.shadow, .shadow-sm, .shadow-md {
  box-shadow: 0 2px 10px rgba(31, 45, 58, .08);
}
.shadow-lg, .shadow-xl, .shadow-2xl {
  box-shadow: 0 8px 24px rgba(31, 45, 58, .12);
}

/* Header tetap terlihat saat digulir */
header, nav {
  -webkit-backdrop-filter: saturate(1.2) blur(6px);
  backdrop-filter: saturate(1.2) blur(6px);
}

/* Ruang aman untuk bottom navigation di mobile */
@media (max-width: 767px) {
  body { padding-bottom: 72px; }
  .max-sm\:px-4, .px-4 { padding-left: 16px; padding-right: 16px; }
  h1 { line-height: 1.25; }
}

/* Tautan dan teks sekunder lebih mudah dibaca */
a:hover { color: var(--pt-blue); }
.text-gray-500, .text-gray-600 { color: var(--pt-muted); }

/* Gradasi hero memakai dua warna logo */
.from-primary { --tw-gradient-from: var(--pt-blue-light) var(--tw-gradient-from-position); }
.to-primary2 { --tw-gradient-to: var(--pt-blue) var(--tw-gradient-to-position); }

/* Batas kartu yang lebih rapi */
.border-gray-200, .border-gray-100 { border-color: var(--pt-line); }

/* ===== Micro-interaksi ===== */

/* Masuk halus saat halaman dibuka */
/* Hanya opacity: transform di sini akan membuat elemen fixed (mis. bottom nav) ikut bergeser */
@keyframes pt-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
main > *, section > * {
  animation: pt-fade .5s ease both;
}
main > *:nth-child(2), section > *:nth-child(2) { animation-delay: .06s; }
main > *:nth-child(3), section > *:nth-child(3) { animation-delay: .12s; }
main > *:nth-child(4), section > *:nth-child(4) { animation-delay: .18s; }

/* Kartu terangkat saat disentuh/di-hover */
.bg-white, [class*="rounded-"][class*="border"] {
  transition: transform .25s ease, box-shadow .25s ease;
}
@media (hover: hover) {
  .bg-white:hover, [class*="rounded-"][class*="border"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(31, 45, 58, .12);
  }
}

/* Tombol: sedikit membesar saat hover, menekan saat diklik */
button:not(:disabled), a[role="button"] {
  transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease;
}
@media (hover: hover) {
  button:not(:disabled):hover, a[role="button"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 150, 190, .25);
  }
}
button:not(:disabled):active { transform: scale(.96); }

/* Ikon/gambar kecil bergerak sedikit saat disentuh */
a:hover img, button:hover img {
  transform: scale(1.05);
  transition: transform .3s ease;
}

/* Bar progres (jika ada) bergerak saat muncul */
@keyframes pt-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
[role="progressbar"] > div, .progress > div {
  transform-origin: left center;
  animation: pt-grow 1s ease-out both;
}

/* Hormati pengguna yang mematikan animasi */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Lebih ramah: mobile ===== */
@media (max-width: 767px) {
  /* Area sentuh minimal 44px agar mudah ditekan dengan jari */
  button, a[role="button"], [role="button"] { min-height: 44px; }

  /* Input 16px supaya browser iOS tidak memperbesar layar saat diketik */
  input, select, textarea { font-size: 16px; border-radius: 12px; }

  /* Latar atas yang hangat, lalu pudar ke warna netral */
  body {
    background: linear-gradient(180deg, #e6f6fc 0, var(--pt-bg) 280px) var(--pt-bg);
    font-size: 16px;
    line-height: 1.6;
  }

  /* Kartu lebih lapang dan lebih lembut */
  .bg-white { border-radius: 20px; }

  /* Teks judul lebih tegas dan tidak terlalu sempit */
  h1, h2 { letter-spacing: -.01em; }
}

/* ===== Lebih ramah: desktop ===== */
@media (min-width: 768px) {
  body {
    background: linear-gradient(180deg, #e6f6fc 0, var(--pt-bg) 420px) var(--pt-bg);
    font-size: 16.5px;
    line-height: 1.65;
  }

  input, select, textarea { border-radius: 12px; }

  /* Kartu lebih besar dan lapang */
  .bg-white { border-radius: 20px; }

  /* Tautan dan tombol punya respons hover yang jelas */
  a { transition: color .2s ease; }
  a:hover { color: var(--pt-blue); text-decoration: none; }
}

/* ===== Mobile gaya amalsholeh.com (hanya layar HP; desktop tidak berubah) ===== */
@media (max-width: 767px) {
  /* Kategori: 4 ikon bulat sejajar, tanpa kotak besar */
  section[class*="f7f5fa"] .grid.grid-cols-2 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }
  section[class*="f7f5fa"] .grid.grid-cols-2 > a {
    background: transparent !important;
    box-shadow: none !important;
    padding: 4px 0 !important;
  }
  section[class*="f7f5fa"] .grid.grid-cols-2 > a:hover { transform: none !important; }
  section[class*="f7f5fa"] .grid.grid-cols-2 > a img {
    width: 56px !important;
    height: 56px !important;
    padding: 10px;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(31, 45, 58, .10);
  }
  section[class*="f7f5fa"] .grid.grid-cols-2 > a h3 {
    font-size: 12px !important;
    margin-top: 6px;
    color: var(--pt-ink);
  }

  /* Bottom nav: lima menu rata seperti amalsholeh, tanpa tombol tengah yang menonjol */
  .fixed.bottom-0 .shadow-xl {
    box-shadow: 0 -2px 10px rgba(31, 45, 58, .08) !important;
    border-top: 1px solid var(--pt-line);
  }
  .fixed.bottom-0 .relative.-mt-10 { margin-top: 0 !important; }
  .fixed.bottom-0 .relative.-mt-10 > div {
    width: 36px !important;
    height: 36px !important;
    background: transparent !important;
    color: #9ca3af !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  .fixed.bottom-0 .relative.-mt-10::after {
    content: "Beranda";
    display: block;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin-top: 2px;
  }
}

/* Kolom pencarian di header, hanya di mobile (ditambahkan oleh script di index.html) */
.pt-mobile-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 0 14px;
  height: 44px;
  background: #f4f7f9;
  border: 1px solid var(--pt-line);
  border-radius: 999px;
  color: #7b8a96;
}
.pt-mobile-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--pt-ink);
  outline: none;
  box-shadow: none !important;
}
.pt-mobile-search:focus-within {
  border-color: var(--pt-blue-light);
  box-shadow: 0 0 0 4px rgba(41, 171, 226, .18);
}
@media (min-width: 768px) {
  .pt-mobile-search { display: none; }
}

/* Input yang sedang difokus diberi cincin biru yang ramah */
input:focus, select:focus, textarea:focus {
  border-color: var(--pt-blue-light);
  box-shadow: 0 0 0 4px rgba(41, 171, 226, .18);
  outline: none;
}
