/* Custom CSS for Landing Page Agrimensura - Performance Optimized */

:root {
    --primary-color: #1240cf;
    --secondary-color: #ff4c3e;
    --warning-color: #f5a914;
    --success-color: #42d06e;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --white-color: #ffffff;
    --gray-color: #6c757d;
}

/* Critical CSS - Above the fold */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    font-display: swap;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Hero Section - Full Screen Background */
.hero-section {
    background: linear-gradient(135deg, rgba(18, 64, 207, 0.45), rgba(66, 208, 110, 0.9)), 
                url('../images/banner_hero_georreferenciamento.webp') center/cover no-repeat fixed;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-form-container {
    position: relative;
    z-index: 3; /* Aumentado para ficar acima do overlay */
}

.hero-form {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInRight 0.8s ease-out;
    position: relative;
    z-index: 4; /* Garantindo que fique no topo */
}

.mobile-form-section {
    border-top: 3px solid var(--primary-color);
    position: relative;
    z-index: 3;
}

/* Hero Stats */
.hero-stats .stat-item {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease;
}

.hero-stats .stat-item:hover {
    transform: translateY(-3px);
}

/* Hero Buttons */
.hero-buttons .btn {
    transition: all 0.3s ease;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Form Styling - CORRIGIDO */
.iframe-container-hero,
.iframe-container-mobile {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 5; /* Máxima prioridade */
}

.iframe-container-hero iframe,
.iframe-container-mobile iframe {
    border-radius: 15px;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 6;
    pointer-events: auto; /* Garantindo interação */
    background: white;
}

/* Removendo qualquer overlay que possa interferir */
.iframe-container-hero::before,
.iframe-container-mobile::before,
.hero-form::before {
    display: none !important;
}

.urgency-badge {
    animation: pulse 2s infinite;
    font-size: 0.85rem;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Navigation - Performance Optimized */
.navbar {
    transition: all 0.3s ease;
    padding: 1rem 0;
    backdrop-filter: blur(10px);
}

.navbar.scrolled {
    background-color: rgba(18, 64, 207, 0.95) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    color: white !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--warning-color) !important;
}

/* Feature Items */
.feature-item {
    text-align: center;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Course Card */
.course-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.price-info {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.price-highlight {
    color: var(--success-color);
    font-weight: 700;
}

/* Quality Section */
.quality-item {
    padding: 2rem 1rem;
    transition: transform 0.3s ease;
}

.quality-item:hover {
    transform: translateY(-5px);
}

.quality-icon {
    transition: transform 0.3s ease;
    color: var(--warning-color);
}

.quality-item:hover .quality-icon {
    transform: scale(1.1);
}

/* Market Stats */
.stat-card {
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.05);
}

.stat-value {
    color: var(--primary-color);
    font-weight: 700;
}

/* Testimonials */
.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid var(--warning-color);
}

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

.stars {
    font-size: 1.2rem;
    color: var(--warning-color);
}

/* Similar Courses */
.course-similar-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid var(--primary-color);
}

.course-similar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

/* FAQ Section */
.accordion-button {
    font-weight: 600;
    background-color: #f8f9fa;
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-color);
    color: white;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

/* Form Section */
.form-container {
    position: relative;
}

.iframe-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.iframe-container iframe {
    border-radius: 10px;
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.whatsapp-float .btn {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: bounce 2s infinite;
    background-color: var(--success-color) !important;
    border-color: var(--success-color) !important;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Buttons - Performance Optimized */
.btn {
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    will-change: transform;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0d2f8f);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0d2f8f, #0a2470);
    transform: translateY(-2px);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #d4940f);
    border: none;
    color: #000;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d4940f, #b8800d);
    transform: translateY(-2px);
    color: #000;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #36b85e);
    border: none;
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #36b85e, #2da050);
    transform: translateY(-2px);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #e63c2e);
    border: none;
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e63c2e, #cc2f22);
    transform: translateY(-2px);
    color: white;
}

/* Mobile Optimizations */
@media (max-width: 991.98px) {
    .hero-section {
        background-attachment: scroll; /* Better performance on mobile */
        min-height: auto;
    }
    
    .hero-content {
        padding: 2rem 1rem !important;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-stats .stat-item {
        margin-bottom: 1rem;
    }
    
    .mobile-form-section {
        margin-top: 0;
        z-index: 10; /* Garantindo prioridade no mobile */
    }
    
    /* Corrigindo problemas de sobreposição no mobile */
    .mobile-form-section .hero-form {
        position: relative;
        z-index: 11;
    }
    
    .mobile-form-section .iframe-container-mobile {
        position: relative;
        z-index: 12;
    }
    
    .mobile-form-section iframe {
        position: relative;
        z-index: 13;
        pointer-events: auto !important;
        touch-action: auto !important;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 1.9rem;
    }
    
    .hero-buttons {
        flex-direction: column !important;
    }
    
    .hero-buttons .btn {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-float .btn {
        width: 50px;
        height: 50px;
    }
    
    /* Garantindo que o formulário funcione no mobile */
    .iframe-container-mobile {
        min-height: 600px;
        position: relative;
        z-index: 999;
    }
    
    .iframe-container-mobile iframe {
        min-height: 600px;
        position: relative;
        z-index: 1000;
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 1.6rem;
    }
    
    .hero-content p {
        font-size: 0.95rem;
    }
    
    .hero-stats .col-4 {
        margin-bottom: 1rem;
    }
    
    .iframe-container-mobile iframe {
        height: 400px;
    }
}

/* Performance Optimizations */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scroll Animations - Optimized */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
    will-change: opacity, transform;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--success-color);
}

/* Critical Resource Hints */
.preload-bg {
    background-image: url('../images/hvQdwuXmECt9.jpg');
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Print Styles */
@media print {
    .navbar,
    .whatsapp-float,
    .hero-buttons,
    .mobile-form-section {
        display: none !important;
    }
    
    .hero-section {
        background: none !important;
        color: #000 !important;
    }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Garantindo que não haja interferência no iframe */
.hero-form *,
.mobile-form-section * {
    pointer-events: auto !important;
}

.hero-form iframe,
.mobile-form-section iframe {
    pointer-events: auto !important;
    touch-action: auto !important;
    user-select: auto !important;
}

/* Removendo qualquer overlay ou pseudo-elemento que possa interferir */
.hero-form::after,
.hero-form::before,
.iframe-container-hero::after,
.iframe-container-hero::before,
.iframe-container-mobile::after,
.iframe-container-mobile::before {
    display: none !important;
    content: none !important;
}

