:root {
    --primary: #4f46e5; /* Indigo */
    --primary-hover: #4338ca;
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 16px;
    --radius-sm: 8px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', system-ui, sans-serif; }

body {
    background-color: var(--bg-body);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    color: var(--text-main);
}

.app-container {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* --- Header & Tabs --- */
.header {
    padding: 1.5rem 1.5rem 0 1.5rem;
    text-align: center;
}

.header h1 { font-size: 1.25rem; margin-bottom: 1rem; }

.tab-switcher {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.tab-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* --- Content Area --- */
.content-area {
    padding: 0 1.5rem 1.5rem 1.5rem;
    overflow-y: auto; /* Scroll interno se necessário */
    flex: 1;
}

.view-section { display: none; animation: fadeIn 0.3s ease; }
.view-section.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Forms --- */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; }

input, select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus { border-color: var(--primary); }

.btn-action {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}
.btn-action:hover { background-color: var(--primary-hover); }
.btn-action:disabled { opacity: 0.7; cursor: not-allowed; }

/* --- Resultados (Cards) --- */
.result-box { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }

.card-single {
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.card-list-item {
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-label { font-size: 0.75rem; color: var(--text-muted); font-weight: bold; margin-top: 8px; }
.data-value { font-size: 1.1rem; color: var(--text-main); font-weight: 500; }

/* Tags e Utilitários */
.cep-badge {
    background: #e0e7ff;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cep-badge:hover { background: #dbeafe; }
.cep-badge::after { content: '📋'; font-size: 0.8em; opacity: 0.6; }

.status-msg { text-align: center; margin-top: 10px; font-size: 0.9rem; min-height: 20px; }
.error { color: #ef4444; }
.success { color: #10b981; }

/* Toast Notification */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: #1f2937; color: white; padding: 10px 24px; border-radius: 50px;
    opacity: 0; transition: all 0.3s; pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }