/* =======================
   ROOT VARIABLES
======================= */
:root {
  --primary: #2c386d;
  --primary-light: #3a4d8f;
  --bg-light: #f8f9fc;
  --bg-card: #ffffff;
  --text-dark: #111827;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --radius-lg: 24px;

  /* iOS safe area fallbacks */
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

/* Dark Mode Variables */
body.dark-mode {
  --bg-light: #121212;
  --bg-card: #1e1e1e;
  --text-dark: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: #374151;
  --header-bg: #1e1e1e;
  --input-bg: #2d2d2d;
}

/* =======================
   GLOBAL RESET
======================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'SN Pro', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background: var(--bg-light);
  color: var(--text-dark);
  height: 100%;
  height: -webkit-fill-available;
  overflow: hidden;
  position: fixed;
  width: 100%;

}

/* =======================
   SCREENS
======================= */
.screen {
  display: none;
  width: 100%;
  height: 100vh;
  height: 100dvh;           
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: fixed;
  inset: 0;
}

.screen.active {
  display: flex;
}

/* =======================
   SPLASH SCREEN — full screen
======================= */
.splash {
  background: linear-gradient(145deg, #1a2352 0%, #2c386d 50%, #3a4d8f 100%);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  z-index: 99999;
  padding: 0;
}

/* Floating particles */
.splash-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.splash-particles span {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  animation: floatUp 6s infinite ease-in-out;
}
.splash-particles span:nth-child(1) { width: 12px; height: 12px; left: 10%; animation-delay: 0s;   animation-duration: 5s; }
.splash-particles span:nth-child(2) { width: 20px; height: 20px; left: 25%; animation-delay: 1s;   animation-duration: 7s; }
.splash-particles span:nth-child(3) { width: 8px;  height: 8px;  left: 40%; animation-delay: 0.5s; animation-duration: 6s; }
.splash-particles span:nth-child(4) { width: 16px; height: 16px; left: 60%; animation-delay: 2s;   animation-duration: 8s; }
.splash-particles span:nth-child(5) { width: 10px; height: 10px; left: 75%; animation-delay: 1.5s; animation-duration: 5.5s; }
.splash-particles span:nth-child(6) { width: 24px; height: 24px; left: 88%; animation-delay: 0.8s; animation-duration: 7.5s; }
.splash-particles span:nth-child(7) { width: 6px;  height: 6px;  left: 50%; animation-delay: 3s;   animation-duration: 4.5s; }
.splash-particles span:nth-child(8) { width: 14px; height: 14px; left: 5%;  animation-delay: 2.5s; animation-duration: 6.5s; }

@keyframes floatUp {
  0%   { bottom: -10%; opacity: 0; transform: scale(0.8); }
  20%  { opacity: 1; }
  80%  { opacity: 0.6; }
  100% { bottom: 110%; opacity: 0; transform: scale(1.2); }
}

/* Pulsing rings */
.splash-rings {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.12);
  animation: ringPulse 3s ease-out infinite;
}
.ring-1 { width: 120px; height: 120px; animation-delay: 0s; }
.ring-2 { width: 200px; height: 200px; animation-delay: 0.6s; }
.ring-3 { width: 300px; height: 300px; animation-delay: 1.2s; }

@keyframes ringPulse {
  0%   { opacity: 0.6; transform: scale(0.85); }
  60%  { opacity: 0.1; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.15); }
}

/* Center content */
.splash-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: splashFadeIn 0.9s ease-out both;
}

@keyframes splashFadeIn {
  from { opacity: 0; transform: scale(0.85) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.splash-logo-wrap {
  width: 88px;
  height: 88px;
  background: rgba(255,255,255,0.12);
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.splash-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  animation: logoSpin 8s linear infinite;
}

.splash-brand {
  font-size: 3.2rem;
  font-family: 'Dosis', sans-serif;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 6px;
  line-height: 1;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
  animation: splashFadeIn 0.9s 0.2s ease-out both;
}

.splash-tagline {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
  animation: splashFadeIn 0.9s 0.4s ease-out both;
}

/* Rotating animation */
@keyframes logoSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* =======================
   AUTH SCREENS (shared wrapper)
======================= */
.screen.auth {
  background: var(--bg-light);
  justify-content: flex-start;
  align-items: stretch;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px calc(48px + var(--sab));
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ── Header row: back arrow + title inline ── */
.auth-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(24px + var(--sat)) 0 28px;
}

.auth-header-row .back-btn {
  position: static;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--text-dark);
  transition: background 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.auth-header-row .back-btn:active {
  background: var(--border-color);
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
  font-family: 'Dosis', sans-serif;
  letter-spacing: 0.2px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: -14px 0 24px;
  line-height: 1.5;
}

.auth-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 12px 0 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.forgot-row {
  text-align: right;
  margin: 8px 0 20px;
}

.forgot-row a {
  color: var(--primary);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 600;
}

/* =======================
   GET STARTED SCREEN
======================= */
#get-started-screen {
  background: var(--bg-light);
  justify-content: center;
  overflow: hidden;
}

#get-started-screen .auth-card {
  height: 100dvh;
  min-height: 0;
  justify-content: space-between;
  padding-top: calc(64px + var(--sat));
  padding-bottom: calc(52px + var(--sab));
  text-align: center;
  align-items: center;
}

#get-started-screen .auth-illustration {
  width: 72px;
  height: 72px;
  background: url("/assets/brand/favicon.webp") no-repeat center;
  background-size: contain;
}

#get-started-screen .app-name {
  font-size: 2.8rem;
  font-weight: 900;
  font-family: 'Dosis', sans-serif;
  color: var(--primary);
  text-transform: uppercase;
  margin: 16px 0 8px;
  letter-spacing: 4px;
}

#get-started-screen .subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 0 8px;
  flex: 1;
  display: flex;
  
}

#get-started-screen .btn-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#get-started-screen .btn {
  width: 100%;
  padding: 17px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: 'Dosis', sans-serif;
  cursor: pointer;
  letter-spacing: 0.6px;
}

/* Primary & ghost */
.btn.primary {
  background: var(--primary);
  color: #fff;
  border: none;
}
.btn.ghost {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-dark);
}

/* =======================
   AUTH INPUTS  (fully responsive)
======================= */
.auth-input {
  display: block;
  width: 100%;
  padding: 15px 18px;
  margin: 6px 0;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  font-size: 1rem;
  outline: none;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44,56,109,0.10);
}

/* Login screen — vertically centered (fewer fields than register) */
#login-screen {
  justify-content: center;
}
#login-screen .auth-card {
  justify-content: center;
  min-height: auto;
  padding-top: 0;
  padding-bottom: calc(40px + var(--sab));
}
#login-screen .auth-header-row {
  padding-top: 0;
  margin-bottom: 8px;
}

/* =======================
   DATE OF BIRTH FIELD
======================= */
.dob-field {
  margin: 6px 0;
}

.dob-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.dob-input {
  width: 100%;
  padding: 15px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--bg-card);
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  outline: none;
  min-height: 52px;
  line-height: 1.5;
  display: block;
}

.dob-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44,56,109,0.10);
}

/* Force date value to left-align on iOS */
.dob-input::-webkit-date-and-time-value {
  text-align: left;
  min-height: 24px;
}

.dob-input::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

/* Auth screen buttons — full width */
#register-screen .btn,
#login-screen .btn,
#forgot-password-screen .btn,
#reset-password-screen .btn {
  width: 100%;
  padding: 16px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: 'Dosis', sans-serif;
  margin-top: 10px;
  cursor: pointer;
  letter-spacing: 0.4px;
}

/* =======================
   LOGIN TEXT LINK
======================= */
.login-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 18px;
}

.login-text .link {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

/* =======================
   BACK ARROW (info screens only — stays absolute)
======================= */
.back-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

/* =======================
   HOME / SIDEBAR / MAP
======================= */
.home { 
  flex-direction: column; 
  padding: 0; 
}

.home-header {
  width: 100%;
  box-sizing: border-box;
  height: calc(64px + var(--sat));
  padding-top: var(--sat);
  background: var(--bg-card);
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
  flex-shrink: 0;
}

.header-logo {
  width: 38px;
  height: 38px;
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
}

.profile-avatar img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover;
 }

#map-container { 
  position: relative; 
  flex: 1; 
  width: 100%; 
}

#map {
  width: 100%;
  height: calc(100vh - 64px - var(--sat));
}

.resource-overlay-card {
  position: absolute;
  bottom: 16px;
  left: 12px;
  right: 12px;
  background: var(--bg-card);
  color: var(--text-dark);
  border-radius: 20px;
  padding: 14px 14px calc(14px + var(--sab)) 14px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  max-height: 45%;
  display: flex;
  flex-direction: column;
}

.resource-scroll-area { overflow-y: auto; flex: 1; }

.resource-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.resource-info h3 { font-size: 0.95rem; font-weight: 600; }
.resource-info p { font-size: 0.8rem; color: #6b7280; margin-top: 2px; }

.dir-btn {
  background: #fff;
  border: 1px solid #2c386d;
  color: #2c386d;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

/* =======================
   SIDEBAR
======================= */
.sidebar {
  position: fixed;
  top: 0;
  right: -280px;
  width: 260px;
  height: 100%;
  background: var(--bg-card); 
  color: var(--text-dark);
  z-index: 2000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
}

.sidebar.open { right: 0; }

/* Sidebar Header Layout */
.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
}


.initial-avatar {
  width: 40px;
  height: 40px;
  background-color:#dcfce7;
  color: rgb(31, 31, 31);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.user-profile-circle {
  width: 60px;
  height: 60px;
  background-color: #dcfce7;
  color: rgb(31, 31, 31);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 15px;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.sidebar-header img {
   width: 72px; 
   height: 72px;
    border-radius: 50%; 
    margin-bottom: 10px; 
    background-color: #111827;
  }


.sidebar-menu { list-style: none; padding: 0; }
.sidebar-menu li { padding: 16px 20px; border-bottom: 1px solid var(--border-color); cursor: pointer; }
.sidebar-menu li.danger { color: #dc2626; }
.sidebar-footer { margin-top: auto; padding: 0 20px; }

#logoutBtn {
  padding-left: 15px;
  padding-right: 15px;
  padding-top: 5px;
  padding-bottom: 5px;
  border-radius: 100px;
  border-color: #dc2626;
  color: #dc2626
}

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1500;
}

#overlay.active { opacity: 1; pointer-events: all; }

/* =======================
   ANIMATIONS
======================= */
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }


/* =======================
   EXTENSIONS FOR RESOURCE CARD
======================= */
.resource-search {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 100px;
  border: 1px solid #e5e7eb;
  margin-bottom: 12px;
  background: #f5f5f5;
}

.resource-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 6px 8px;
  font-size: 1rem;
}

.resource-search .search-icon,
.resource-search .mic-icon {
  font-size: 1rem;
  cursor: pointer;
  margin: 0 6px;
}

/* Phone numbers clickable */
.resource-phone {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--primary);
  text-decoration: none;
}
.resource-phone:hover { text-decoration: none; }



/* RESOURCE CARD ABOVE MAP */
.resource-overlay-card {
  z-index: 2;
}

/* =======================
   SIDEBAR DARK/LIGHT TOGGLE
======================= */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  margin-left: 10px;
}
.switch input { display: none; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 20px;
  transition: 0.3s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 2px; bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}
input:checked + .slider {
  background-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* =======================
   INFO SCREENS (About, Privacy, Support)
======================= */
.screen.info {
  display: none;
  flex-direction: column;
  background: var(--bg-light);
  padding: 10; 
  overflow-y: auto;
  align-items: flex-start; 
}

.screen.info.active { display: flex; }

/* SUPPORT SCREEN LAYOUT */
#support-screen {
  width: 100%;
}

/* SUPPORT LIST */
.support-list {
  list-style: none;
  padding: 10;
  margin: 10;
  width: 100%;
  background: #ffffff;
}

.support-list li {
  width: 100%;
  border-bottom: 1px solid #f0f0f0;
}

.support-list li a {
  display: flex;
  align-items: center;
  justify-content: flex-start; 
  padding: 18px 20px; 
  width: 100%;
  box-sizing: border-box; 
  color: #333;
  text-decoration: none;
  font-size: 1rem;
}

/* SVGs inside the list */
.support-list li a svg {
  width: 22px;
  height: 22px;
  margin-right: 15px;
  color: var(--primary);
  flex-shrink: 0;
}

.privacy-content {
  padding: 20px;
  line-height: 1.3;
  color: #444;
  font-size: 0.9rem;
}

.info-content {
  padding: 20px;
  line-height: 1.6;
}

.info-content h3 {
  color: var(--primary);
  margin-bottom: 10px;
}

#menu-theme {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}


/* NAVIGATION SCREEN STYLE */
#navigation-screen {
  position: fixed;
  top: 100%; /* Hidden below */
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0);
  z-index: 9999;
  transition: top 0.4s ease-in-out;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
}

#navigation-screen.active {
  top: 0; /* Slide into view */
}

.nav-card {
  padding: 30px 24px;
  background: white;
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
}

/* Spinner Animation — legacy fallback */
.loader-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════
   BRANDED LOADER OVERLAY
═══════════════════════════════════════════════════════════ */
#app-loader {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  animation: loaderCardIn 0.3s ease-out both;
  min-width: 180px;
}

@keyframes loaderCardIn {
  from { opacity: 0; transform: scale(0.88) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.loader-logo-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-logo-wrap img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

.loader-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.loader-dots {
  display: flex;
  gap: 6px;
}

.loader-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.3;
  animation: dotPulse 1.2s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 100% { opacity: 0.2; transform: scale(0.85); }
  50%       { opacity: 1;   transform: scale(1.1); }
}

/* ═══════════════════════════════════════════════════════════
   SKELETON LOADER (resource list while loading)
═══════════════════════════════════════════════════════════ */
.skeleton-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-color);
}

.skeleton-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--border-color);
  flex-shrink: 0;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }

.skeleton-line {
  height: 10px;
  border-radius: 6px;
  background: var(--border-color);
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-line.short { width: 55%; animation-delay: 0.15s; }
.skeleton-line.shorter { width: 35%; animation-delay: 0.3s; }

.skeleton-btn {
  width: 58px;
  height: 30px;
  border-radius: 50px;
  background: var(--border-color);
  flex-shrink: 0;
  animation: shimmer 1.4s ease-in-out infinite;
  animation-delay: 0.1s;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   BUTTON LOADING STATE
═══════════════════════════════════════════════════════════ */
.btn.loading {
  pointer-events: none;
  opacity: 0.75;
  position: relative;
}

.btn.loading::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ═══════════════════════════════════════════════════════════
   SCREEN ENTRANCE ANIMATIONS
═══════════════════════════════════════════════════════════ */
@keyframes screenSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes screenFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.screen.auth.active .auth-card {
  animation: screenSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

#home-screen.active {
  animation: screenFade 0.3s ease both;
}

/* ═══════════════════════════════════════════════════════════
   INPUT FOCUS POLISH
═══════════════════════════════════════════════════════════ */
.auth-input {
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44,56,109,0.12);
}

/* ═══════════════════════════════════════════════════════════
   SUCCESS OVERLAY ANIMATION
═══════════════════════════════════════════════════════════ */
#success-overlay {
  display: flex !important;
}

#success-overlay[style*="display:none"] {
  display: none !important;
}

.success-burst {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon-wrap {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  font-weight: 800;
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
  z-index: 2;
}

.success-circle-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  animation: successRing 0.8s ease-out forwards;
}

@keyframes successPop {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes successRing {
  from { transform: scale(0.6); opacity: 1; }
  to   { transform: scale(2.5); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   INFO SCREENS — back button top-left, title below
═══════════════════════════════════════════════════════════ */
.info-header {
  position: relative;
  width: 100%;
  padding: calc(var(--sat) + 56px) 24px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* Circular back button pinned top-left, same style as auth screens */
.info-back-btn {
  position: absolute;
  top: calc(var(--sat) + 12px);
  left: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dark);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: background 0.15s;
  z-index: 2;
}
.info-back-btn:active { background: var(--border-color); }

/* Title sits below the button area */
.info-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
  font-family: 'Dosis', sans-serif;
  margin: 0;
  letter-spacing: 0.2px;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR — safe area for notch devices
═══════════════════════════════════════════════════════════ */
.sidebar {
  padding-top: var(--sat);
}

/* ═══════════════════════════════════════════════════════════
   RESOURCE ITEM ENTRANCE ANIMATION
═══════════════════════════════════════════════════════════ */
.resource-item {
  animation: itemFadeIn 0.3s ease both;
}

.resource-item:nth-child(2) { animation-delay: 0.05s; }
.resource-item:nth-child(3) { animation-delay: 0.10s; }
.resource-item:nth-child(4) { animation-delay: 0.15s; }
.resource-item:nth-child(5) { animation-delay: 0.20s; }

@keyframes itemFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════
   RESOURCE LIST — updated
═══════════════════════════════════════════════════════════ */
.resource-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.resource-item-icon {
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  background: var(--bg-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.resource-info { flex: 1; min-width: 0; }
.resource-info h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.resource-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
}
.resource-phone {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--primary);
  text-decoration: none;
}

/* Direction button */
.dir-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 9px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Dosis', sans-serif;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
}
.dir-btn:active { transform: scale(0.96); }
.dir-btn:hover  { background: #1e2a52; }

/* Custom user dot on home map */
.user-location-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid white;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.25), 0 2px 8px rgba(0,0,0,0.3);
}

/* Resource marker on home map */
.resource-marker {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2.5px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   NAVIGATION SCREEN — CTRI style  v2.0
═══════════════════════════════════════════════════════════ */

#navigation-screen {
  position: fixed;
  top: 100%;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: top 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f8f9fa;
}
#navigation-screen.active { top: 0; }

/* ── TOP BAR — Google Maps-style white card ── */
#nav-top-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(16px + var(--sat)) 16px 16px;
  background: #ffffff;
  color: #111827;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
  border-bottom: 1px solid #eef0f4;
  min-height: calc(86px + var(--sat));
}



#nav-maneuver-icon {
  width: 54px;
  height: 54px;
  background: #2c386d;
  border: none;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 11px;
  transition: background 0.3s;
  box-shadow: 0 4px 12px rgba(44,56,109,0.25);
}
#nav-maneuver-icon svg { width: 100%; height: 100%; }

#nav-top-text { flex: 1; min-width: 0; }

#nav-distance-text {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: 'Dosis', sans-serif;
  line-height: 1;
  color: #2c386d;
  letter-spacing: -0.5px;
}

#nav-street-name {
  font-size: 0.83rem;
  color: #374151;
  margin-top: 5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#nav-mute-btn {
  width: 44px;
  height: 44px;
  background: #f3f4f6;
  border: 1.5px solid #e5e7eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
#nav-mute-btn:active { transform: scale(0.93); background: #e9eaec; }
#nav-mute-btn.muted  {
  background: #fef2f2;
  border-color: #fca5a5;
  opacity: 1;
}

/* ── NEXT STEP PREVIEW BAR ── */
#nav-next-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: #f0f4f8;
  color: #374151;
  font-size: 0.78rem;
  flex-shrink: 0;
  min-height: 36px;
  border-bottom: 1px solid #e5e7eb;
}
#nav-next-label {
  font-weight: 700;
  color: #3fa3d9;
  text-transform: uppercase;
  font-size: 0.63rem;
  letter-spacing: 0.6px;
  flex-shrink: 0;
}
#nav-next-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── MAP ── */
#nav-map {
  flex: 1;
  width: 100%;
  min-height: 0;
}

/* ── BOTTOM SHEET ── */
#nav-bottom-sheet {
  background: #ffffff;
  border-radius: 22px 22px 0 0;
  padding: 6px 20px calc(18px + var(--sab));
  flex-shrink: 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
  position: relative;
  z-index: 10;
}

/* Pull handle */
#nav-bottom-sheet::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: #dde1e9;
  border-radius: 2px;
  margin: 10px auto 14px;
}

/* ── ETA ROW ── */
#nav-eta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef0f4;
  margin-bottom: 12px;
}
.nav-eta-block { text-align: center; flex: 1; }
.nav-eta-block.nav-eta-center {
  border-left: 1px solid #eef0f4;
  border-right: 1px solid #eef0f4;
}

.nav-eta-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: #111827;
  font-family: 'Dosis', sans-serif;
  line-height: 1.1;
}
.nav-eta-arrival {
  font-size: 1.45rem;
  color: #3fa3d9;    /* CTRI teal instead of Google blue */
}
.nav-eta-label {
  font-size: 0.62rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
  font-weight: 600;
}

/* ── DESTINATION ROW ── */
#nav-dest-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
#nav-dest-icon {
  font-size: 1.3rem;
  width: 44px;
  height: 44px;
  background: #eef4fa;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#nav-dest-info { flex: 1; min-width: 0; }
#nav-dest-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Call button — teal pill */
#nav-call-btn {
  width: 44px;
  height: 44px;
  background: #3fa3d9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 12px rgba(63,163,217,0.35);
}
#nav-call-btn:active { transform: scale(0.94); background: #2e8fc2; }

/* ── END NAVIGATION BUTTON ── */
#close-nav {
  width: 100%;
  padding: 15px;
  border-radius: 50px;
  background: #2c386d;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  font-family: 'Dosis', sans-serif;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.5px;
  transition: background 0.2s, transform 0.1s;
}
#close-nav:active  { transform: scale(0.98); }
#close-nav:hover   { background: #1e2a52; }

/* ── USER MARKER — directional arrow ── */
.nav-user-marker {
  width: 0; height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 22px solid #3fa3d9;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
}

/* ── DESTINATION PIN MARKER ── */
.nav-dest-marker {
  width: 22px;
  height: 22px;
  background: #eb5757;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid white;
  box-shadow: 0 3px 12px rgba(0,0,0,0.45);
}

/* ── ARRIVAL TOAST ── */
.arrival-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  background: rgba(0,0,0,0.65);
  animation: fadeIn 0.3s ease;
}
.arrival-card {
  background: white;
  border-radius: 28px;
  padding: 44px 32px 36px;
  text-align: center;
  max-width: 290px;
  width: 90%;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  animation: scaleIn 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
.arrival-pulse-ring {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 3px solid #3fa3d9;
  animation: arrivalPulse 1.2s ease-out infinite;
}
.arrival-emoji {
  font-size: 3.2rem;
  margin-bottom: 14px;
  display: block;
}
.arrival-title {
  color: #2c386d;
  font-family: 'Dosis', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.arrival-sub {
  color: #6b7280;
  font-size: 0.88rem;
  margin-bottom: 26px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arrival-btn {
  background: #2c386d;
  color: white;
  border: none;
  padding: 14px 0;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  font-family: 'Dosis', sans-serif;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}
.arrival-btn:hover { background: #1e2a52; }

@keyframes arrivalPulse {
  0%   { transform: translateX(-50%) scale(1); opacity: 0.8; }
  100% { transform: translateX(-50%) scale(2.2); opacity: 0; }
}
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Sidebar menu items with icons */
.sidebar-menu li {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dark);
  font-size: 0.95rem;
}
.sidebar-menu li:hover { background: rgba(0,0,0,0.03); }

