/* ============================================
   AMIGO ENTREGADOR - CADASTRO DE CLIENTES
   Estilos Globais
   ============================================ */

:root {
  --bm-green:    #145c34;
  --bm-green-lt: #1f8a4c;
  --bm-gold:     #f4c400;
  --bm-gold-lt:  #ffe066;
  --bm-dark:     #0a2e1a;
  --bm-gray:     #f4f6f4;
  --bm-red:      #c0392b;
  --white:       #ffffff;
  --text-dark:   #1a1a1a;
  --text-mid:    #4a5568;
  --border:      #d1d9d1;
  --shadow:      0 2px 12px rgba(0,0,0,0.12);
  --radius:      10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bm-gray);
  color: var(--text-dark);
  min-height: 100vh;
}

/* ---- HEADER ---- */
.site-header {
  background: var(--bm-green);
  color: var(--white);
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  width: 52px;
  height: 52px;
  background: var(--bm-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.header-text h1 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.header-text p {
  font-size: 0.72rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-nav {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.header-nav a {
  color: var(--bm-gold-lt);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}

.header-nav a:hover { background: rgba(255,255,255,0.1); }
.header-nav a.active { background: var(--bm-gold); color: var(--bm-dark); font-weight: 600; }

/* ---- CONTAINER ---- */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.container-wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ---- CARDS ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bm-green);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bm-green);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- FORMS ---- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-label .required { color: var(--bm-red); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--bm-green-lt);
  box-shadow: 0 0 0 3px rgba(46,125,79,0.15);
}

.form-control.error { border-color: var(--bm-red); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---- GPS WIDGET ---- */
.gps-widget {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.gps-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bm-gray);
}

.gps-coords {
  font-size: 0.82rem;
  color: var(--text-mid);
  font-family: monospace;
  flex: 1;
}

.gps-coords.captured { color: var(--bm-green); font-weight: 600; }

.btn-gps {
  background: var(--bm-green);
  color: var(--white);
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-gps:hover { background: var(--bm-green-lt); }
.btn-gps:disabled { background: #999; cursor: not-allowed; }

.gps-mini-map {
  height: 140px;
  background: #e8ede8;
  display: none;
}

.gps-mini-map.visible { display: block; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--bm-green);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover { background: var(--bm-green-lt); }

.btn-secondary {
  background: var(--white);
  color: var(--bm-green);
  border: 2px solid var(--bm-green);
}

.btn-secondary:hover { background: var(--bm-gray); }

.btn-gold {
  background: var(--bm-gold);
  color: var(--bm-dark);
}

.btn-gold:hover { background: var(--bm-gold-lt); }

.btn-danger {
  background: var(--bm-red);
  color: var(--white);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.alert-danger  { background: #f8d7da; color: #721c24; border-left: 4px solid var(--bm-red); }
.alert-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }

.alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ---- BADGE ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-green { background: #d4edda; color: #155724; }
.badge-gold  { background: #fff3cd; color: #856404; }
.badge-gray  { background: #e2e8f0; color: #4a5568; }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--bm-green);
  color: var(--white);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td { background: var(--bm-gray); }

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--bm-dark) 0%, var(--bm-green) 60%, var(--bm-green-lt) 100%);
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo .shield {
  width: 72px;
  height: 72px;
  background: var(--bm-green);
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.login-logo h2 {
  font-size: 1rem;
  color: var(--bm-green);
  font-weight: 700;
  line-height: 1.3;
}

.login-logo p {
  font-size: 0.78rem;
  color: var(--text-mid);
  margin-top: 4px;
}

.login-divider {
  text-align: center;
  color: var(--text-mid);
  font-size: 0.82rem;
  margin: 16px 0;
  position: relative;
}

.login-divider::before, .login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--border);
}

.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }

/* ---- STATS ROW ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
  border-top: 4px solid var(--bm-green);
}

.stat-box.gold  { border-top-color: var(--bm-gold); }
.stat-box.blue  { border-top-color: #3b82f6; }

.stat-num  { font-size: 2rem; font-weight: 700; color: var(--bm-green); line-height: 1; }
.stat-box.gold  .stat-num  { color: #856404; }
.stat-box.blue  .stat-num  { color: #1d4ed8; }
.stat-label { font-size: 0.75rem; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }

/* ---- MAP ---- */
#main-map, #mini-map {
  width: 100%;
  border-radius: 8px;
  border: 1.5px solid var(--border);
}

#main-map { height: 480px; }
#mini-map  { height: 140px; }

/* ---- SPINNER ---- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-mid);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3    { font-size: 1rem; margin-bottom: 6px; }
.empty-state p     { font-size: 0.875rem; }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--bm-dark);
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: 16px;
  font-size: 0.75rem;
  position: fixed;
  bottom: 0;
  width: 100%;
}

/* ---- UTILITY ---- */
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.d-none { display: none !important; }
.w-100  { width: 100%; }

.separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ---- MOBILE TWEAKS ---- */
@media (max-width: 600px) {
  .header-text h1 { font-size: 0.88rem; }
  .card { padding: 18px; }
  .login-card { padding: 28px 20px; }
  .btn { font-size: 0.95rem; }
  .header-nav a { font-size: 0.75rem; padding: 5px 8px; }
}
