/* Reset e Variáveis */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #fff;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Cards */
.search-card,
.result-card,
.history-card {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

.search-card:hover,
.result-card:hover,
.history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.15);
}

.search-card h2,
.history-card h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-card h2 i,
.history-card h2 i {
    color: var(--primary-color);
}

/* Form */
.consulta-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group label i {
    color: var(--primary-color);
}

.input-group input {
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 1.2rem;
}

.btn-icon:hover {
    background: var(--light-color);
    color: var(--text-primary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Results */
.results-section {
    animation: fadeIn 0.3s ease;
}

.results-section.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.result-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-header h2 i {
    color: var(--primary-color);
}

.result-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-item {
    padding: 15px;
    background: var(--light-color);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
}

.info-item strong {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.info-item span {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

.info-item.status-ativa {
    border-left-color: var(--secondary-color);
}

.info-item.status-baixada {
    border-left-color: var(--danger-color);
}

/* Error Message */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--danger-color);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    animation: shake 0.5s ease;
}

.error-message.hidden {
    display: none;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-message i {
    font-size: 1.2rem;
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    padding: 16px;
    background: var(--light-color);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
    cursor: pointer;
}

.history-item:hover {
    background: #f3f4f6;
    transform: translateX(5px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.history-item-cnpj {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.history-item-details {
    display: flex;
    gap: 15px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.history-item-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-item-details i {
    font-size: 0.75rem;
}

.loading-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: var(--text-secondary);
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.empty-history {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-history i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
    color: white;
    opacity: 0.9;
}

.footer-info {
    margin-top: 10px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .logo h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .search-card,
    .result-card,
    .history-card {
        padding: 20px;
    }

    .result-content {
        grid-template-columns: 1fr;
    }

    .history-item-details {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 10px;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .header-content {
        padding: 20px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

