/* ============================================================
   RideLink NIGERIA — GLOBAL STYLESHEET
   Version: 1.1.0 (Fixed + Production Ready)

   Fixes:
   - Added OTP box styles (critical — was missing)
   - Added password strength bar styles (critical — was missing)
   - Added sidebar mobile overlay
   - Added role card base styles
   - Added step indicator base styles
   - Fixed modal iOS scroll
   - Fixed btn-gold loading spinner visibility
   - Removed dead pwa-install-banner CSS (app.js uses inline)
   - Added driver online toggle styles
   - Added ride request card styles
   - Added document upload zone styles
   - Added chart container styles
   - Added touch target enforcement
   ============================================================ */


/* ============================================================
   1. CSS RESET & BASE
   ============================================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Minimum touch target size — accessibility */
button,
a,
[role="button"],
input[type="checkbox"],
input[type="radio"],
select {
  min-height: 44px;
  min-width: 44px;
}

/* But don't force min-height on inline elements */
a:not(.btn-primary):not(.btn-secondary):not(.btn-gold):not(.btn-ghost):not(.btn-danger) {
  min-height: unset;
  min-width: unset;
}

*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid #7B0D1E;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Focus visible on dark backgrounds */
.sidebar *:focus-visible,
.wallet-card *:focus-visible {
  outline-color: #C9A84C;
}


/* ============================================================
   2. CUSTOM SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #F5F5F0;
}

::-webkit-scrollbar-thumb {
  background: #7B0D1E;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5C0A15;
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}


/* ============================================================
   3. SELECTION HIGHLIGHT
   ============================================================ */

::selection {
  background-color: #7B0D1E;
  color: #FFFFFF;
}

::-moz-selection {
  background-color: #7B0D1E;
  color: #FFFFFF;
}


/* ============================================================
   4. NAVIGATION STYLES
   ============================================================ */

#navbar {
  background-color: transparent;
  transition: background-color 0.3s ease,
              box-shadow 0.3s ease,
              backdrop-filter 0.3s ease;
}

#navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#navbar:not(.scrolled) a,
#navbar:not(.scrolled) button {
  color: #FFFFFF;
}

#navbar:not(.scrolled) .leading-tight span:first-child {
  color: #FFFFFF;
}

#navbar:not(.scrolled) .leading-tight span:last-child {
  color: #C9A84C;
}

#navbar:not(.scrolled) a[href="login.html"] {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.4);
}

#navbar:not(.scrolled) a[href="login.html"]:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #FFFFFF;
  color: #FFFFFF;
}

#navbar:not(.scrolled) a[href="register.html"] {
  background-color: #C9A84C;
  color: #111118;
}

#navbar:not(.scrolled) a[href="register.html"]:hover {
  background-color: #E2C97E;
}

#navbar:not(.scrolled) #mobile-menu-btn {
  color: #FFFFFF;
}

#navbar:not(.scrolled) #mobile-menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#mobile-menu {
  background-color: #FFFFFF;
}

#mobile-menu a {
  color: #1F1F2E !important;
  min-height: unset;
}

#mobile-menu a:hover {
  color: #7B0D1E !important;
  background-color: #F5F5F0;
}

#mobile-menu a[href="login.html"] {
  color: #7B0D1E !important;
  border-color: #7B0D1E !important;
}

#mobile-menu a[href="register.html"] {
  color: #FFFFFF !important;
  background-color: #7B0D1E !important;
}


/* ============================================================
   5. HERO SECTION
   ============================================================ */

#hero {
  position: relative;
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

.animate-pulse {
  animation: pulse-soft 2s infinite ease-in-out;
}

.hero-image-frame {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-image-frame:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 100px rgba(123, 13, 30, 0.25);
}

.hero-image-frame .absolute {
  transition: transform 0.3s ease;
}

.hero-image-frame:hover .absolute {
  transform: translateY(-2px);
}


/* ============================================================
   6. STATS COUNTER
   ============================================================ */

.stats-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stats-card:hover {
  transform: translateY(-4px);
}

.counter {
  display: inline-block;
}

.counter-suffix::after {
  content: '+';
}


/* ============================================================
   7. HOW IT WORKS CARDS
   ============================================================ */

.how-card {
  position: relative;
  background: #FFFFFF;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.how-card:hover {
  transform: translateY(-6px);
}


/* ============================================================
   8. SERVICE CARDS
   ============================================================ */

.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #F3F4F6;
}

.service-card:hover {
  border-color: transparent;
}

.service-card.active {
  border-color: #7B0D1E;
  box-shadow: 0 8px 40px rgba(123, 13, 30, 0.12);
}

.service-card.active .w-14 {
  background-color: #7B0D1E !important;
}

.service-card.active .w-14 svg {
  stroke: #FFFFFF !important;
}

@media (max-width: 640px) {
  .service-card {
    padding: 1rem;
  }

  .service-card .w-14 {
    width: 3rem;
    height: 3rem;
  }

  .service-card .w-14 svg {
    width: 20px;
    height: 20px;
  }
}


/* ============================================================
   9. SAFETY CARDS
   ============================================================ */

.safety-card {
  transition: transform 0.3s ease,
              background-color 0.3s ease,
              border-color 0.3s ease;
}

.safety-card:hover {
  transform: translateY(-4px);
}


/* ============================================================
   10. TESTIMONIAL CARDS
   ============================================================ */

.testimonial-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
}


/* ============================================================
   11. FORM STYLES
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-size: 16px; /* Prevents iOS zoom */
}

input:focus,
textarea:focus,
select:focus {
  border-color: #7B0D1E;
  box-shadow: 0 0 0 3px rgba(123, 13, 30, 0.08);
}

::placeholder              { color: #9CA3AF; opacity: 1; }
::-webkit-input-placeholder { color: #9CA3AF; }
::-moz-placeholder          { color: #9CA3AF; opacity: 1; }
:-ms-input-placeholder      { color: #9CA3AF; }

/* Autofill override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset;
  -webkit-text-fill-color: #1F1F2E;
  transition: background-color 5000s ease-in-out 0s;
}

/* Validation states */
input.error,
textarea.error,
select.error {
  border-color: #DC2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

input.success,
textarea.success {
  border-color: #16A34A !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.08);
}

.field-error {
  color: #DC2626;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: none;
}

.field-error.visible {
  display: block;
}


/* ============================================================
   11a. OTP BOX STYLES — NEW (was completely missing)
   ============================================================ */

.otp-box {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1F1F2E;
  border: 2px solid #E5E7EB;
  border-radius: 0.75rem;
  background-color: #FFFFFF;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  caret-color: transparent; /* Hide text cursor in OTP boxes */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 0;
  min-height: unset; /* Override the 44px min touch target for these */
}

.otp-box:focus {
  border-color: #7B0D1E;
  box-shadow: 0 0 0 3px rgba(123, 13, 30, 0.12);
  outline: none;
  transform: scale(1.05);
}

.otp-box:not(:placeholder-shown) {
  border-color: #7B0D1E;
  background-color: rgba(123, 13, 30, 0.03);
}

/* Animate filled boxes */
.otp-box[value]:not([value=""]) {
  border-color: #16A34A;
}

/* OTP container layout helper */
.otp-container {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

@media (max-width: 374px) {
  .otp-box {
    width: 2.5rem;
    height: 3rem;
    font-size: 1.25rem;
  }
}


/* ============================================================
   11b. PASSWORD STRENGTH — NEW (was completely missing)
   ============================================================ */

.strength-bar {
  height: 4px;
  border-radius: 9999px;
  background-color: #E5E7EB;
  flex: 1;
  transition: background-color 0.3s ease;
}

.strength-bars {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
}

#password-strength-text {
  font-size: 0.75rem;
  font-weight: 600;
  transition: color 0.3s ease;
  min-height: 1rem; /* Prevent layout shift */
}


/* ============================================================
   11c. REGISTRATION STEP INDICATOR — NEW (was missing)
   ============================================================ */

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
}

.step-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.3s ease;
  min-height: unset; /* Override touch target for decorative elements */
  min-width: unset;
}

.step-line {
  position: relative;
  height: 2px;
  background-color: #E5E7EB;
  flex: 1;
  overflow: hidden;
}

.step-line > div {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background-color: #16A34A;
  transition: width 0.4s ease;
}


/* ============================================================
   11d. ROLE CARD STYLES — NEW (was missing)
   ============================================================ */

.role-card {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.role-card:hover {
  transform: translateY(-2px);
}

.role-card > div {
  border: 2px solid #E5E7EB;
  border-radius: 1rem;
  padding: 1rem;
  transition: border-color 0.2s ease,
              background-color 0.2s ease,
              box-shadow 0.2s ease;
}

.role-card:hover > div {
  border-color: #C9A84C;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.role-check {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  border: 2px solid #D1D5DB;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  min-height: unset;
  min-width: unset;
}


/* ============================================================
   11e. LOGIN TAB STYLES — NEW (was missing base)
   ============================================================ */

.login-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
  flex: 1;
  border: none;
  background: none;
  min-height: unset;
}


/* ============================================================
   12. BUTTON STYLES
   ============================================================ */

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #7B0D1E;
  color: #FFFFFF;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  box-shadow: 0 4px 24px rgba(123, 13, 30, 0.18);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #5C0A15;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(123, 13, 30, 0.25);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: transparent;
  color: #7B0D1E;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  border: 1.5px solid #7B0D1E;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #7B0D1E;
  color: #FFFFFF;
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #C9A84C;
  color: #111118;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  box-shadow: 0 4px 24px rgba(201, 168, 76, 0.20);
  border: none;
  cursor: pointer;
}

.btn-gold:hover {
  background-color: #E2C97E;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(201, 168, 76, 0.30);
}

/* FIX: Gold button loading spinner — dark colored for visibility */
.btn-gold.btn-loading::after {
  border-color: rgba(17, 17, 24, 0.3);
  border-top-color: #111118;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: transparent;
  color: #6B7280;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
}

.btn-ghost:hover {
  background-color: #F5F5F0;
  color: #1F1F2E;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #DC2626;
  color: #FFFFFF;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
}

.btn-danger:hover { background-color: #B91C1C; }

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  border-radius: 0.5rem;
  min-height: unset;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1rem;
  border-radius: 1rem;
}

.btn-block { width: 100%; }

/* Loading state */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  transform: translate(-50%, -50%);
}

/* FIX: Secondary button loading — red spinner */
.btn-secondary.btn-loading::after {
  border-color: rgba(123, 13, 30, 0.2);
  border-top-color: #7B0D1E;
}

/* FIX: Ghost button loading — gray spinner */
.btn-ghost.btn-loading::after {
  border-color: rgba(107, 114, 128, 0.2);
  border-top-color: #6B7280;
}


/* ============================================================
   13. BADGE & TAG STYLES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  min-height: unset;
  min-width: unset;
}

.badge-red    { background-color: #FEF2F2; color: #7B0D1E; }
.badge-green  { background-color: #F0FDF4; color: #16A34A; }
.badge-yellow { background-color: #FFFBEB; color: #B45309; }
.badge-blue   { background-color: #EFF6FF; color: #2563EB; }
.badge-gray   { background-color: #F3F4F6; color: #6B7280; }
.badge-gold   { background-color: rgba(201, 168, 76, 0.1); color: #C9A84C; }


/* ============================================================
   14. CARD STYLES
   ============================================================ */

.card {
  background-color: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: 1.5rem;
  padding: 1.5rem;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}

.card-bordered  { border: 1px solid #E5E7EB; }
.card-elevated  { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06); border: none; }


/* ============================================================
   15. AVATAR STYLES
   ============================================================ */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  background-color: #F5F5F0;
  color: #7B0D1E;
  min-height: unset;
  min-width: unset;
}

.avatar-xs { width: 1.5rem;  height: 1.5rem;  font-size: 0.5rem; }
.avatar-sm { width: 2rem;    height: 2rem;    font-size: 0.625rem; }
.avatar-md { width: 2.5rem;  height: 2.5rem;  font-size: 0.75rem; }
.avatar-lg { width: 3rem;    height: 3rem;    font-size: 0.875rem; }
.avatar-xl { width: 4rem;    height: 4rem;    font-size: 1.125rem; }

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-online {
  position: relative;
}

.avatar-online::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 25%;
  height: 25%;
  background-color: #16A34A;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
}


/* ============================================================
   16. TOAST NOTIFICATION STYLES
   ============================================================ */

.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 24rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  pointer-events: all;
  animation: toast-in 0.4s ease-out;
  background-color: #FFFFFF;
  color: #1F1F2E;
  border-left: 4px solid #7B0D1E;
}

.toast-success { border-left-color: #16A34A; }
.toast-error   { border-left-color: #DC2626; }
.toast-warning { border-left-color: #F59E0B; }
.toast-info    { border-left-color: #2563EB; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

.toast.removing {
  animation: toast-out 0.3s ease-in forwards;
}

@media (max-width: 640px) {
  .toast-container {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }

  .toast { font-size: 0.8125rem; }

  /* Toast slides up from bottom on mobile */
  @keyframes toast-in {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }
}


/* ============================================================
   17. MODAL / DIALOG STYLES
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: #FFFFFF;
  border-radius: 1.5rem;
  width: 100%;
  max-width: 28rem;
  max-height: 90vh;
  overflow-y: auto;
  /* FIX: iOS momentum scrolling */
  -webkit-overflow-scrolling: touch;
  padding: 2rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  transform: translateY(1rem) scale(0.98);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

/* Modal sizes */
.modal-sm { max-width: 20rem; }
.modal-lg { max-width: 40rem; }
.modal-xl { max-width: 56rem; }

@media (max-width: 640px) {
  .modal {
    margin: 0.5rem;
    padding: 1.5rem;
    border-radius: 1rem;
    max-height: 85vh;
  }
}


/* ============================================================
   18. LOADING / SPINNER STYLES
   ============================================================ */

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2.5px solid #F3F4F6;
  border-top-color: #7B0D1E;
  border-radius: 50%;
  animation: spinner-spin 0.6s linear infinite;
  min-height: unset;
  min-width: unset;
}

/* Use separate keyframe name to avoid conflict with btn-loading */
@keyframes spinner-spin {
  to { transform: rotate(360deg); }
}

.spinner-sm    { width: 1rem;    height: 1rem;    border-width: 2px; }
.spinner-lg    { width: 2.5rem;  height: 2.5rem;  border-width: 3px; }
.spinner-white { border-color: rgba(255,255,255,0.3); border-top-color: #FFFFFF; }
.spinner-gold  { border-color: rgba(201,168,76,0.3);  border-top-color: #C9A84C; }

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: opacity 0.4s ease;
}

.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}


/* ============================================================
   19. STATUS INDICATORS
   ============================================================ */

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  min-height: unset;
  min-width: unset;
}

.status-online  { background-color: #16A34A; box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
.status-offline { background-color: #9CA3AF; }
.status-busy    { background-color: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
.status-error   { background-color: #DC2626; box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }


/* ============================================================
   19a. DRIVER ONLINE TOGGLE — NEW
   ============================================================ */

.driver-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.driver-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.driver-toggle-track {
  width: 3.5rem;
  height: 1.875rem;
  background-color: #E5E7EB;
  border-radius: 9999px;
  transition: background-color 0.3s ease;
  position: relative;
  min-height: unset;
  min-width: unset;
}

.driver-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.5rem;
  height: 1.5rem;
  background-color: #FFFFFF;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.driver-toggle input:checked ~ .driver-toggle-track {
  background-color: #16A34A;
}

.driver-toggle input:checked ~ .driver-toggle-track .driver-toggle-thumb {
  transform: translateX(1.625rem);
}

/* Pulsing ring when online */
.driver-toggle input:checked ~ .driver-toggle-track::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  border: 2px solid rgba(22, 163, 74, 0.4);
  animation: toggle-pulse 2s ease-in-out infinite;
}

@keyframes toggle-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0; transform: scale(1.1); }
}


/* ============================================================
   19b. RIDE REQUEST CARD — NEW
   ============================================================ */

.ride-request-card {
  background: #FFFFFF;
  border: 2px solid #C9A84C;
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: 0 8px 40px rgba(201, 168, 76, 0.15);
  animation: request-slide-in 0.4s ease-out;
}

@keyframes request-slide-in {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ride-request-timer {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: conic-gradient(#7B0D1E 0deg, #E5E7EB 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #7B0D1E;
  position: relative;
  min-height: unset;
  min-width: unset;
}

.ride-request-timer::before {
  content: '';
  position: absolute;
  inset: 4px;
  background: #FFFFFF;
  border-radius: 50%;
}

.ride-request-timer span {
  position: relative;
  z-index: 1;
}


/* ============================================================
   19c. DOCUMENT UPLOAD ZONE — NEW
   ============================================================ */

.doc-upload-zone {
  border: 2px dashed #E5E7EB;
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.doc-upload-zone:hover {
  border-color: #7B0D1E;
  background-color: rgba(123, 13, 30, 0.02);
}

.doc-upload-zone.dragover {
  border-color: #7B0D1E;
  background-color: rgba(123, 13, 30, 0.04);
  transform: scale(1.01);
}

.doc-upload-zone.uploaded {
  border-color: #16A34A;
  background-color: rgba(22, 163, 74, 0.03);
}

.doc-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  font-size: 16px;
  min-height: unset;
}


/* ============================================================
   19d. CHART CONTAINER — NEW
   ============================================================ */

.chart-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.chart-bar-wrap {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100%;
}

.chart-bar {
  flex: 1;
  background-color: rgba(123, 13, 30, 0.15);
  border-radius: 3px 3px 0 0;
  transition: height 0.6s ease, background-color 0.2s ease;
  min-width: 0;
  cursor: pointer;
  position: relative;
}

.chart-bar:hover {
  background-color: #7B0D1E;
}

.chart-bar-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1F1F2E;
  color: #FFFFFF;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.chart-bar:hover .chart-bar-tooltip {
  opacity: 1;
}


/* ============================================================
   20. UTILITY CLASSES
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

body.no-scroll { overflow: hidden; }

.truncate-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.divider { height: 1px; background-color: #F3F4F6; width: 100%; }


/* ============================================================
   21. PAGE TRANSITION
   ============================================================ */

.page-transition {
  opacity: 0;
  animation: page-fade-in 0.4s ease-out forwards;
}

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   22. RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 374px) {
  .font-display  { font-size: 1.75rem !important; }
  #hero h1       { font-size: 1.875rem; }
  #hero h1 span:last-child { font-size: 1.5rem; }
}

@media (max-height: 500px) and (orientation: landscape) {
  #hero {
    min-height: auto;
    padding-top: 5rem;
    padding-bottom: 3rem;
  }
}

@media print {
  nav,
  footer,
  #mobile-menu,
  .toast-container,
  .sidebar {
    display: none !important;
  }

  body     { color: #000000; background: #FFFFFF; }
  a        { text-decoration: underline; }
  section  { page-break-inside: avoid; }

  .main-with-sidebar { margin-left: 0 !important; }
}


/* ============================================================
   23. MAP CONTAINER
   ============================================================ */

.map-container {
  width: 100%;
  height: 300px;
  border-radius: 1rem;
  overflow: hidden;
  background-color: #E5E7EB;
  position: relative;
}

/* Map placeholder when Google Maps not loaded */
.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #F3F4F6, #E5E7EB);
  color: #6B7280;
  font-size: 0.875rem;
}

.map-container.map-lg   { height: 400px; }
.map-container.map-full { height: calc(100vh - 8rem); border-radius: 0; }

@media (min-width: 768px) {
  .map-container      { height: 400px; }
  .map-container.map-lg { height: 500px; }
}


/* ============================================================
   24. WALLET / FINANCE
   ============================================================ */

.wallet-card {
  background: linear-gradient(135deg, #7B0D1E 0%, #5C0A15 60%, #111118 100%);
  color: #FFFFFF;
  border-radius: 1.5rem;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(201,168,76,0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.wallet-card .wallet-balance {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}


/* ============================================================
   25. TABLE STYLES (ADMIN)
   ============================================================ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6B7280;
  background-color: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #F3F4F6;
  color: #1F1F2E;
  vertical-align: middle;
}

.data-table tbody tr:hover   { background-color: #FAFAFA; }
.data-table tbody tr:last-child td { border-bottom: none; }

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 1rem;
  border: 1px solid #E5E7EB;
  background-color: #FFFFFF;
}


/* ============================================================
   26. SIDEBAR (ADMIN / DASHBOARDS)
   ============================================================ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background-color: #111118;
  color: #FFFFFF;
  z-index: 100;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS momentum scroll */
  transition: transform 0.3s ease;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  border-radius: 0.75rem;
  margin: 0.125rem 0.75rem;
  transition: all 0.2s ease;
  min-height: unset;
}

.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.sidebar-link.active {
  background-color: #7B0D1E;
  color: #FFFFFF;
  font-weight: 600;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link.active svg { opacity: 1; }

.main-with-sidebar {
  margin-left: 260px;
  min-height: 100vh;
  background-color: #F5F5F0;
}

/* FIX: Mobile sidebar overlay — was missing */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-with-sidebar { margin-left: 0; }

  .sidebar-overlay.active {
    display: block;
  }
}


/* ============================================================
   27. DASHBOARD STAT CARDS
   ============================================================ */

.dash-stat-card {
  background-color: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: 1.25rem;
  padding: 1.25rem;
  transition: box-shadow 0.3s ease;
}

.dash-stat-card:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.dash-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1F1F2E;
  letter-spacing: -0.02em;
}

.dash-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-stat-change         { font-size: 0.75rem; font-weight: 600; }
.dash-stat-change.positive { color: #16A34A; }
.dash-stat-change.negative { color: #DC2626; }


/* ============================================================
   28. VERIFICATION BADGES
   ============================================================ */

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #16A34A;
  min-height: unset;
}

.verified-badge svg { width: 14px; height: 14px; fill: #16A34A; }

.unverified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #F59E0B;
  min-height: unset;
}


/* ============================================================
   29. RIDE STATUS COLORS
   ============================================================ */

.ride-status {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  display: inline-block;
  min-height: unset;
}

.ride-status-pending   { background-color: #FEF3C7; color: #B45309; }
.ride-status-accepted  { background-color: #DBEAFE; color: #2563EB; }
.ride-status-active    { background-color: #D1FAE5; color: #059669; }
.ride-status-completed { background-color: #F0FDF4; color: #16A34A; }
.ride-status-cancelled { background-color: #FEE2E2; color: #DC2626; }


/* ============================================================
   30. ACCORDION (PROFILE PAGES)
   ============================================================ */

.accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  min-height: unset;
}

.accordion-content {
  display: none;
  padding: 0 1.25rem 1.25rem;
}

.accordion-content.open {
  display: block;
}

.accordion-icon {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.accordion-btn[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}


/* ============================================================
   END OF STYLESHEET v1.1.0
   ============================================================ */