/* Nasab — minimal design tokens (auto dark mode via OS preference) */
:root {
  --bg: #f0faf7;
  --surface: #ffffff;
  --surface-2: #e8f7f2;
  --text: #0f2f2a;
  --text-muted: #5a7a74;
  --border: #c5e4db;
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-soft: #ccfbf1;
  --accent: #059669;
  --danger: #e11d48;
  --danger-soft: #ffe4e6;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --shadow: 0 1px 2px rgb(15 47 42 / 0.06), 0 8px 24px rgb(15 118 110 / 0.08);
  --ring: rgb(15 118 110 / 0.35);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1f1c;
    --surface: #122925;
    --surface-2: #1a3530;
    --text: #e7f6f2;
    --text-muted: #8fb3ab;
    --border: #234840;
    --primary: #2dd4bf;
    --primary-hover: #5eead4;
    --primary-soft: #134e4a;
    --accent: #34d399;
    --danger: #fb7185;
    --danger-soft: #4c0519;
    --warn: #fbbf24;
    --warn-soft: #451a03;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 8px 28px rgb(0 0 0 / 0.35);
    --ring: rgb(45 212 191 / 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Outfit", ui-sans-serif, system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.font-display { font-family: "Fraunces", Georgia, serif; }

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

.page-shell {
  margin: 0 auto;
  display: flex;
  min-height: 100vh;
  max-width: 32rem;
  flex-direction: column;
  padding: 1rem 1rem 6rem;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.field {
  width: 100%;
  border-radius: 0.875rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  min-height: 2.75rem;
}

.field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

.btn-primary {
  display: block;
  width: 100%;
  border-radius: 0.875rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  text-align: center;
  border: none;
  cursor: pointer;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-ghost {
  display: block;
  width: 100%;
  border-radius: 0.875rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-ghost:hover { background: var(--surface-2); }

.banner {
  margin-bottom: 0.9rem;
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
}

.banner-error { background: var(--danger-soft); color: var(--danger); }
.banner-success { background: var(--primary-soft); color: var(--text); }
.banner-info { background: var(--warn-soft); color: var(--warn); }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-verified { background: var(--primary-soft); color: var(--primary); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.brand-tagline { font-size: 0.75rem; color: var(--text-muted); }

.card-list { display: flex; flex-direction: column; gap: 0.6rem; }

.member-card, .timeline-item {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  padding: 0.85rem 1rem;
}

.member-name { font-weight: 700; font-size: 0.95rem; }
.member-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.timeline-title { font-weight: 700; font-size: 0.9rem; }
.timeline-date { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.timeline-summary { font-size: 0.85rem; color: var(--text-muted); }

.source-tag {
  display: inline-flex;
  border-radius: 0.4rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--primary);
  flex-shrink: 0;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.menu-tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-radius: 1.1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
}

.menu-tile-title { font-weight: 700; font-size: 0.95rem; }
.menu-tile-sub { font-size: 0.75rem; color: var(--text-muted); }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
}

.bottom-nav-inner {
  margin: 0 auto;
  max-width: 32rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.nav-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  border-radius: 0.75rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.nav-link.active { color: var(--primary); }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 1.5rem 1rem;
}

.password-field { position: relative; }

.pwa-install-banner {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  animation: fade-up 0.35s ease-out both;
}

body:not(:has(.bottom-nav)) .pwa-install-banner {
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

.pwa-install-text {
  flex: 1;
  min-width: 0;
}

.pwa-install-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.pwa-install-body {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.pwa-install-actions {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.pwa-install-btn {
  border: none;
  border-radius: 0.75rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.45rem 0.85rem;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}

.pwa-install-btn:hover {
  background: var(--primary-hover);
}

.pwa-install-btn:active {
  transform: scale(0.98);
}

.pwa-install-dismiss {
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.35rem;
  white-space: nowrap;
}

.pwa-install-dismiss:hover {
  color: var(--text);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-install-banner {
    animation: none;
    transition: none;
  }
}
