body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: aliceblue;
  margin: 0;
  padding: 0 1rem;
  color: #334155;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.container {
  max-width: 600px;
  background: rgba(255 255 255 / 0.85);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.1);
  width: 100%;
  margin-top: 3cm;
  padding: 2rem;
  border-radius: 12px;
}

h1.titulo {
  text-align: center;
}

p.subtitulo {
  text-align: center;
  color: #475569;
  margin-bottom: 2rem;
}

input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border-radius: 6px;
    border: 1.5px solid #cbd5e1;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 4px #3b82f6aa;
}
/* Wrapper relativo para o dropdown */
.input-wrapper {
    position: relative;
}

/* Dropdown aprimorado */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-top: 5px;
    transition: all 0.2s ease-in-out;
}

/* Itens do dropdown */
.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-radius: 6px;
}

.autocomplete-item:hover {
    background-color: #3b82f6;
    color: white;
}

button {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(90deg, #2563eb, #22c55e);
    color: white;
    box-shadow: 0 4px 8px rgb(34 197 94 / 0.5);
    margin-top: 25px;
}

button:hover:not(:disabled) {
  background: linear-gradient(90deg, #1e40af, #16a34a);
}

.alert {
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: opacity 0.10s ease-out;
}

.error {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
  margin-top: 25px;
  text-align: center;
}

.success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
  margin-top: 25px;
  text-align: center;
}

.hidden {
  display: none;
}

#loading {
  font-size: 18px;
  margin-top: 10px;
}

/* --- CSS ATUALIZADO --- */
        
        /* Container das tags selecionadas */
        .selected-cities-container {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 20px;
            margin-top: 15px;
            min-height: 40px;
            max-height: 150px; /* Barra de rolagem se selecionar muitas */
            overflow-y: auto;
            padding: 5px;
            border: 1px dashed #e2e8f0;
            border-radius: 8px;
        }

        /* Tag visual (verde) */
        .city-tag {
            background-color: #22c55e;
            color: white;
            padding: 6px 14px;
            border-radius: 20px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.85rem;
            font-weight: 600;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            animation: fadeIn 0.2s ease;
        }

        .city-tag button {
            background: none;
            border: none;
            color: white;
            font-weight: bold;
            font-size: 1.1rem;
            cursor: pointer;
            padding: 0;
            line-height: 1;
            display: flex;
            align-items: center;
        }
        .city-tag button:hover { color: #dcfce7; }

        /* Overlay de Carregamento */
        .loading-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(255, 255, 255, 0.95);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            backdrop-filter: blur(4px);
        }

        .spinner {
            border: 8px solid #f3f3f3;
            border-top: 8px solid #22c55e;
            border-radius: 50%;
            width: 60px;
            height: 60px;
            animation: spin 1s linear infinite;
            margin-bottom: 20px;
        }

        /* Botão de Cancelar no Overlay */
        .btn-cancel-request {
            margin-top: 20px;
            padding: 10px 25px;
            background-color: #ef4444;
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: bold;
            transition: background 0.2s;
        }
        .btn-cancel-request:hover { background-color: #dc2626; }

        /* Dropdown e Inputs */
        .input-wrapper { position: relative; z-index: 10; }
        .dropdown { 
            position: absolute; 
            background: white; 
            width: 100%; 
            border: 1px solid #cbd5e1; 
            max-height: 250px; 
            overflow-y: auto; 
            z-index: 20;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            border-radius: 0 0 8px 8px;
        }

        .autocomplete-item { 
            padding: 10px 15px; 
            cursor: pointer; 
            border-bottom: 1px solid #f1f5f9;
            transition: background 0.1s;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .autocomplete-item:hover { background-color: #f0f9ff; }
        
        /* ESTILO DO ITEM SELECIONADO NA LISTA */
        .autocomplete-item.selected {
            background-color: #dcfce7; /* Fundo verde claro */
            color: #166534; /* Texto verde escuro */
            font-weight: 600;
        }
        
        /* Checkmark visual */
        .autocomplete-item.selected::after {
            content: "✓";
            color: #16a34a;
            font-weight: bold;
            font-size: 1.2em;
        }

        /* Botões de Ação da Lista */
        .list-actions {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
            justify-content: flex-end;
        }

        .btn-action-sm {
            padding: 6px 12px;
            font-size: 0.8rem;
            border: 1px solid #cbd5e1;
            background-color: white;
            color: #475569;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .btn-action-sm:hover { background-color: #f1f5f9; border-color: #94a3b8; }
        .btn-action-sm.danger:hover { background-color: #fee2e2; color: #ef4444; border-color: #ef4444; }

        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
        .fade-out { opacity: 0; transition: opacity 0.5s; }