:root {
  --primary: HSL(210, 80%, 40%);
  --primary-hover: HSL(210, 85%, 32%);
  --primary-light: HSL(210, 80%, 96%);
  --secondary: HSL(160, 70%, 38%);
  --secondary-light: HSL(160, 60%, 95%);
  --accent: HSL(40, 95%, 45%);
  --bg-main: HSL(210, 20%, 96%);
  --surface: HSL(0, 0%, 100%);
  --text-main: HSL(215, 25%, 15%);
  --text-muted: HSL(215, 15%, 45%);
  --border: HSL(214, 20%, 85%);
  --border-focus: HSL(210, 80%, 48%);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.07), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(135deg, HSL(210, 85%, 30%), HSL(210, 75%, 44%));
  color: white;
  padding: 3rem 1.5rem 2.5rem 1.5rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.header-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

header h1 {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

header p {
  opacity: 0.92;
  font-size: 1.05rem;
  font-weight: 400;
}

.container {
  max-width: 860px;
  width: 92%;
  margin: -1.8rem auto 3.5rem auto;
  background: var(--surface);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.info-badge {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background-color: var(--primary-light);
  color: HSL(210, 80%, 25%);
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--primary);
  line-height: 1.5;
}

.info-badge-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.form-section {
  background: HSL(210, 20%, 99%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin-bottom: 1.8rem;
  transition: border-color 0.2s ease;
}

.form-section:hover {
  border-color: HSL(210, 40%, 75%);
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.3rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid HSL(210, 20%, 90%);
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.form-section-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.form-section-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

input, select {
  padding: 0.78rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  background: white;
  color: var(--text-main);
}

input:focus, select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px HSL(210, 80%, 92%);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Custom Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.6rem 0.8rem;
  background: HSL(40, 95%, 96%);
  border: 1px solid HSL(40, 90%, 85%);
  border-radius: var(--radius-sm);
  margin-top: 0.2rem;
}

.checkbox-container input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-label {
  font-size: 0.88rem;
  color: HSL(40, 95%, 25%);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1.5px solid var(--primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.autocomplete-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid HSL(210, 20%, 94%);
  font-size: 0.9rem;
  transition: background-color 0.15s ease;
}

.autocomplete-item:hover, .autocomplete-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.autocomplete-item-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Distance Preview Card */
.distance-preview-card {
  margin-top: 1.2rem;
  background: white;
  border: 2px solid var(--secondary);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.preview-icon {
  font-size: 1.5rem;
}

.preview-header h4 {
  font-size: 1.05rem;
  color: var(--text-main);
  font-weight: 700;
}

.preview-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.preview-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--secondary-light);
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  gap: 1rem;
}

.dist-badge {
  display: flex;
  flex-direction: column;
}

.dist-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.1;
}

.dist-lbl {
  font-size: 0.75rem;
  color: HSL(160, 60%, 25%);
  font-weight: 600;
}

.dist-status {
  font-size: 0.85rem;
  color: HSL(160, 60%, 20%);
  font-weight: 500;
}

/* Submit Section */
.submit-container {
  margin-top: 2rem;
  text-align: center;
}

.btn-primary {
  width: 100%;
  padding: 1.05rem 1.5rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(26, 86, 160, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(26, 86, 160, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
}

.submit-terms {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.9rem;
  line-height: 1.4;
}

footer {
  margin-top: auto;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: white;
}

@media (max-width: 600px) {
  .container {
    padding: 1.5rem 1.2rem;
    margin-top: -1rem;
    width: 95%;
  }

  header {
    padding: 2rem 1rem 1.8rem 1rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .preview-body {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================================================================
   ESTILOS DO VISUALIZADOR PROVISÓRIO DE ROTAS (PERÍODO DE TESTES)
   ========================================================================= */
.teste-rota-action-bar {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed HSL(160, 40%, 80%);
}

.btn-teste-rota {
  width: 100%;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-teste-rota:hover {
  background: linear-gradient(135deg, #172554 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.teste-mapa-box {
  margin-top: 1rem;
  background: #ffffff;
  border: 2px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.teste-mapa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.teste-mapa-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge-teste {
  display: inline-block;
  align-self: flex-start;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid #fde68a;
}

.teste-mapa-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.teste-mode-pills {
  display: flex;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px;
}

.pill-mode {
  border: none;
  background: transparent;
  padding: 0.35rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.pill-mode.active {
  background: #ffffff;
  color: #1e3a8a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-gmaps-link {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #1e3a8a;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.btn-gmaps-link:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.teste-metricas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.teste-metrica-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
}

.teste-metrica-label {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.teste-metrica-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  font-family: monospace;
  margin-top: 2px;
}

#mapaRotaInscricao {
  width: 100%;
  height: 360px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  z-index: 10;
}

.teste-mapa-footer-note {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 0.7rem;
  line-height: 1.4;
}

.custom-route-pin-student {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: 800;
  font-size: 11px;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  background: #10b981;
}

.custom-route-pin-school {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: 800;
  font-size: 11px;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  background: #ef4444;
}

.leaflet-tooltip.tooltip-rota-inscricao {
  background: rgba(15, 23, 42, 0.9);
  color: white;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
}

