:root {
    --primary: #F26522;
    --primary-dark: #D94F10;
    --secondary: #5B8C3D;
    --dark: #1A1A1A;
    --warm-bg: #FFF8F0;
    --white: #FFFFFF;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body { 
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
    background-color: var(--warm-bg); 
    color: var(--dark); 
    scroll-behavior: smooth; 
    line-height: 1.5;
}

/* --- HEADER --- */
.nav-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: space-between; 
    padding: 1rem 5%; 
    align-items: center; 
}

.logo { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.logo span { color: var(--dark); }

.btn-outline { 
    background: transparent; 
    border: 2px solid var(--primary); 
    color: var(--primary); 
    padding: 0.5rem 1.2rem; 
    border-radius: 50px; 
    font-weight: 700; 
    cursor: pointer; 
    font-size: 0.9rem;
}

/* --- HERO SECTION --- */
.hero { 
    text-align: center; 
    padding: 4rem 5% 2rem; 
    display: flex; 
    justify-content: center; 
}

.hero-content { max-width: 800px; }

h1 { font-size: 2.8rem; line-height: 1.1; margin: 1rem 0; font-weight: 800; }
h1 span { color: var(--primary); }

.badge { 
    background: #FFE6D9; 
    color: var(--primary-dark); 
    padding: 0.4rem 1rem; 
    border-radius: 50px; 
    font-size: 0.85rem; 
    font-weight: 800; 
    text-transform: uppercase;
}

.hero-actions { margin-top: 2rem; }

.btn-primary { 
    background: var(--primary); 
    color: white; 
    padding: 1rem 2.5rem; 
    border-radius: 50px; 
    text-decoration: none; 
    font-weight: 700; 
    display: inline-block;
    transition: transform 0.2s;
}

.btn-primary:hover { transform: scale(1.05); }

/* --- LIVE LAB (O PROTÓTIPO) --- */
.lab-section { 
    padding: 2rem 0; 
    background: #fff; 
    width: 100%; 
}

#demos { 
    max-width: 1200px; 
    margin: 0 auto; 
}

.lab-header { 
    display: flex; 
    justify-content: space-between; 
    padding: 0 5%; 
    margin-bottom: 1.5rem; 
    align-items: center; 
}

.lab-header h2 { font-size: 1.4rem; }
.lab-header h2 span { color: var(--primary); }

.tab-selector { 
    display: flex; 
    background: #f0f0f0; 
    border-radius: 10px; 
    padding: 4px; 
}

.tab-selector button { 
    border: none; 
    padding: 8px 16px; 
    border-radius: 6px; 
    font-weight: 700; 
    cursor: pointer; 
    background: transparent; 
    font-size: 0.85rem;
}

.active-tab { 
    background: white !important; 
    color: var(--primary); 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
}

/* --- CONTAINER DO VÍDEO (CORREÇÃO DE MAPEAMENTO) --- */
.container-video { 
    position: relative; 
    width: 100%; 
    background: #000; 
    overflow: hidden;
    line-height: 0; /* Remove espaço extra abaixo do vídeo */
}

#video_upload { 
    width: 100%; 
    height: auto; /* Mantém a proporção real da câmera/vídeo */
    display: block;
    /* REMOVIDO object-fit: cover para evitar distorção de pontos */
}

#output_canvas { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: 2; 
    pointer-events: none; 
}

.mirror { transform: scaleX(-1); }

/* --- PAINEL DE AÇÕES --- */
.action-panel { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 12px; 
    padding: 1.5rem 5%; 
}

.btn-action { 
    border: none; 
    padding: 16px; 
    border-radius: 12px; 
    font-weight: 800; 
    cursor: pointer; 
    color: white; 
    text-align: center; 
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-orange { background: var(--primary); }
.btn-green { background: var(--secondary); }
.btn-dark { background: var(--dark); }
.btn-red { background: #FF4757; }

#resultBox { 
    position: absolute; 
    bottom: 20px; 
    left: 20px; 
    right: 20px;
    background: rgba(255,255,255,0.92); 
    padding: 12px; 
    border-radius: 10px; 
    font-weight: 800; 
    z-index: 10; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); 
    text-align: center;
    font-size: 0.9rem;
    border-left: 5px solid var(--primary);
}

.invisible { display: none; }

/* --- RESPONSIVIDADE MOBILE --- */
@media (max-width: 768px) {
    h1 { font-size: 2.1rem; }
    
    .hero { padding: 3rem 5% 1rem; }

    .lab-header { 
        flex-direction: column; 
        gap: 1rem; 
        text-align: center; 
    }

    /* No celular, o container ignora margens para ocupar a largura total */
    .lab-section { padding: 1rem 0; }
    
    #demos { padding: 0; }
    
    .container-video { 
        border-radius: 0; /* Aspecto full-screen lateral */
    }

    .action-panel { 
        grid-template-columns: 1fr; /* Um botão por linha */
        padding: 1rem 5%;
    }

    .desktop-nav { display: none; }
    
    #resultBox {
        bottom: 10px;
        left: 10px;
        right: 10px;
        font-size: 0.8rem;
    }
}