/* ===== SANDI — BantuGuruYuk ===== */

:root {
  --color-primary: #0ea5a0;
  --color-primary-dark: #0d7a8a;
  --color-danger: #dc2626;
  --color-bg: #f5f7fb;
  --color-surface: #ffffff;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-chip-bg: #e6f7f6;
  --color-chip-active-bg: #0ea5a0;
  --color-chip-active-text: #ffffff;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --radius: 14px;
  --radius-sm: 10px;
}

[data-theme="dark"] {
  --color-bg: #111827;
  --color-surface: #1f2937;
  --color-text: #f3f4f6;
  --color-text-muted: #9ca3af;
  --color-border: #374151;
  --color-chip-bg: #273449;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font-family: inherit; }

/* ===== Auth screens ===== */
.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.brand { margin-bottom: 24px; }
.brand-parent { display: block; font-size: 13px; color: var(--color-text-muted); font-weight: 600; }
.brand-title { margin: 2px 0 6px; font-size: 30px; color: var(--color-primary); letter-spacing: 1px; }
.tagline { margin: 0; font-size: 14px; color: var(--color-text-muted); }

.auth-heading { font-size: 16px; margin: 0 0 14px; }

.pin-input {
  width: 100%;
  text-align: center;
  font-size: 28px;
  letter-spacing: 12px;
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  margin-bottom: 14px;
}
.pin-input:focus { outline: 2px solid var(--color-primary); }

.field-error {
  color: var(--color-danger);
  font-size: 13px;
  margin: -6px 0 12px;
}

/* ===== Buttons ===== */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:active { background: var(--color-primary-dark); }
.btn-secondary { background: var(--color-chip-bg); color: var(--color-text); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-link { background: none; color: var(--color-primary); font-weight: 500; margin-top: 4px; }

.icon-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  line-height: 1;
  color: var(--color-text);
}
.icon-btn:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===== App shell / header ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-logo { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.header-parent { display: block; font-size: 12px; color: var(--color-text-muted); font-weight: 600; }
.header-title { margin: 0; font-size: 22px; color: var(--color-primary); }
.header-actions { display: flex; align-items: center; gap: 2px; position: relative; }

.hamburger-menu {
  position: absolute;
  top: 44px;
  right: 0;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 200px;
  overflow: hidden;
  z-index: 30;
  border: 1px solid var(--color-border);
}
.hamburger-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
}
.hamburger-menu button:not(:last-child) { border-bottom: 1px solid var(--color-border); }
.hamburger-menu button:active { background: var(--color-chip-bg); }

/* ===== Install banner ===== */
.install-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  font-size: 13px;
  max-width: 720px;
  margin: 0 auto;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.install-banner span { flex: 1; }
.install-banner button { border: none; border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.install-banner .btn-install { background: #fff; color: var(--color-primary-dark); }
.install-banner .btn-install-close { background: rgba(255,255,255,0.2); color: #fff; padding: 7px 10px; }

.view {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 20px 132px;
}

.greeting { font-size: 15px; color: var(--color-text-muted); margin: 4px 0 16px; }

.search-bar input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 15px;
}

.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 0;
  scrollbar-width: none;
}
.category-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: none;
  background: var(--color-chip-bg);
  color: var(--color-text);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip-active {
  background: var(--color-chip-active-bg);
  color: var(--color-chip-active-text);
}

.section-label {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 8px 0 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ===== Account cards ===== */
.account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border: none;
  text-align: left;
  width: 100%;
}

.account-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex: none;
}

.account-info { flex: 1; min-width: 0; }
.account-service { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.account-username { font-size: 13px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-fav-star { color: #f59e0b; font-size: 13px; }
.account-chevron { color: var(--color-text-muted); font-size: 18px; }

/* ===== Empty states ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--color-text-muted);
}
.empty-icon { font-size: 44px; margin-bottom: 10px; }
.empty-title { font-weight: 600; color: var(--color-text); margin: 0 0 6px; }
.empty-desc { font-size: 14px; margin: 0 0 16px; }

/* ===== Promo ticker (self-promo produk BantuGuruYuk lain) ===== */
.ticker-wrap {
  position: fixed;
  left: 0; right: 0;
  bottom: 58px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  overflow: hidden;
  z-index: 19;
  border-top: 1px solid rgba(255,255,255,0.3);
}
.ticker-scroll { overflow: hidden; white-space: nowrap; display: flex; width: 100%; }
.ticker-content {
  display: inline-block;
  white-space: nowrap;
  padding: 7px 0;
  animation: ticker-scroll-anim 28s linear infinite;
  text-decoration: none;
  color: #1e293b;
}
.ticker-content:hover { animation-play-state: paused; }
@keyframes ticker-scroll-anim {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
.ticker-link { display: inline-block; margin-right: 22px; font-size: 12.5px; font-weight: 600; }
.ticker-link span {
  background: #dc2626;
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  margin-left: 6px;
  font-size: 11.5px;
  font-weight: 700;
}

/* ===== Bottom nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  z-index: 20;
}
.nav-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--color-text-muted);
  font-size: 11px;
  padding: 6px 0;
  cursor: pointer;
}
.nav-btn.nav-active { color: var(--color-primary); }
.nav-icon { font-size: 20px; }

/* ===== FAB ===== */
.fab {
  position: fixed;
  right: 20px;
  bottom: 114px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 28px;
  border: none;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
  cursor: pointer;
  z-index: 21;
  line-height: 1;
}

/* ===== Settings ===== */
.settings-group {
  background: var(--color-surface);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.settings-group-title {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
  padding: 12px 16px 6px;
}
.settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  border-top: 1px solid var(--color-border);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}
.settings-row select { border: none; background: none; color: var(--color-text); font-size: 14px; }
.settings-row-danger { color: var(--color-danger); }
.about-text { padding: 4px 16px 0; margin: 0; font-size: 14px; }
.about-version { padding: 4px 16px 12px; margin: 0; font-size: 13px; color: var(--color-text-muted); }
.disclaimer {
  margin: 0;
  padding: 12px 16px 16px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  line-height: 1.5;
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.modal-sheet {
  background: var(--color-surface);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 560px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: var(--radius); max-height: 80vh; }
}
.modal-sheet-small { border-radius: var(--radius); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 8px;
}
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 8px 18px 20px; }
.modal-body h2 { margin: 0 0 8px; font-size: 17px; }
.modal-body p { color: var(--color-text-muted); font-size: 14px; line-height: 1.5; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 14px 0 6px;
}
.field-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
}
.password-field { position: relative; display: flex; align-items: center; }
.password-field .field-input { padding-right: 44px; }
.password-field .icon-btn { position: absolute; right: 4px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 4px;
  font-size: 14px;
  cursor: pointer;
}

/* ===== Detail modal ===== */
.detail-row { padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.detail-row:last-of-type { border-bottom: none; }
.detail-label { display: block; font-size: 12px; color: var(--color-text-muted); margin-bottom: 4px; text-transform: uppercase; }
.detail-value-row { display: flex; align-items: center; gap: 6px; }
.detail-value { font-size: 15px; word-break: break-all; flex: 1; }
.detail-link { color: var(--color-primary); text-decoration: none; }
.detail-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.detail-actions .btn { flex: 1; min-width: 90px; }

.confirm-actions { display: flex; gap: 10px; margin-top: 16px; }
.confirm-actions .btn { flex: 1; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .account-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}
