/* ====================================================
   BR Seva - Premium UI (Swiggy/PhonePe inspired)
   Theme: Primary #FF6B00, White, Accent Blue #0066FF
   ==================================================== */
:root {
  --brand: #FF6B00;
  --brand-dark: #E55A00;
  --brand-light: #FFE6D2;
  --accent: #0066FF;
  --accent-light: #E6F0FF;
  --bg: #FFFFFF;
  --bg-soft: #F7F8FA;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-soft: #5B6471;
  --muted: #9AA3B2;
  --border: #ECEEF2;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;
  --info: #0066FF;
  --shadow-sm: 0 1px 3px rgba(16,24,40,.06);
  --shadow: 0 8px 24px rgba(16,24,40,.08);
  --shadow-lg: 0 20px 50px rgba(16,24,40,.12);
  --radius: 14px;
  --radius-lg: 20px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #0B0F17;
  --bg-soft: #131826;
  --card: #1A2030;
  --text: #F2F4F8;
  --text-soft: #B5BDCB;
  --muted: #6B7585;
  --border: #232B3D;
  --brand-light: #3A1F0A;
  --accent-light: #0F2240;
  --shadow: 0 8px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
}

*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-soft);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
  padding-bottom: 70px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; height: auto; }

/* ----- App Bar ----- */
.appbar {
  position: sticky; top: 0; z-index: 1020;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.appbar .brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 800; font-size: 18px; letter-spacing: .3px;
}
.appbar .brand .logo-dot {
  width: 32px; height: 32px; border-radius: 10px;
  background: #fff; color: var(--brand);
  display: grid; place-items: center; font-weight: 900;
}
.appbar .spacer { flex: 1; }
.appbar .icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff; border: 0;
  display: grid; place-items: center; position: relative;
  cursor: pointer; transition: background .2s;
}
.appbar .icon-btn:hover { background: rgba(255,255,255,.3); }
.appbar .icon-btn .badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #FFD400; border: 2px solid var(--brand);
}

/* ----- Search ----- */
.search-wrap {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  padding: 0 16px 18px;
}
.search-box {
  background: var(--card); color: var(--text);
  border-radius: 14px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.search-box input {
  border: 0; outline: 0; flex: 1; background: transparent; color: var(--text);
  font-size: 15px;
}
.search-box i { color: var(--brand); }

/* ----- Container ----- */
.container-app { max-width: 980px; margin: 0 auto; padding: 16px; }

/* ----- Hero / Banner ----- */
.banner-slider {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 8px;
  scroll-snap-type: x mandatory;
}
.banner-slider::-webkit-scrollbar { display: none; }
.banner {
  min-width: 86%;
  scroll-snap-align: start;
  height: 140px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand) 0%, #ff8a3d 100%);
  color: #fff;
  padding: 18px 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.banner::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.15);
}
.banner h3 { margin: 0; font-size: 20px; font-weight: 800; }
.banner p { margin: 0; opacity: .92; font-size: 13px; }
.banner.b2 { background: linear-gradient(135deg, #0066FF 0%, #4d94ff 100%); }
.banner.b3 { background: linear-gradient(135deg, #16A34A 0%, #4ade80 100%); }

/* ----- Section ----- */
.section-title {
  display: flex; justify-content: space-between; align-items: center;
  margin: 22px 0 12px;
}
.section-title h4 { margin: 0; font-size: 17px; font-weight: 800; color: var(--text); }
.section-title a { font-size: 13px; color: var(--brand); font-weight: 700; }

/* ----- Categories grid (PhonePe-style) ----- */
.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.cat {
  background: var(--card); border-radius: var(--radius);
  padding: 14px 8px; text-align: center;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .2s;
  cursor: pointer; border: 1px solid var(--border);
}
.cat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cat .ico {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--brand-light); color: var(--brand);
  margin: 0 auto 8px; display: grid; place-items: center; font-size: 20px;
}
.cat span { font-size: 12px; font-weight: 600; color: var(--text); display: block; line-height: 1.25; }

/* ----- Service Cards ----- */
.svc-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.svc {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all .2s;
}
.svc:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.svc .ico {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent-light); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 10px;
}
.svc h6 { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--text); }
.svc .desc { font-size: 12px; color: var(--text-soft); margin-bottom: 8px; min-height: 32px; }
.svc .meta { display: flex; justify-content: space-between; align-items: center; }
.svc .price { font-weight: 800; color: var(--brand); font-size: 15px; }
.svc .days { font-size: 11px; color: var(--muted); }

/* ----- Buttons ----- */
.btn-brand {
  background: var(--brand); color: #fff; border: 0;
  padding: 12px 20px; border-radius: 12px; font-weight: 700; font-size: 15px;
  cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: 8px;
}
.btn-brand:hover { background: var(--brand-dark); transform: translateY(-1px); color: #fff; }
.btn-outline-brand {
  background: transparent; color: var(--brand); border: 1.5px solid var(--brand);
  padding: 10px 18px; border-radius: 12px; font-weight: 700; cursor: pointer;
}
.btn-outline-brand:hover { background: var(--brand); color: #fff; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ----- Cards & Forms ----- */
.card-app {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
}
.form-label { font-weight: 600; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; display: block; }
.form-control, .form-select {
  background: var(--bg); color: var(--text); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px 14px; font-size: 15px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255,107,0,.12);
}

/* ----- Status Badge ----- */
.badge-status {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.bg-submitted { background: #E0E7FF; color: #3730A3; }
.bg-assigned { background: #DBEAFE; color: #1E40AF; }
.bg-in_progress { background: #FEF3C7; color: #92400E; }
.bg-documents_required { background: #FEE2E2; color: #991B1B; }
.bg-approved { background: #D1FAE5; color: #065F46; }
.bg-rejected { background: #FEE2E2; color: #991B1B; }
.bg-completed { background: #D1FAE5; color: #065F46; }
.bg-cancelled { background: #E5E7EB; color: #4B5563; }

/* ----- Bottom Navigation ----- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: var(--card); border-top: 1px solid var(--border);
  display: flex; padding: 8px 0; justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(16,24,40,.06);
}
.bottom-nav a {
  flex: 1; text-align: center; color: var(--text-soft);
  font-size: 11px; font-weight: 600; padding: 4px 2px;
  transition: color .15s;
}
.bottom-nav a i { display: block; font-size: 20px; margin-bottom: 2px; }
.bottom-nav a.active { color: var(--brand); }

/* ----- WhatsApp Float ----- */
.fab-wa {
  position: fixed; bottom: 84px; right: 18px; z-index: 999;
  width: 54px; height: 54px; border-radius: 50%;
  background: #25D366; color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(37,211,102,.5); font-size: 24px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ----- Auth pages ----- */
.auth-wrap { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 20px; }
.auth-card {
  background: var(--card); border-radius: 24px; padding: 32px 26px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.auth-card .logo { text-align: center; margin-bottom: 18px; }
.auth-card .logo .logo-dot {
  width: 56px; height: 56px; border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; display: grid; place-items: center; margin: 0 auto 10px;
  font-weight: 900; font-size: 22px;
}
.auth-card h2 { font-size: 22px; font-weight: 800; text-align: center; margin: 0 0 4px; }
.auth-card .sub { text-align: center; color: var(--text-soft); font-size: 14px; margin-bottom: 22px; }
.auth-tabs { display: flex; background: var(--bg-soft); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button {
  flex: 1; padding: 10px; border: 0; background: transparent;
  border-radius: 8px; font-weight: 700; color: var(--text-soft); cursor: pointer; font-size: 13px;
}
.auth-tabs button.active { background: var(--card); color: var(--brand); box-shadow: var(--shadow-sm); }

/* ----- Dashboard stats ----- */
.stats-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 12px; color: var(--text-soft); font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 800; color: var(--text); margin-top: 4px; }
.stat .ico { float: right; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-light); color: var(--brand); display: grid; place-items: center; }

/* ----- Animations ----- */
.fade-in { animation: fadeIn .35s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----- Responsive ----- */
@media (max-width: 480px) {
  .cat-grid { grid-template-columns: repeat(4,1fr); gap: 10px; }
  .cat .ico { width: 44px; height: 44px; }
}
@media (min-width: 768px) {
  .svc-grid { grid-template-columns: repeat(3,1fr); }
  .stats-grid { grid-template-columns: repeat(4,1fr); }
}
@media (min-width: 992px) {
  .svc-grid { grid-template-columns: repeat(4,1fr); }
  .banner { min-width: 60%; }
}

/* Flash messages */
.flash {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: var(--card); border-radius: 10px; padding: 12px 18px;
  box-shadow: var(--shadow-lg); z-index: 1100; font-size: 14px; font-weight: 600;
  border-left: 4px solid var(--brand);
}
.flash.success { border-left-color: var(--success); color: var(--success); }
.flash.error { border-left-color: var(--danger); color: var(--danger); }
.flash.warning { border-left-color: var(--warning); color: var(--warning); }

/* Loader */
.spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
