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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 0.95em;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.9em;
}

input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-search {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-search:active {
    transform: translateY(0);
}

.loading {
    text-align: center;
    padding: 30px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error {
    background: #fee;
    border: 2px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
}

.results {
    margin-top: 30px;
}

.results h2 {
    color: #333;
    font-size: 1.3em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.result-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.result-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.cep-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 12px;
}

.address-info {
    color: #555;
    line-height: 1.6;
}

.address-info p {
    margin: 5px 0;
}

.address-info strong {
    color: #333;
}

.hidden {
    display: none;
}

.bairro-selector {
    margin-top: 20px;
}

.bairro-selector h3 {
    color: #333;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
}

.bairro-btn {
    width: 100%;
    padding: 18px 20px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bairro-btn::before {
    content: '📍';
    font-size: 1.2em;
    margin-right: 10px;
}

.bairro-btn::after {
    content: '→';
    font-size: 1.2em;
    margin-left: 10px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.bairro-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.bairro-btn:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.bairro-btn:active {
    transform: translateY(0);
}

.bairro-name {
    font-size: 1.05em;
    font-weight: 700;
}

.bairro-count {
    font-size: 0.85em;
    opacity: 0.8;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 12px;
    border-radius: 15px;
}

.bairro-btn:hover .bairro-count {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.back-btn {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 20px;
    background: #6c757d;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.back-btn:active {
    transform: translateY(0);
}

.bairro-title {
    color: #667eea;
    font-size: 1.2em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    text-align: center;
}

@media (max-width: 600px) {
    .card {
        padding: 25px;
    }

    h1 {
        font-size: 1.5em;
    }

    .bairro-btn {
        font-size: 0.9em;
        padding: 12px 15px;
    }
}