/* ===== Base ===== */
html, body {
  font-size: 16px; /* base 16px no mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", sans-serif;
  letter-spacing: -0.01em;
}

button { font-family: inherit; }

/* Aumenta input padrão */
input, select, textarea {
  font-size: 16px;
}

/* ===== Animações ===== */
.fade-in { animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.slide-up { animation: slideUp 0.3s ease-out; }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

#signature-pad {
  touch-action: none;
}

.input-field {
  background: #f3f4f6;
  border-radius: 14px;
  padding: 16px;
  width: 100%;
  font-weight: 600;
  font-size: 16px;
  outline: none;
  margin-bottom: 12px;
  border: 2px solid transparent;
  transition: 0.2s;
}
.input-field:focus { border-color: #E8B93A; background: #fff; }

/* ===== Bottom nav ===== */
#bottom-nav button {
  min-height: 64px;
  transition: all 0.18s ease;
  position: relative;
}
#bottom-nav button.active i {
  color: #1B304F;
  transform: translateY(-2px) scale(1.18);
}
#bottom-nav button.active span {
  color: #1B304F;
  font-weight: 800;
}
#bottom-nav button.active::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #E8B93A, #BE9320);
  box-shadow: 0 0 8px rgba(232,185,58,0.6);
}
#bottom-nav button:not(.active) i,
#bottom-nav button:not(.active) span {
  color: #9CA3AF;
}

/* ===== Botões grandes (CTAs) ===== */
.btn-primary {
  min-height: 56px;
  background: linear-gradient(135deg, #1B304F 0%, #2E4A75 100%);
  color: #fff;
  font-weight: 800;
  border-radius: 16px;
  font-size: 16px;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px -4px rgba(27, 48, 79, 0.4);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.btn-primary:active { transform: scale(0.97); box-shadow: 0 4px 10px -2px rgba(27, 48, 79, 0.4); }

.btn-accent {
  min-height: 56px;
  background: linear-gradient(135deg, #E8B93A 0%, #BE9320 100%);
  color: #0F1F3A;
  font-weight: 900;
  border-radius: 16px;
  font-size: 16px;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px -4px rgba(232, 185, 58, 0.5);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.btn-accent:active { transform: scale(0.97); }

.btn-success {
  min-height: 56px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #fff;
  font-weight: 800;
  border-radius: 16px;
  font-size: 16px;
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.4);
}

/* ===== Cards ===== */
.card-elevated {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #f1f5f9;
}

.card-primary-gradient {
  background: linear-gradient(135deg, #1B304F 0%, #0F1F3A 100%);
  color: #fff;
  border-radius: 22px;
  box-shadow: 0 10px 30px -8px rgba(27, 48, 79, 0.5);
}

.card-accent-gradient {
  background: linear-gradient(135deg, #E8B93A 0%, #F5DC8A 100%);
  color: #0F1F3A;
  border-radius: 22px;
  box-shadow: 0 10px 30px -8px rgba(232, 185, 58, 0.5);
}

/* ===== Banner CTA Virar Entregador (super destacado) ===== */
.cta-driver {
  background: linear-gradient(135deg, #E8B93A 0%, #F5DC8A 60%, #E8B93A 100%);
  border-radius: 22px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px -8px rgba(232, 185, 58, 0.6);
  border: 2px solid #BE9320;
}
.cta-driver::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
}

/* ===== Radar (tracking) ===== */
.radar-ping {
  animation: radarPing 2.5s cubic-bezier(0,0,0.2,1) infinite;
}
@keyframes radarPing {
  0% { transform: scale(0.5); opacity: 0.7; }
  80%, 100% { transform: scale(2); opacity: 0; }
}

/* ===== Splash ===== */
#splash-screen.faded {
  opacity: 0;
  pointer-events: none;
}

/* ===== Filter pills ===== */
.filter-pill {
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
  min-width: 0;
}
.filter-pill.active {
  background: #1B304F;
  color: #fff;
  box-shadow: 0 4px 10px -2px rgba(27, 48, 79, 0.4);
}
.filter-pill:not(.active) {
  color: #6B7280;
}

/* ===== Status badge ===== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===== Toast premium ===== */
#toast-notification {
  border-radius: 16px;
  font-weight: 600;
}

/* =====================================================================
 *  DARK MODE
 *  Ativa via body.dark-mode (gerenciado por src/js/theme.js).
 *  Sobrescreve apenas o necessário pra preservar a identidade NaMão
 *  (azul navy + dourado) em fundo escuro.
 * ===================================================================== */
body.dark-mode {
  background-color: #0B1426;
  color: #E5E7EB;
}

/* Backgrounds de tela / cards */
body.dark-mode .bg-white,
body.dark-mode .bg-gray-50,
body.dark-mode .bg-gray-100 {
  background-color: #142036 !important;
}
body.dark-mode .bg-gray-200,
body.dark-mode .bg-gray-300 {
  background-color: #1B304F !important;
}

/* Textos */
body.dark-mode .text-gray-900,
body.dark-mode .text-black {
  color: #F3F4F6 !important;
}
body.dark-mode .text-gray-700,
body.dark-mode .text-gray-800 {
  color: #E5E7EB !important;
}
body.dark-mode .text-gray-500,
body.dark-mode .text-gray-600 {
  color: #9CA3AF !important;
}
body.dark-mode .text-gray-400,
body.dark-mode .text-gray-300 {
  color: #6B7280 !important;
}
body.dark-mode .text-primary {
  color: #F5DC8A !important;
}

/* Bordas */
body.dark-mode .border-gray-100,
body.dark-mode .border-gray-200,
body.dark-mode .border-gray-300 {
  border-color: rgba(245, 220, 138, 0.2) !important;
}

/* Inputs */
body.dark-mode .input-field,
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #1B304F;
  color: #F3F4F6;
  border-color: rgba(245, 220, 138, 0.15);
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #6B7280;
}
body.dark-mode .input-field:focus {
  background: #142036;
  border-color: #E8B93A;
}

/* Tabs ativas */
body.dark-mode .tab-active {
  border-bottom-color: #E8B93A;
  color: #F5DC8A;
}

/* Toast (escuro fica navy mesmo) */
body.dark-mode #toast-notification {
  background: #142036;
  color: #F3F4F6;
  border: 1px solid rgba(245, 220, 138, 0.2);
}

/* Sombras um tom mais escuras */
body.dark-mode .shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.5); }
body.dark-mode .shadow-md { box-shadow: 0 4px 8px rgba(0,0,0,0.45); }
body.dark-mode .shadow-lg { box-shadow: 0 8px 24px rgba(0,0,0,0.55); }

/* Cards de pedido / banner — preserva o gradient navy original */
body.dark-mode .card-primary-gradient {
  background: linear-gradient(135deg, #1B304F 0%, #0F1F3A 100%);
}

/* Mapa Leaflet em dark — escurece tiles via filter */
body.dark-mode .leaflet-tile-pane {
  filter: brightness(0.6) invert(1) contrast(0.9) hue-rotate(200deg) saturate(0.4) brightness(0.9);
}
body.dark-mode .leaflet-control-attribution,
body.dark-mode .leaflet-popup-content-wrapper {
  background: #142036;
  color: #E5E7EB;
}

/* Toggle switch (configurações) */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.theme-toggle .theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}
.theme-toggle .theme-toggle-thumb.on {
  transform: translateX(24px);
  background: #E8B93A;
}
body.dark-mode .theme-toggle {
  background: #1B304F;
}

/* Splash em dark fica navy puro */
body.dark-mode #splash-screen {
  background: #0B1426 !important;
}

/* ===== Mapa Leaflet (driver) ===== */
#map-entregador { background: #e8eef5; }
.leaflet-container { font-family: inherit !important; }
.leaflet-control-zoom a {
  background: #fff !important;
  color: #1B304F !important;
  border: 1px solid #E5E7EB !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  font-weight: 900 !important;
}
.leaflet-control-zoom a:hover { background: #f5f5f5 !important; }
body.dark-mode .leaflet-control-zoom a {
  background: #142036 !important;
  color: #F5DC8A !important;
  border-color: rgba(245,220,138,0.2) !important;
}
.namao-driver-icon, .namao-pin {
  background: transparent;
  border: none;
}

/* Card primary gradient: dourar levemente borda no hover/touch */
.card-primary-gradient {
  border: 1px solid rgba(245, 220, 138, 0.15);
  transition: box-shadow .2s ease, transform .1s ease;
}
.card-primary-gradient:active { transform: scale(0.99); }

/* Card elevated: hover sutil */
.card-elevated {
  transition: box-shadow .2s ease, transform .1s ease;
}
.card-elevated:active { transform: scale(0.99); }

