/* =============================================
   FUELSHARE — NATIVE MOBILE APP UI
   Primary: #1565c0 | Accent: #f97316
   Mobile-first, max 480px phone frame
   ============================================= */

:root {
  --primary:       #1565c0;
  --primary-dk:    #0d47a1;
  --primary-lt:    #1976d2;
  --primary-tint:  #1e88e5;
  --primary-bg:    #e3f2fd;
  --primary-rgb:   21, 101, 192;

  --accent:        #f97316;
  --accent-dk:     #ea6c00;
  --accent-bg:     #fff3e8;

  --danger:        #ef4444;
  --danger-bg:     #fef2f2;
  --warning:       #f59e0b;
  --warning-bg:    #fffbeb;
  --success:       #10b981;
  --success-bg:    #ecfdf5;

  --white:         #ffffff;
  --bg:            #f0f4f8;
  --card:          #ffffff;
  --text:          #1a1a2e;
  --text-md:       #374151;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --border-lt:     #f1f5f9;

  --toolbar-h:     56px;
  --tabbar-h:      64px;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 2px 12px rgba(0,0,0,.10);
  --shadow-md:     0 4px 20px rgba(0,0,0,.13);

  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     18px;
  --radius-xl:     24px;

  --max-w:         480px;

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; font-size: 16px; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
a { color: var(--primary); text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; border-radius: inherit; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, select, textarea { font-family: var(--font); }

/* =============================================
   PHONE FRAME WRAPPER (desktop centering)
   ============================================= */
.app-header,
.tab-bar,
.page-footer,
.flash-wrap,
.verify-banner,
.fuel-ticker {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
}

/* =============================================
   FUEL PRICE TICKER
   ============================================= */
.fuel-ticker {
  position: fixed;
  top: calc(var(--toolbar-h) + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: 28px;
  background: #0f3460;
  z-index: 290;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.fuel-ticker-inner {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  padding: 0 12px;
  font-size: 11px;
}
.fuel-ticker-inner.fuel-ticker-scroll {
  animation: fuel-scroll 30s linear infinite;
}
@keyframes fuel-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.fuel-ticker-label {
  color: rgba(255,255,255,.5);
  font-weight: 600;
  letter-spacing: .3px;
  margin-right: 4px;
  flex-shrink: 0;
}
.fuel-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 14px;
  flex-shrink: 0;
}
.fuel-ticker-type {
  color: rgba(255,255,255,.65);
  font-size: 10px;
}
.fuel-ticker-price {
  color: #f0a500;
  font-weight: 700;
  font-size: 12px;
}
.fuel-ticker-state {
  color: rgba(255,255,255,.4);
  font-size: 9px;
  background: rgba(255,255,255,.1);
  padding: 1px 4px;
  border-radius: 3px;
}
.fuel-ticker-loading {
  color: rgba(255,255,255,.4);
  font-size: 11px;
}
.fuel-ticker-time {
  color: rgba(255,255,255,.3);
  font-size: 9px;
  margin-left: 8px;
  flex-shrink: 0;
}

/* On desktop, we center the app like a phone frame */
@media (min-width: 520px) {
  body {
    background: #dde3ea;
  }
  .app-header {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: 0 2px 16px rgba(0,0,0,.25);
  }
  .tab-bar {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    box-shadow: 0 -2px 16px rgba(0,0,0,.15);
  }
}

/* =============================================
   TOP TOOLBAR
   ============================================= */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: var(--toolbar-h);
  background: var(--primary);
  z-index: 300;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--toolbar-h) + env(safe-area-inset-top));
}
.toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--toolbar-h);
  padding: 0 16px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.app-logo {
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
}
.app-logo:hover { text-decoration: none; opacity: .9; }

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-toolbar-login {
  color: rgba(255,255,255,.9);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 20px;
  min-height: 36px;
  display: flex;
  align-items: center;
}
.btn-toolbar-signup {
  color: var(--primary);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  min-height: 36px;
  display: flex;
  align-items: center;
}
.toolbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.5);
}
.toolbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* =============================================
   VERIFY BANNER
   ============================================= */
.verify-banner {
  position: fixed;
  top: calc(var(--toolbar-h) + env(safe-area-inset-top));
  left: 0; right: 0;
  z-index: 250;
  background: var(--warning);
  color: #1a1a2e;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: center;
  justify-content: center;
}
.verify-banner a { color: var(--primary-dk); font-weight: 700; text-decoration: underline; }
body.has-banner .page-content { padding-top: calc(var(--toolbar-h) + env(safe-area-inset-top) + 36px); }

/* =============================================
   FLASH MESSAGES
   ============================================= */
.flash-wrap {
  position: fixed;
  top: calc(var(--toolbar-h) + env(safe-area-inset-top) + 8px);
  left: 0; right: 0;
  z-index: 400;
  padding: 0 12px;
  pointer-events: none;
}
.flash {
  pointer-events: auto;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideDown .25s ease;
}
@keyframes slideDown {
  from { opacity:0; transform: translateY(-8px); }
  to   { opacity:1; transform: translateY(0); }
}
.flash-success { background: var(--success); color: #fff; }
.flash-error   { background: var(--danger);  color: #fff; }
.flash-warning { background: var(--warning); color: #1a1a2e; }
.flash-info    { background: var(--primary); color: #fff; }

/* =============================================
   MAIN PAGE CONTENT
   ============================================= */
.page-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: calc(var(--toolbar-h) + 28px + env(safe-area-inset-top));
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  min-height: 100vh;
  background: var(--bg);
}

/* =============================================
   BOTTOM TAB BAR
   ============================================= */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: stretch;
  z-index: 300;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  position: relative;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  transition: color .12s;
}
.tab-item ion-icon {
  font-size: 22px;
}
.tab-item.active { color: var(--primary); }
.tab-item:active { opacity: .6; }

.tab-label { font-size: 10px; line-height: 1; letter-spacing: 0.1px; }

.tab-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Center FAB post button — flat, no glow */
.tab-post {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tab-post-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  text-decoration: none;
  margin-bottom: 10px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s, opacity .12s;
}
.tab-post-btn ion-icon { font-size: 24px; }
.tab-post-btn:active {
  transform: scale(0.92);
  opacity: .85;
}

/* =============================================
   PAGE FOOTER
   ============================================= */
.page-footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px 16px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  border-top: 1px solid var(--border-lt);
}
.footer-sep { margin: 0 6px; }
.page-footer a { color: var(--text-muted); }

/* =============================================
   CARDS
   ============================================= */
.detail-card,
.ride-card,
.review-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  overflow: hidden;
}
.detail-card {
  padding: 16px;
  margin-bottom: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  transition: box-shadow .15s;
}
.detail-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =============================================
   RIDE CARDS
   ============================================= */
.rides-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 12px;
}
.ride-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 10px;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .15s, transform .15s;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.ride-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,.13);
}
.ride-card:active {
  transform: scale(0.99);
  box-shadow: var(--shadow);
}
.ride-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border-lt);
}
.ride-card-body {
  padding: 10px 14px 8px;
}
.ride-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border-lt);
  background: #fafcff;
}
.ride-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.price-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.ride-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* =============================================
   ROUTE ROW
   ============================================= */
.route-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.route-city {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.route-state {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--border-lt);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 500;
}
.route-arrow {
  font-size: 16px;
  color: var(--primary);
  font-weight: 700;
  margin: 0 2px;
}
/* Suburb autocomplete dropdown */
.suburb-dropdown {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  z-index: 500;
  max-height: 220px;
  overflow-y: auto;
}
.suburb-dropdown-item {
  padding: 11px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--border-lt);
}
.suburb-dropdown-item:last-child { border-bottom: none; }
.suburb-dropdown-item:hover { background: var(--bg); }
.suburb-dropdown-item strong { color: var(--text); }
.suburb-dropdown-item span { color: var(--text-muted); font-size: 12px; margin-left: 6px; }

.route-dist {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border-lt);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
  font-weight: 500;
}

/* =============================================
   META CHIPS
   ============================================= */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 20px;
}
.meta-chip ion-icon { font-size: 13px; }

/* =============================================
   AVATAR
   ============================================= */
.avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-md { width: 56px; height: 56px; min-width: 56px; font-size: 22px; }
.avatar-xl { width: 80px; height: 80px; min-width: 80px; font-size: 32px; }

/* =============================================
   DRIVER INFO / BADGE
   ============================================= */
.driver-info {
  flex: 1;
  min-width: 0;
}
.driver-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.driver-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.driver-badge-lg {
  font-size: 12px;
  padding: 4px 10px;
}
.driver-badge-pending {
  display: inline-flex;
  align-items: center;
  background: var(--warning-bg);
  color: #92610b;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--warning);
}

/* =============================================
   STARS / RATING
   ============================================= */
.stars-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.stars { display: inline-flex; gap: 1px; }
.star-full  { color: #f59e0b; font-size: 13px; }
.star-half  { color: #f59e0b; font-size: 13px; opacity: .6; }
.star-empty { color: #d1d5db; font-size: 13px; }
.rating-val { font-size: 12px; color: var(--text-muted); }

/* =============================================
   VEHICLE TAG / PHOTO
   ============================================= */
.vehicle-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.vehicle-tag ion-icon { font-size: 14px; }
.vehicle-photo,
.vehicle-photo-preview {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* =============================================
   SECTION HEADERS
   ============================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.section-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}
.rides-section { background: var(--bg); }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  gap: 10px;
}
.empty-state ion-icon { font-size: 52px; color: var(--border); }
.empty-state h3 { font-size: 18px; color: var(--text); }
.empty-state p { font-size: 14px; line-height: 1.5; }

/* =============================================
   FORMS
   ============================================= */
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-md);
  margin-bottom: 6px;
}
.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  height: 48px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,101,192,.12);
}
.form-textarea {
  height: auto;
  min-height: 100px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-row {
  display: flex;
  gap: 10px;
}
.form-row > * { flex: 1; min-width: 0; }
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}
.form-error-list {
  background: var(--danger-bg);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--danger);
}
.form-error-list ul { padding-left: 16px; list-style: disc; }
.form-error-list li { margin-bottom: 4px; }
.form-page {
  padding: 16px;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .1s, transform .1s;
  white-space: nowrap;
}
.btn:active { opacity: .85; transform: scale(0.98); }
.btn-block { width: 100%; display: flex; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dk); border-color: var(--primary-dk); }
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-bg); }
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-light {
  background: var(--bg);
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-light:hover { background: var(--border); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-sm { height: 36px; font-size: 13px; padding: 0 14px; }
.btn-lg { height: 52px; font-size: 16px; border-radius: var(--radius); }

/* =============================================
   PAGE HEADER BAND (blue band on some pages)
   ============================================= */
.page-header {
  background: var(--primary);
  color: #fff;
  padding: 16px 16px 20px;
}

/* =============================================
   HERO SEARCH (home)
   ============================================= */
.hero-search-section {
  background: var(--primary);
  padding: 24px 16px 28px;
  color: #fff;
}
.hero-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.2;
  letter-spacing: -0.3px;
}
.hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,.8);
  margin-bottom: 18px;
}
.search-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-md);
}
.search-box .form-group { margin-bottom: 10px; }
.search-box .form-group:last-of-type { margin-bottom: 14px; }

/* =============================================
   SEARCH FILTER BAR
   ============================================= */
.search-filter-bar {
  background: var(--card);
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.search-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.search-filter-row .form-group { flex: 1; margin-bottom: 0; }
.btn-search-submit {
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  margin-top: 4px;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .1s;
  cursor: pointer;
}
.btn-search-submit:active { opacity: .85; }

/* =============================================
   HOW IT WORKS NUMBERS
   ============================================= */
.howto-num {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =============================================
   TRIP DETAIL — ROUTE HEADER
   ============================================= */
.trip-route-header {
  background: var(--primary);
  padding: 20px 16px 20px;
  color: #fff;
}
.trip-route-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  margin-bottom: 14px;
}
.trip-route-city {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.trip-route-state {
  font-size: 13px;
  color: rgba(255,255,255,.75);
  margin-top: 2px;
}
.trip-route-arrow {
  font-size: 24px;
  color: rgba(255,255,255,.7);
  flex-shrink: 0;
}
.trip-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.trip-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
}
.trip-meta-chip ion-icon { font-size: 13px; }

/* =============================================
   DRIVER CARD (detail page)
   ============================================= */
.driver-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.driver-card-info { flex: 1; min-width: 0; }
.driver-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.driver-card-name a { color: var(--text); }
.driver-card-bio {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* =============================================
   CONTACT REVEAL
   ============================================= */
.contact-reveal {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--success-bg);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  color: #065f46;
}
.contact-reveal ion-icon { font-size: 20px; color: var(--success); }

/* =============================================
   MESSAGE FORM (on ride detail)
   ============================================= */
.message-form .form-textarea { min-height: 80px; }

/* =============================================
   REVIEW CARD
   ============================================= */
.review-card {
  padding: 12px 14px;
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.review-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.review-date {
  font-size: 12px;
  color: var(--text-muted);
}
.review-body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* =============================================
   STAR PICKER (review form)
   ============================================= */
.star-picker {
  display: flex;
  flex-direction: row-reverse;
  gap: 6px;
  font-size: 32px;
  justify-content: flex-end;
}
.star-picker input { display: none; }
.star-picker label {
  cursor: pointer;
  color: #d1d5db;
  transition: color .1s;
}
.star-picker input:checked ~ label,
.star-picker label:hover,
.star-picker label:hover ~ label {
  color: #f59e0b;
}

/* =============================================
   TEXT UTILITIES
   ============================================= */
.text-muted { color: var(--text-muted); }

/* =============================================
   AUTH PAGES (login / register)
   ============================================= */
.auth-page {
  min-height: calc(100vh - var(--toolbar-h) - var(--tabbar-h));
  padding: 28px 24px 40px;
  max-width: 360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.auth-logo {
  text-align: center;
  margin-bottom: 20px;
}
.auth-logo-mark {
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(21,101,192,.35);
}
.auth-title {
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
  color: var(--text);
}
.auth-sub {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}
.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 20px;
}
.auth-switch a { color: var(--primary); font-weight: 700; }
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* =============================================
   DRIVER FIELDS (register / profile)
   ============================================= */
.driver-toggle-wrap { margin-bottom: 8px; }
.driver-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  -webkit-tap-highlight-color: transparent;
}
.driver-checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.driver-checkbox-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.driver-fields {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
  margin-top: 10px;
}
.driver-fields-header {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =============================================
   PROFILE HERO
   ============================================= */
.profile-hero {
  background: var(--primary);
  color: #fff;
  padding: 28px 16px 24px;
  text-align: center;
}
.profile-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.profile-avatar-wrap .avatar {
  border: 3px solid rgba(255,255,255,.5);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.profile-name {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}
.profile-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 4px;
}
.profile-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 18px;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius);
  overflow: hidden;
}
.profile-stat {
  flex: 1;
  padding: 12px 8px;
  border-right: 1px solid rgba(255,255,255,.2);
}
.profile-stat:last-child { border-right: none; }
.profile-stat-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.profile-stat-label {
  font-size: 11px;
  color: rgba(255,255,255,.75);
  margin-top: 2px;
}

/* =============================================
   TAB SEGMENTS (inbox: received / sent)
   ============================================= */
.tab-segments {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.tab-segment {
  flex: 1;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color .15s, border-color .15s;
}
.tab-segment.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.badge {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =============================================
   MESSAGES LIST (inbox)
   ============================================= */
.messages-list {
  display: flex;
  flex-direction: column;
}
.message-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border-lt);
  text-decoration: none;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  transition: background .1s;
}
.message-item:active { background: var(--bg); }
.message-item.unread { background: #eef4ff; }
.message-item .driver-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.message-item-body { flex: 1; min-width: 0; }
.message-sender { font-size: 15px; font-weight: 700; color: var(--text); }
.message-item.unread .message-sender { color: var(--primary); }
.message-subject {
  font-size: 13px;
  color: var(--text-md);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.message-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.message-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.message-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  display: block;
  flex-shrink: 0;
}

/* =============================================
   MESSAGE THREAD (chat bubbles)
   ============================================= */
.thread-messages {
  padding: 12px 12px 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.thread-msg {
  max-width: 80%;
  align-self: flex-start;
}
.thread-msg.sent { align-self: flex-end; }
.thread-msg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.thread-msg-from { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.thread-msg-time { font-size: 11px; color: var(--text-muted); }
.thread-msg-body {
  background: var(--card);
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
  padding: 10px 13px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}
.thread-msg.sent .thread-msg-header { flex-direction: row-reverse; }
.thread-msg.sent .thread-msg-body {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  border-bottom-right-radius: 4px;
}
.thread-reply-form {
  position: fixed;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  left: 0; right: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  z-index: 200;
}
.thread-reply-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.thread-reply-row .form-textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 15px;
}
.thread-send-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  transition: opacity .1s, transform .1s;
}
.thread-send-btn:active { opacity: .85; transform: scale(0.93); }

/* =============================================
   VERIFY EMAIL PAGE
   ============================================= */
.verify-page {
  padding: 32px 24px;
  text-align: center;
  max-width: 360px;
  margin: 0 auto;
}

/* =============================================
   MY RIDES LIST
   ============================================= */
.my-rides-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* =============================================
   DESKTOP FRAME STYLES
   ============================================= */
@media (min-width: 520px) {
  .page-content {
    box-shadow: 0 0 40px rgba(0,0,0,.15);
  }

  .app-header {
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-w);
  }
  .tab-bar {
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-w);
  }
  .flash-wrap {
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(var(--max-w) - 24px);
    width: 100%;
  }
  .verify-banner {
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-w);
  }
  .thread-reply-form {
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
  }
}
