/* Terravista Capital - Custom CSS - Optimized */
/* Cores personalizadas */
:root {
    --primary-color: #16233c;
    --secondary-color: #a58476;
    --gray-light: #f8f9fa;
    --gray-medium: #e9ecef;
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Critical path optimization */
.hero-with-image {
    background-attachment: scroll; /* Better for mobile performance */
    will-change: transform;
}

/* Reduce layout shifts */
.container {
    contain: layout style;
}

/* Melhorias de responsividade */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-gradient h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-gradient p {
        font-size: 1rem;
    }
    
    .grid {
        gap: 1.5rem;
    }
    
    .service-card,
    .blog-card,
    .estado-card {
        margin-bottom: 1.5rem;
    }
}

/* Hero optimizado */
.hero-gradient {
    background: linear-gradient(135deg, #16233c 0%, #2c3e50 100%) !important;
    min-height: 60vh;
}

@media (max-width: 768px) {
    .hero-gradient {
        min-height: 50vh !important;
    }
}

@media (max-width: 640px) {
    .hero-gradient {
        padding-top: 6rem;
        padding-bottom: 3rem;
    }
    
    .hero-gradient h1 {
        font-size: 2rem;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-3xl {
        font-size: 1.75rem;
    }
    
    .px-8 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .py-16 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .py-12 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* Animações otimizadas */
.fade-in {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
}

.fade-in.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Melhorias nos formulários */
.form-input {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

.form-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(165, 132, 118, 0.1);
    outline: none;
}

.form-input:hover {
    border-color: #d1d5db;
}

/* Botões melhorados */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #1a2841;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(22, 35, 60, 0.2);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #956f63;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(165, 132, 118, 0.2);
}

/* Cards melhorados */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Melhorias na navegação móvel */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 1rem;
}

.mobile-menu a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
    transition: color 0.3s ease;
}

.mobile-menu a:last-child {
    border-bottom: none;
}

/* Tooltips - versão otimizada */
.tooltip {
    position: relative;
}

.tooltip:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
}

/* Melhorias na tabela de simulação */
.simulation-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.simulation-table table {
    min-width: 600px;
}

/* Estados dos formulários */
.form-success {
    border-color: #10b981;
    background-color: #ecfdf5;
}

.form-error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-message {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.form-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Melhorias no footer */
footer {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Melhorias na acessibilidade */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states melhorados */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Skip links para acessibilidade */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

/* Melhorias no contraste */
.high-contrast {
    background: #000;
    color: #fff;
}

.high-contrast a {
    color: #ffff00;
}

.high-contrast button {
    background: #fff;
    color: #000;
    border: 2px solid #fff;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    .section-bg {
        background: #fff !important;
        color: #000 !important;
    }
}

/* Componentes essenciais otimizados */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #10b981;
    color: white;
}

.notification.error {
    background: #ef4444;
    color: white;
}

/* Cache bust otimizado */
/* Updated for performance - v3.0 */
