/* Direct Broker - Premium Stylesheet
 * Optimized for PageSpeed 100, Accessibility & Cache
 */

/* --- FONTES LOCAIS --- */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat/Montserrat-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat/Montserrat-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat/Montserrat-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/Open_Sans/OpenSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/Open_Sans/OpenSans-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* --- VARIÁVEIS --- */
:root {
    --bg-color: #030305;
    --bg-secondary: #0a0a0c;
    --accent-silver: #e0e0e0;
    --text-muted: #aeb5bc; 
    --text-main: #ffffff;
    
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-hover-glow: rgba(255, 255, 255, 0.15);
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

/* Reset Otimizado */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

html {
    scroll-padding-top: 100px; 
}

/* Lenis Scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Acessibilidade: Foco Visível */
:focus-visible {
    outline: 2px solid var(--accent-silver);
    outline-offset: 4px;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9000; opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading); color: var(--text-main); font-weight: 600; letter-spacing: -0.02em;
}

.text-chrome {
    background: linear-gradient(to bottom, #ffffff 0%, #b0b0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0px 10px 30px rgba(255, 255, 255, 0.1);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3.5rem); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4rem; position: relative; display: inline-block;
}

/* --- HEADER --- */
.header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 20px 0; transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.header.scrolled {
    padding: 12px 0; background: rgba(3, 3, 5, 0.85);
    backdrop-filter: blur(20px); border-bottom: 1px solid var(--glass-border);
}

.navbar .container {
    display: flex; justify-content: space-between; align-items: center; position: relative;
}

.logo {
    height: 75px; width: auto; filter: drop-shadow(0 0 15px rgba(255,255,255,0.15));
    transition: height 0.3s ease; will-change: height;
}
.header.scrolled .logo { height: 60px; }

/* Menu Desktop */
@media (min-width: 993px) {
    .navbar-nav {
        display: flex; list-style: none; gap: 2.5rem;
        background: rgba(255, 255, 255, 0.04); padding: 12px 45px; border-radius: 100px;
        border: 1px solid rgba(255, 255, 255, 0.08); backdrop-filter: blur(15px);
        position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
        width: max-content; margin: 0;
    }
}

.nav-link {
    color: var(--text-main); text-decoration: none; font-size: 0.85rem;
    text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600;
    position: relative; transition: opacity 0.3s; opacity: 0.8;
}
.nav-link:hover { opacity: 1; text-shadow: 0 0 10px rgba(255,255,255,0.5); }

.navbar-toggle {
    display: none; flex-direction: column; background: none; border: none; cursor: pointer; padding: 5px; z-index: 1001;
}
.hamburger-line {
    width: 30px; height: 2px; background: #ffffff; margin: 4px 0; transition: 0.3s;
}

/* --- HERO SECTION --- */
.hero {
    height: 100vh; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
    contain: layout paint; 
}

.hero-video { position: absolute; width: 100%; height: 100%; z-index: 0; }
.hero-video video {
    width: 100%; height: 100%; object-fit: cover; opacity: 1; filter: none;
    will-change: transform;
}

.hero-overlay-gradient {
    display: none;
}

.hero-content {
    z-index: 2; text-align: center; max-width: 1000px; padding: 0 20px; margin-top: 40px;
}

.hero-title {
    font-size: clamp(3rem, 7vw, 5.5rem); line-height: 1.05; margin-bottom: 1.5rem; font-weight: 700;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,0.55));
}
.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--text-muted); font-weight: 300; letter-spacing: 0.3em; text-transform: uppercase; margin-bottom: 3rem;
    text-shadow: 0 3px 12px rgba(0,0,0,0.7);
}

/* --- BENTO GRID --- */
.services {
    padding: 120px 0; background: var(--bg-color); position: relative;
    content-visibility: auto; 
    contain-intrinsic-size: 1000px; 
}

.bento-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(280px, auto); gap: 24px; position: relative; z-index: 1;
}

.bento-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 24px; padding: 40px;
    position: relative; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column; justify-content: space-between;
}

.bento-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.04), transparent 40%);
    opacity: 0; transition: opacity 0.5s; pointer-events: none; z-index: 2;
}
.bento-card:hover::before { opacity: 1; }
.bento-card:hover {
    transform: translateY(-5px); border-color: rgba(255,255,255,0.15); box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.span-2 { grid-column: span 2; }
.span-row-2 { grid-row: span 2; }

.card-icon {
    width: 60px; height: 60px; margin-bottom: 2rem; background: rgba(255,255,255,0.03);
    border-radius: 16px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.1);
}
.card-icon i { font-size: 28px; color: var(--text-main); }

.bento-card h3 { font-size: 1.5rem; margin-bottom: 0.8rem; color: #fff; }
.bento-card p { color: var(--text-muted); font-size: 0.95rem; }

/* --- CAROUSEL (FULL WIDTH) --- */
.partners-videos {
    background: var(--bg-secondary); padding: 100px 0; position: relative; overflow: hidden;
    content-visibility: auto;
    contain-intrinsic-size: 500px;
}

.carousel-container {
    width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; margin-bottom: 3rem;
}

.carousel-container::before, .carousel-container::after {
    content: ""; position: absolute; top: 0; width: 25%; height: 100%; z-index: 5; pointer-events: none;
}
.carousel-container::before { 
    left: 0; background: linear-gradient(to right, var(--bg-secondary) 0%, var(--bg-secondary) 10%, transparent 100%);
}
.carousel-container::after { 
    right: 0; background: linear-gradient(to left, var(--bg-secondary) 0%, var(--bg-secondary) 10%, transparent 100%);
}

.carousel-track {
    display: flex; gap: 2rem; padding: 1rem 0; width: max-content; will-change: transform;
}
.carousel-track.left-to-right { animation: scrollLeftToRightInfinite 60s linear infinite; }
.carousel-track.right-to-left { animation: scrollRightToLeftInfinite 60s linear infinite; }

/* Correção de travamento: Pausa no hover isolada apenas para mouses reais (Desktop) */
body.modal-open .carousel-track { 
    animation-play-state: paused; 
}
@media (hover: hover) and (pointer: fine) {
    .carousel-track:hover { 
        animation-play-state: paused; 
    }
}

@keyframes scrollLeftToRightInfinite { 0% { transform: translateX(-50%); } 100% { transform: translateX(0%); } }
@keyframes scrollRightToLeftInfinite { 0% { transform: translateX(0%); } 100% { transform: translateX(-50%); } }

/* TAMANHO ORIGINAL DESKTOP PRESERVADO */
.carousel-video-item {
    flex: 0 0 300px; height: 170px; border: 1px solid var(--glass-border); border-radius: 16px;
    background: #050505; overflow: hidden; position: relative; cursor: pointer; transition: all 0.3s ease;
}
.carousel-video-item:hover {
    transform: scale(1.05); z-index: 10; border-color: var(--accent-silver); box-shadow: 0 10px 30px rgba(255,255,255,0.1);
}
.carousel-video-item::after {
    content: "▶"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0);
    font-size: 2rem; color: #fff; z-index: 4; opacity: 0; transition: all 0.3s; text-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.carousel-video-item:hover::after { transform: translate(-50%, -50%) scale(1); opacity: 1; }

.video-container { width: 100%; height: 100%; position: relative; }

.video-thumbnail {
    position: absolute; inset: 0; background: radial-gradient(circle, #1a1a20 0%, #050505 100%);
    display: flex; align-items: center; justify-content: center; z-index: 2; 
}
.video-thumbnail img {
    max-width: 80%; max-height: 80%; object-fit: contain;
    filter: brightness(1.2) drop-shadow(0 0 5px rgba(255,255,255,0.1)); transition: transform 0.3s;
}
.carousel-video-item:hover .video-thumbnail img { transform: scale(1.1); }

/* --- MODAL --- */
.video-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px); z-index: 9999; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.video-modal.active { opacity: 1; pointer-events: all; }

.modal-content {
    width: 90%; max-width: 1000px; aspect-ratio: 16/9; background: #000; border-radius: 12px;
    overflow: hidden; position: relative; box-shadow: 0 0 50px rgba(255, 255, 255, 0.1); border: 1px solid var(--glass-border);
}
.modal-content video { width: 100%; height: 100%; object-fit: contain; }

.close-modal {
    position: absolute; top: 20px; right: 30px; font-size: 3rem; color: #fff; background: none;
    border: none; cursor: pointer; transition: color 0.3s; z-index: 10000; line-height: 1;
}
.close-modal:hover { color: var(--accent-silver); }

/* --- CONTACT & FOOTER --- */
.contact {
    padding: 120px 0; background: linear-gradient(to bottom, var(--bg-color), #050a14);
    content-visibility: auto;
}
.contact-wrapper { display: grid; grid-template-columns: 1fr 1.2fr; gap: 5rem; align-items: start; }

.detail-item {
    display: flex; align-items: center; gap: 1.5rem; padding: 20px;
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px; margin-bottom: 1rem;
}

.contact-form {
    background: rgba(20, 20, 25, 0.6); padding: 3rem; border-radius: 24px;
    border: 1px solid var(--glass-border); backdrop-filter: blur(20px);
}

.form-group input, .form-group textarea {
    width: 100%; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
    color: white; padding: 1.2rem; border-radius: 10px; margin-top: 0.5rem; font-family: inherit;
}
.form-group input::placeholder, .form-group textarea::placeholder {
    color: #aeb5bc; opacity: 0.8;
}

/* Correção iOS Zoom */
@media (max-width: 768px) {
    .form-group input, .form-group textarea { font-size: 16px !important; }
}

.btn-premium {
    background: linear-gradient(135deg, #e0e0e0 0%, #a0a0a0 100%); color: #000; border: none;
    padding: 1.2rem 3rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
    border-radius: 10px; cursor: pointer; width: 100%; margin-top: 1.5rem;
    transition: filter 0.3s;
}
.btn-premium:hover { filter: brightness(1.1); }

.footer {
    background: #020203; border-top: 1px solid var(--glass-border); padding: 80px 0 30px;
    content-visibility: auto;
}
.footer-content { display: grid; grid-template-columns: 1.5fr 2fr; gap: 4rem; margin-bottom: 60px; }
.footer-links { display: flex; gap: 4rem; justify-content: flex-end; }
.footer-column h4 { color: #fff; margin-bottom: 1.5rem; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; }
.footer-column ul { list-style: none; }
.footer-column ul li { margin-bottom: 0.8rem; }
.footer-column a { color: #999; text-decoration: none; transition: color 0.3s; }
.footer-column a:hover { color: #fff; }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.05); color: #666; font-size: 0.85rem; }
.container { max-width: 1350px; margin: 0 auto; padding: 0 25px; }

/* --- WHATSAPP FLOATING BUTTON --- */
.whatsapp-floater {
    position: fixed; bottom: 30px; right: 30px; z-index: 8000; display: flex; flex-direction: column; align-items: flex-end;
}

.whatsapp-btn {
    width: 60px; height: 60px; border-radius: 50%;
    background: rgba(30, 30, 35, 0.6); 
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; color: #fff; font-size: 32px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.whatsapp-btn i { color: #25D366; transition: color 0.3s; }

.whatsapp-btn:hover { transform: scale(1.1); background: rgba(37, 211, 102, 0.2); border-color: #25D366; }
.whatsapp-btn:hover i { color: #fff; }

.pulse-ring {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%;
    border: 2px solid #25D366; opacity: 0; animation: pulseRing 2s infinite; pointer-events: none;
}
@keyframes pulseRing { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.5); opacity: 0; } }

.whatsapp-balloon {
    background: rgba(255, 255, 255, 0.95); color: #000;
    padding: 12px 20px; border-radius: 12px 12px 0 12px;
    font-size: 0.9rem; font-weight: 600; box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    margin-bottom: 15px; opacity: 0; transform: translateY(10px) scale(0.9);
    transition: all 0.4s ease; pointer-events: none; width: max-content;
}
.whatsapp-balloon.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }


/* ==========================================
   MEDIA QUERY: TABLETS & MOBILE (Geral)
   ========================================== */
@media (max-width: 992px) {
    .header { padding: 10px 0; }
    .header.scrolled { padding: 6px 0; }
    .navbar .container {
        justify-content: center;
        min-height: 54px;
    }
    .navbar-brand {
        display: flex;
        justify-content: center;
    }
    .logo { height: 52px; }
    .header.scrolled .logo { height: 44px; }
    .navbar-toggle {
        display: flex;
        position: absolute;
        right: 25px;
        top: 44%;
        transform: translateY(-50%);
    }
    
    /* CORREÇÃO DO MENU: Centralização vertical e horizontal perfeita e milimétrica */
    .navbar-nav {
        display: flex !important;
        flex-direction: column; 
        align-items: center; 
        justify-content: center;     /* Centraliza verticalmente sem padding artificial */
        text-align: center;          
        gap: 1.4rem;                 
        
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background: #000; padding: 0; border-radius: 0;
        visibility: hidden; opacity: 0; pointer-events: none; transform: translateY(-20px);
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    }
    .navbar-nav.active {
        visibility: visible; opacity: 1; pointer-events: all; transform: translateY(0);
    }
    
    /* CORREÇÃO DA FONTE MOBILE */
    .navbar-nav .nav-link {
        font-size: 1.8rem;           
        letter-spacing: 0.14em;
        line-height: 1.2;
        text-align: center;          
        width: 100%;
        display: block;
    }
    
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-wrapper, .footer-content { grid-template-columns: 1fr; }
    .footer-links { justify-content: flex-start; flex-wrap: wrap; }
    .span-2, .span-row-2 { grid-column: span 1; grid-row: span 1; }
}


/* ==========================================
   MEDIA QUERY: SMARTPHONES (Até 600px)
   ========================================== */
@media (max-width: 600px) {
    .bento-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 2rem; margin-bottom: 2.3rem; }
    .hero-title { font-size: 2.8rem; }
    .logo { height: 48px; }
    .header.scrolled .logo { height: 40px; }
    .navbar .container { min-height: 48px; }
    .navbar-toggle { right: 20px; top: 42%; }
    
    .partners-videos {
        padding: 58px 0 46px;
        contain-intrinsic-size: 360px;
    }
    .partners-videos .section-title { margin-bottom: 1.7rem; }
    .carousel-container { margin-bottom: 1.4rem; }
    .carousel-container[style] { margin-top: 10px !important; }
    .carousel-track {
        gap: 1rem;
        padding: 0.5rem 0;
    }
    
    /* CORREÇÃO DO CAROUSEL MOBILE */
    .carousel-video-item {
        flex-basis: 140px;
        height: 80px;
        border-radius: 8px;
    }
    
    .contact {
        padding: 64px 0 72px;
    }
    .contact-wrapper {
        gap: 2rem;
    }
    .contact-info h2 {
        font-size: 2rem;
        line-height: 1.15;
    }
    .detail-item {
        padding: 16px;
        gap: 1rem;
    }
    .contact-form {
        padding: 1.5rem;
        border-radius: 18px;
    }
    .contact-form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    .form-group input, .form-group textarea {
        padding: 1rem;
    }
    .btn-premium {
        padding: 1rem 1.4rem;
    }
    .whatsapp-floater { bottom: 20px; right: 20px; }
}

.reveal-text { opacity: 0; transform: translateY(30px); }