/* ============================================================
   Jamii Services – Custom styles over Bootstrap 5
   Brand: Green #0A6E3F  |  Gold #C8981E
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --primary:        #0A6E3F;
  --primary-dark:   #074D2C;
  --primary-light:  #E8F5EE;
  --primary-mid:    #095E36;
  --gold:           #C8981E;
  --gold-light:     #FDF6E3;
  --gold-dark:      #A67D18;
  --surface:        #F7F8FA;
  --border:         #E5E7EB;
  --sidebar-w:      260px;
  --header-h:       56px;
  --shadow-card:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:      0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.07);
  --shadow-lg:      0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.08);
  --radius:         14px;
  --radius-sm:      10px;
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--surface);
  color: #1f2937;
  min-height: 100vh;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Sora', sans-serif; font-weight: 600; }

/* ── Bootstrap overrides ───────────────────────────────────── */
.btn-primary  { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-mid); border-color: var(--primary-mid); }
.btn-primary:active { background: var(--primary-dark); }

.btn-gold     { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; }

.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10,110,63,.12);
}
.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ── Kenya flag strip ──────────────────────────────────────── */
.ke-strip {
  height: 4px;
  background: repeating-linear-gradient(90deg,
    #0A6E3F 0%, #0A6E3F 33.3%,
    #C8981E 33.3%, #C8981E 66.6%,
    #CC0000 66.6%, #CC0000 100%);
}

/* ── Gradient backgrounds ──────────────────────────────────── */
.bg-primary-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  background: #fff;
}
.card-hover { transition: box-shadow .15s, border-color .15s; cursor: pointer; }
.card-hover:hover { box-shadow: var(--shadow-md); border-color: rgba(10,110,63,.25); }

/* ── Status badges ─────────────────────────────────────────── */
.badge-active      { background: #DCFCE7; color: #166534; }
.badge-approved    { background: #DCFCE7; color: #166534; }
.badge-processing  { background: #DBEAFE; color: #1e40af; }
.badge-pending     { background: #FEF3C7; color: #92400e; }
.badge-rejected    { background: #FEE2E2; color: #991b1b; }
.badge-suspended   { background: #FEE2E2; color: #991b1b; }
.badge-deregistered{ background: #F3F4F6; color: #4B5563; }
.badge-expired     { background: #F3F4F6; color: #4B5563; }
.badge-paid        { background: #DCFCE7; color: #166534; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.dot-active, .dot-approved   { background: #22c55e; }
.dot-processing               { background: #3b82f6; }
.dot-pending                  { background: #f59e0b; }
.dot-rejected, .dot-suspended { background: #ef4444; }
.dot-deregistered, .dot-expired { background: #9ca3af; }

/* ── Step indicator ────────────────────────────────────────── */
.step-indicator { display: flex; align-items: center; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  transition: all .2s;
}
.step-circle.done    { background: var(--primary); color: #fff; }
.step-circle.active  { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(10,110,63,.2); }
.step-circle.pending { background: #F3F4F6; color: #9CA3AF; }
.step-line { flex: 1; height: 2px; margin: 0 4px; transition: background .2s; }
.step-line.done   { background: var(--primary); }
.step-line.pending{ background: #E5E7EB; }
.step-label { font-size: 10px; font-weight: 500; text-align: center; margin-top: 4px; max-width: 64px; }

/* ── Sidebar ───────────────────────────────────────────────── */
#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  z-index: 1040;
  display: flex; flex-direction: column;
  transition: transform .22s ease;
  overflow: hidden;
}
#sidebar .sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
}
#sidebar .sidebar-logo img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: #fff; padding: 3px; }
#sidebar .sidebar-logo .brand { line-height: 1.2; }
#sidebar .sidebar-logo .brand p { margin: 0; }
#sidebar .brand-name  { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 13px; color: #fff; }
#sidebar .brand-sub   { font-size: 10px; color: rgba(255,255,255,.45); }
#sidebar .close-btn   { margin-left: auto; background: none; border: none; color: rgba(255,255,255,.5); display: none; cursor: pointer; font-size: 18px; }

#sidebar nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
#sidebar nav::-webkit-scrollbar { width: 3px; }
#sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.nav-section-label {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,.3);
  text-transform: uppercase; letter-spacing: .1em;
  padding: 12px 10px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  color: rgba(255,255,255,.6); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all .15s; margin-bottom: 2px;
}
.sidebar-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-link.active { background: rgba(255,255,255,.16); color: #fff; }
.sidebar-link svg { flex-shrink: 0; }
#sidebar .user-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

/* ── Header ────────────────────────────────────────────────── */
#app-header {
  position: sticky; top: 0; z-index: 1030;
  height: var(--header-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
}
.header-title { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 14px; color: #111827; }
.header-sub   { font-size: 11px; color: #9CA3AF; }
.notif-btn { position: relative; background: none; border: none; color: #6B7280; padding: 6px; border-radius: 8px; cursor: pointer; }
.notif-btn:hover { background: #F3F4F6; }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.hamburger-btn { background: none; border: none; color: #6B7280; cursor: pointer; display: none; padding: 4px; }

/* ── App wrapper (sidebar + content) ──────────────────────── */
#app-wrapper { display: flex; min-height: 100vh; }
#main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
#page-body { flex: 1; padding: 20px 24px 24px; width: 100%; }

/* ── Bottom nav (mobile only) ──────────────────────────────── */
#bottom-nav {
  display: none !important;          /* hidden on desktop always  */
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--border);
  z-index: 1020;
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; padding: 8px 4px;
  text-decoration: none; color: #9CA3AF;
  font-size: 10px; font-weight: 500;
  transition: color .15s;
}
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--primary); }
.bottom-nav-item svg { width: 20px; height: 20px; }

/* ── Sidebar backdrop ──────────────────────────────────────── */
#sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1039;
  backdrop-filter: blur(2px);
}

/* ── Toast ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed; top: 16px; right: 16px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  width: 320px; pointer-events: none;
}
.toast-item {
  pointer-events: all;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid; font-size: 13px;
  animation: toastIn .25s cubic-bezier(.34,1.56,.64,1) forwards;
  box-shadow: var(--shadow-lg);
}
.toast-item.toast-success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.toast-item.toast-error   { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.toast-item.toast-warning { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.toast-item.toast-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e3a5f; }
.toast-dismiss { background: none; border: none; cursor: pointer; opacity: .5; padding: 0; margin-left: auto; }
.toast-dismiss:hover { opacity: 1; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Utilities ─────────────────────────────────────────────── */
.text-primary-brand { color: var(--primary) !important; }
.text-gold          { color: var(--gold) !important; }
.bg-primary-brand   { background: var(--primary) !important; }
.bg-gold            { background: var(--gold) !important; }
.bg-primary-light   { background: var(--primary-light); }
.bg-gold-light      { background: var(--gold-light); }
.border-primary     { border-color: var(--primary) !important; }
.rounded-xl  { border-radius: var(--radius) !important; }
.rounded-sm  { border-radius: var(--radius-sm) !important; }
.shadow-card { box-shadow: var(--shadow-card) !important; }
.shadow-md   { box-shadow: var(--shadow-md) !important; }

.section-label {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,.3);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px;
}

/* ── Auth pages ────────────────────────────────────────────── */
.auth-left {
  width: 42%; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 56px; position: relative; overflow: hidden;
}
.auth-right {
  flex: 1; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px;
  background: var(--surface);
}
.deco-circle {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.06); pointer-events: none;
}
.info-box {
  border-radius: var(--radius);
  padding: 12px 14px; font-size: 12px;
}
.info-box-primary { background: var(--primary-light); border: 1px solid #c6e6d4; color: #065f35; }
.info-box-warning { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.info-box-blue    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a5f; }

/* ── Service grid cards ────────────────────────────────────── */
.service-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 16px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: inherit; text-align: center;
  background: #fff; transition: all .15s;
}
.service-card:hover { border-color: rgba(10,110,63,.3); background: #f0fdf4; }
.service-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.service-name { font-size: 13px; font-weight: 600; color: #111827; }
.service-desc { font-size: 11px; color: #9CA3AF; line-height: 1.4; margin-top: 2px; }

/* ── Welcome banner ────────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius); color: #fff;
  padding: 24px 28px; position: relative; overflow: hidden;
}
.welcome-banner .deco { position: absolute; border-radius: 50%; background: rgba(255,255,255,.05); }
.stat-pill {
  background: rgba(255,255,255,.12);
  border-radius: 12px; padding: 8px 16px; text-align: center;
}
.stat-pill .val { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 18px; color: #fff; }
.stat-pill .lbl { font-size: 10px; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .06em; }

/* ── Timeline ──────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -20px; top: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid; display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.timeline-dot.done   { background: var(--primary); border-color: var(--primary); }
.timeline-dot.active { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,110,63,.2); }
.timeline-dot.future { background: #fff; border-color: #D1D5DB; }

/* ── OTP inputs ────────────────────────────────────────────── */
.otp-input {
  width: 44px; height: 50px; text-align: center;
  font-size: 18px; font-weight: 700;
  border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .15s, background .15s;
}
.otp-input:focus { outline: none; border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(10,110,63,.12); }
.otp-input.filled { border-color: var(--primary); background: var(--primary-light); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #sidebar .close-btn { display: block; }
  #main-content { margin-left: 0; }
  #bottom-nav { display: flex !important; }   /* re-enable on mobile */
  .hamburger-btn { display: flex; }
  #page-body { padding: 16px 16px 80px; }     /* extra bottom for bottom-nav */
  .auth-left { display: none; }
}
@media (max-width: 575.98px) {
  .welcome-banner { padding: 18px; }
  #page-body { padding: 12px 12px 80px; }
}
