/* ==========================================================================
   Customer Portal Mobile-App CSS (Ultra Premium Native UI)
   Includes Responsive Desktop Media Queries (768px+) & Luminous Glassmorphism Cards
   ========================================================================== */

.app-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: #0B192C;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: 70px; /* Space for bottom nav */
  transition: max-width 0.3s ease;
  color: #F8FAFC;
}

/* Status & Connectivity Bar */
.status-bar {
  background-color: #061729;
  color: #94A3B8;
  padding: 0.4rem 1.25rem;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.status-bar .signal-dot {
  width: 7px;
  height: 7px;
  background-color: var(--status-success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: var(--shadow-glow-success);
}

.app-header {
  background-color: #061729;
  color: #FFFFFF;
  padding: 0.95rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 180, 216, 0.2);
}

/* WIZARD INDICATOR BAR HIGH-CONTRAST VISIBILITY FIX */
.wizard-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background-color: #061729;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  font-weight: 800;
  color: #FFFFFF;
}

.wizard-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.wizard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-aqua), #10B981);
  transition: width 0.3s ease;
}

/* WIZARD ULTRA-PREMIUM GLASS CARDS */
.wizard-card-premium {
  background: linear-gradient(145deg, #0F172A, #1E293B);
  border: 1px solid rgba(0, 180, 216, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: #FFFFFF;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.wizard-card-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-aqua), #10B981, #0077B6);
}

.glass-step-heading {
  font-family: var(--font-heading);
  color: #FFFFFF !important;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.glass-step-sub {
  color: #94A3B8 !important;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.location-picker-bar {
  background: #1E293B;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: #FFFFFF;
}

.location-text {
  font-size: 0.875rem;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.capacity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 0.75rem;
}

.capacity-card {
  background: #0F172A;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  color: #FFFFFF;
}

.capacity-card:hover, .capacity-card.selected {
  border-color: var(--accent-aqua);
  background: rgba(0, 180, 216, 0.12);
  box-shadow: 0 8px 24px rgba(0, 180, 216, 0.3);
  transform: translateY(-3px);
}

.capacity-card.selected {
  border-color: var(--accent-aqua);
}

.capacity-card .popular-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: linear-gradient(135deg, var(--accent-aqua), #0077B6);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-glow);
}

.capacity-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #FFFFFF;
}

.capacity-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-aqua);
  margin-top: 0.35rem;
}

.progress-bar-mini {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.progress-bar-mini .fill {
  height: 100%;
  background: var(--accent-aqua);
}

/* Dispatch Radio Selector */
.dispatch-selector-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.dispatch-option-card {
  flex: 1;
  background: #0F172A;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 1rem 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: #FFFFFF;
}

.dispatch-option-card:hover, .dispatch-option-card.selected {
  border-color: var(--accent-aqua);
  background: rgba(0, 180, 216, 0.15);
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.25);
  transform: translateY(-2px);
}

/* STEP 4 INVOICE & BILL BREAKDOWN HIGH-CONTRAST VISIBILITY FIX */
.checkout-invoice-card {
  background: #0F172A !important;
  border: 1px solid rgba(0, 180, 216, 0.4) !important;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  color: #FFFFFF !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.bill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: #E2E8F0 !important;
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
}

.bill-row span {
  color: #E2E8F0 !important;
}

.bill-row.total {
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  margin-top: 0.75rem;
  padding-top: 0.85rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF !important;
}

.bill-row.total span {
  color: #FFFFFF !important;
}

.trust-badge-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #CBD5E1 !important;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.65rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tracking Map View */
.tracking-map-container {
  height: 320px;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}

#customerMap {
  height: 100%;
  width: 100%;
}

.map-control-floating {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  background: rgba(10, 37, 64, 0.85);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-dark);
}

/* ORDER STATUS TIMELINE STEPPER */
.stepper-bar {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 1.5rem 0 1.25rem;
}

.stepper-bar::before {
  content: '';
  position: absolute;
  top: 17px;
  left: 12%;
  width: 76%;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.15);
  z-index: 1;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
  flex: 1;
  text-align: center;
}

.step-node {
  background: #0F172A;
  border: 3px solid rgba(255, 255, 255, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #94A3B8;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all var(--transition-fast);
}

.step-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94A3B8;
  line-height: 1.2;
}

.step-item.active .step-node {
  border-color: var(--accent-aqua);
  background-color: var(--accent-aqua);
  color: #FFFFFF;
  box-shadow: 0 0 16px rgba(0, 180, 216, 0.65);
  animation: stepPulseGlow 1.8s infinite ease-in-out;
}

@keyframes stepPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(0, 180, 216, 0);
    transform: scale(1.08);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 180, 216, 0);
    transform: scale(1);
  }
}

.step-item.active .step-label {
  color: var(--accent-aqua);
  font-weight: 800;
}

.step-item.completed .step-node {
  border-color: var(--status-success);
  background-color: var(--status-success);
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.step-item.completed .step-label {
  color: #34D399;
  font-weight: 700;
}

.driver-info-drawer {
  background: #1E293B;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

/* ULTRA-PREMIUM GLASSMORPHIC LIVE ETA BADGE */
.eta-badge {
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.18), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(0, 180, 216, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #FFFFFF;
  padding: 0.55rem 1.1rem;
  border-radius: 24px;
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: 0 8px 20px rgba(0, 180, 216, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  transition: all 0.3s ease;
}

.eta-live-pulse {
  width: 9px;
  height: 9px;
  background-color: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10B981;
  animation: etaPulseGlow 1.8s infinite ease-in-out;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes etaPulseGlow {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.otp-box-card {
  background: linear-gradient(135deg, var(--primary-navy-dark), var(--primary-navy));
  color: #FFFFFF;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-dark);
}

.otp-code-highlight {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-aqua);
  letter-spacing: 2px;
  background: rgba(0, 180, 216, 0.15);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent-aqua);
}

/* Bottom Navigation Bar */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background-color: #061729;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-around;
  padding: 0.65rem 0;
  z-index: 1000;
  transition: max-width 0.3s ease;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: #94A3B8;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.bottom-nav-item.active {
  color: var(--accent-aqua);
}

.bottom-nav-item .icon {
  font-size: 1.2rem;
}

/* ==========================================================================
   DESKTOP RESPONSIVE LAYOUTS (768px & 1024px Viewports)
   ========================================================================== */
@media (min-width: 768px) {
  body {
    background-color: #030B15;
    padding: 1.5rem 0;
  }

  .app-wrapper {
    max-width: 1140px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    min-height: 850px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .bottom-nav-bar {
    max-width: 1140px;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
  }

  /* 2-Column Responsive Layouts for Booking Wizard Pages */
  .desktop-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    align-items: start;
  }

  .capacity-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tracking-map-container {
    height: 480px;
  }
}

@media (min-width: 1024px) {
  .capacity-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Modal Overlay & Dialog Container Rules */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(5, 11, 20, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  z-index: 99999 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1.25rem !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.modal-card {
  background: #0F172A;
  border: 2px solid var(--accent-aqua);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  color: #FFFFFF;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

/* Mobile Responsiveness & Equal-Height Button Alignment Fixes */
.portal-services-grid, .capacity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  align-items: stretch;
}

.capacity-card {
  box-sizing: border-box;
  overflow: hidden;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.capacity-card .btn {
  margin-top: auto !important;
  white-space: normal !important;
  word-break: break-word;
  padding: 0.55rem 0.4rem !important;
  font-size: 0.82rem !important;
  line-height: 1.2;
  width: 100%;
}

@media (max-width: 520px) {
  .portal-services-grid {
    grid-template-columns: 1fr;
  }
  .capacity-grid {
    grid-template-columns: 1fr;
  }
  .wizard-card-premium {
    padding: 1.15rem 0.95rem;
  }
}
