/* JannahKu PWA - Tema hijau, mobile-first */

:root {
  --green: #09A408;
  --green-dark: #078306;
  --green-darker: #056104;
  --green-light: #E8F7E8;
  --green-pale: #F3FBF3;
  --text: #1c2422;
  --text-muted: #6b7a75;
  --bg: #f4f6f4;
  --card: #ffffff;
  --border: #e2e8e4;
  --danger: #d64545;
  --amber: #d99a2b;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(9, 92, 8, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

/* ===== Splash ===== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  gap: 14px;
  transition: opacity .3s;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-logo { width: 96px; height: 96px; }
.splash-name { font-size: 26px; font-weight: 700; color: var(--green-dark); letter-spacing: .5px; }
.splash-loading span {
  display: block;
  width: 34px; height: 34px;
  border: 3px solid var(--green-light);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Header ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-header img { width: 34px; height: 34px; border-radius: 8px; background: #fff; }
.app-header .title { font-size: 18px; font-weight: 700; }
.app-header .spacer { flex: 1; }
.app-header .header-right { font-size: 13px; opacity: .9; }

/* ===== Konten ===== */
.page {
  flex: 1;
  padding: 16px;
  padding-bottom: 86px;
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title a { font-size: 12.5px; color: var(--green-dark); text-decoration: none; font-weight: 600; }

/* ===== Kartu ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

/* ===== Login ===== */
.login-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 22px;
  gap: 6px;
  min-height: 100dvh;
}
.login-logo { width: 84px; height: 84px; margin-bottom: 8px; }
.login-title { font-size: 24px; font-weight: 800; color: var(--green-dark); }
.login-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; text-align: center; }
.login-form {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== Form ===== */
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--green); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: filter .15s, transform .05s;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-outline { background: #fff; color: var(--green-dark); border: 1.5px solid var(--green); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }

.form-msg { font-size: 13.5px; padding: 10px 12px; border-radius: 10px; display: none; }
.form-msg.error { display: block; background: #fdecec; color: #a33; }
.form-msg.ok { display: block; background: var(--green-light); color: var(--green-darker); }

.login-alt { margin-top: 16px; font-size: 13.5px; color: var(--text-muted); }
.login-alt a { color: var(--green-dark); font-weight: 700; text-decoration: none; }

/* ===== Home ===== */
.greet-card {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 6px;
  box-shadow: var(--shadow);
}
.greet-card .hi { font-size: 13px; opacity: .9; }
.greet-card .name { font-size: 21px; font-weight: 800; margin-top: 2px; }
.greet-card .dua { margin-top: 10px; font-size: 12.5px; opacity: .92; line-height: 1.5; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.menu-tile .ico {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.menu-tile .label { font-size: 13px; font-weight: 700; }
.menu-tile .sub { font-size: 11px; color: var(--text-muted); }

/* ===== Artikel ===== */
.article-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color .15s;
}
.article-item:hover { border-color: var(--green); }
.article-item .jenis {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--green-darker);
  background: var(--green-light);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
}
.article-item .judul { font-size: 15px; font-weight: 700; line-height: 1.4; }
.article-item .meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.article-item .rating { color: var(--amber); }

.article-detail h1 { font-size: 19px; line-height: 1.35; margin: 8px 0 14px; }
.article-detail .isi { line-height: 1.75; font-size: 14.5px; color: #2c3632; }
.article-detail .isi p { margin-bottom: 12px; }
.article-detail .isi img { max-width: 100%; border-radius: 10px; margin: 8px 0; }
.article-detail .isi h2, .article-detail .isi h3 { margin: 16px 0 8px; }

.paid-note {
  background: #FFF8E6;
  border: 1px solid #EAD092;
  color: #8a6410;
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  margin-top: 10px;
  line-height: 1.5;
}

/* ===== Tips ===== */
.tip-item {
  background: var(--green-pale);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.tip-item .judul { font-size: 14px; font-weight: 700; color: var(--green-darker); }

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
}
.bottom-nav a .ico { font-size: 21px; line-height: 1; }
.bottom-nav a.active { color: var(--green-dark); }

/* ===== Profil ===== */
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0 8px;
}
.avatar {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 25px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-head .who .nama { font-size: 17px; font-weight: 800; }
.profile-head .who .mail { font-size: 12.5px; color: var(--text-muted); word-break: break-all; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.list-row .ico {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.list-row.danger { color: var(--danger); }
.list-row.danger .ico { background: #fdecec; }

/* ===== Umum ===== */
.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 14px;
}
.empty .big { font-size: 40px; margin-bottom: 10px; }
.loading-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.loading-inline span {
  width: 28px; height: 28px;
  border: 3px solid var(--green-light);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

#offline-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--amber);
  color: #fff;
  text-align: center;
  font-size: 12.5px;
  padding: 5px;
  z-index: 50;
}

#install-btn {
  position: fixed;
  right: 16px;
  bottom: 90px;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  z-index: 30;
  animation: pop .3s ease;
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } }

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 100px;
  background: #2c3632;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 60;
  animation: pop .25s ease;
}

.badge-soon {
  display: inline-block;
  background: #eef1ef;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: middle;
}
