/* ============================================
   VARIÁVEIS DE CORES E ESTILOS
   ============================================ */
:root {
    /* Cores modo claro */
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    
    /* Cores de texto */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    /* Cores de fundo */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    /* Cores de borda */
    --border-color: #e5e7eb;
    
    /* Cores de estado */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Bordas */
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    
    /* Transições */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Fontes */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* ============================================
   MODO ESCURO
   ============================================ */
[data-theme="dark"] {
    /* Cores modo escuro */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    
    /* Cores de texto */
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    
    /* Cores de fundo */
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    
    /* Cores de borda */
    --border-color: #4b5563;
}

/* ============================================
   RESET E ESTILOS BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

/* Remover scroll quando menu está aberto */
body.menu-open {
    overflow: hidden;
}

/* ============================================
   TIPOGRAFIA
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   LAYOUT E CONTAINER
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   BOTÕES
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--border-radius-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

/* ============================================
   HEADER E NAVEGAÇÃO
   ============================================ */
.main-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu a:hover {
    color: var(--text-primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-fast);
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Seletor de Idioma */
.language-selector {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.language-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.language-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.language-btn.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: var(--text-secondary);
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 1s linear infinite;
}

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

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color var(--transition-fast);
}

.lang-option:hover {
    background-color: var(--bg-secondary);
}

.lang-option.active {
    background-color: var(--primary-color);
    color: white;
}

.lang-option.active:hover {
    background-color: var(--primary-dark);
}

/* Botão de Tema */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Menu Mobile - BOTÃO HAMBURGUER FIXO */
.mobile-menu-toggle {
    display: none; /* Será mostrado apenas em telas menores via media query */
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 1001;
    transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
    color: var(--primary-color);
}

.mobile-menu-toggle.active i {
    transform: rotate(90deg);
}

/* Menu Mobile - CORREÇÃO CRÍTICA */
.mobile-menu {
    display: block; /* IMPORTANTE: sempre display block, controlamos visibilidade com transform/opacity */
    position: fixed;
    top: 73px; /* Altura do header */
    left: 0;
    width: 100%;
    height: calc(100vh - 73px);
    background-color: var(--bg-primary);
    z-index: 999;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    opacity: 0;
    visibility: hidden;
}

.mobile-menu.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

/* Overlay para menu mobile */
.mobile-menu-overlay {
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   HEADER E NAVEGAÇÃO (continuação) - MENU MOBILE CENTRALIZADO
   ============================================ */

.mobile-nav-menu {
    list-style: none;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centraliza verticalmente */
    gap: 1rem;
    min-height: calc(100vh - 73px - 4rem); /* Altura total menos header e padding */
    margin: 0;
}

.mobile-nav-menu li {
    width: 100%;
    text-align: center;
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.mobile-nav-menu li:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav-menu li:nth-child(2) { animation-delay: 0.15s; }
.mobile-nav-menu li:nth-child(3) { animation-delay: 0.2s; }
.mobile-nav-menu li:nth-child(4) { animation-delay: 0.25s; }
.mobile-nav-menu li:nth-child(5) { animation-delay: 0.3s; }
.mobile-nav-menu li:nth-child(6) { animation-delay: 0.35s; }
.mobile-nav-menu li:nth-child(7) { animation-delay: 0.4s; }

.mobile-nav-menu a {
    display: block;
    padding: 1.25rem 2rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1.25rem;
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-fast);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.mobile-nav-menu a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mobile-nav-menu a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.mobile-nav-menu a:hover::after {
    left: 100%;
}

.mobile-nav-menu a::before {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-nav-menu a:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(5px);
}

/* Ajustes responsivos para o menu centralizado */
@media (max-width: 768px) {
    .mobile-nav-menu {
        min-height: calc(100vh - 65px - 4rem);
        padding: 1.5rem;
    }
    
    .mobile-nav-menu a {
        font-size: 1.125rem;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .mobile-nav-menu {
        min-height: calc(100vh - 65px - 2rem);
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .mobile-nav-menu li {
        max-width: 100%;
    }
    
    .mobile-nav-menu a {
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
    }
}

/* Ajustes para telas altas */
@media (max-width: 1200px) and (max-height: 700px) {
    .mobile-nav-menu {
        justify-content: flex-start; /* Volta para o topo em telas muito baixas */
        padding-top: 2rem;
        min-height: auto;
    }
    
    .mobile-nav-menu li {
        margin-bottom: 1rem;
    }
    
    .mobile-nav-menu a {
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.footer-title {
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.footer-contact i {
    color: var(--primary-color);
}

.newsletter {
    margin-top: 1.5rem;
}

.newsletter h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
}

.newsletter-form button {
    padding: 0.75rem 1.25rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.newsletter-form button i {
    color: white;
    font-size: 1rem;
    transition: color var(--transition-fast);
}

.newsletter-form button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.newsletter-form button:hover i {
    color: white;
}

.newsletter-form button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.newsletter-form button:active {
    transform: translateY(0);
}

/* Garantir contraste no modo escuro */
[data-theme="dark"] .newsletter-form button {
    background-color: var(--primary-color);
}

[data-theme="dark"] .newsletter-form button:hover {
    background-color: var(--primary-dark);
}

[data-theme="dark"] .newsletter-form button i {
    color: white;
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hidden {
    display: none !important;
}

.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   ANIMAÇÕES
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ANIMAÇÕES PARA MUDANÇA DE IDIOMA
   ============================================ */
.lang-changing [data-translate] {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* ============================================
   RESPONSIVIDADE GERAL - CORREÇÃO CRÍTICA PARA MENU
   ============================================ */

/* MOSTRAR BOTÃO HAMBURGUER EM TELAS MENORES */
@media (max-width: 1200px) {
    .nav-menu {
        display: none !important; /* Forçar esconder menu desktop */
    }
    
    .mobile-menu-toggle {
        display: flex !important; /* Forçar mostrar botão hamburguer */
    }
}

/* Ajustes para telas menores que 992px */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.75rem;
    }
    
    .steps-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
    
    .step {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .mobile-menu {
        top: 70px;
        height: calc(100vh - 70px);
    }
    
    .mobile-menu-overlay {
        top: 70px;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   NOVOS AJUSTES PARA TELAS PEQUENAS (375px)
   ============================================ */
@media (max-width: 768px) {
    .hero-section {
        height: auto;
        min-height: calc(100vh - 73px);
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-description {
        font-size: 1.125rem;
    }
    
    .features-section,
    .how-it-works-section {
        padding: 3rem 0;
    }
    
    .mobile-menu {
        top: 65px;
        height: calc(100vh - 65px);
    }
    
    .mobile-menu-overlay {
        top: 65px;
    }
    
    .mobile-nav-menu a {
        font-size: 1.125rem;
        padding: 1rem 1.5rem;
    }
    
    /* Ajuste para telas pequenas: mais espaço no header */
    .navbar {
        padding: 0 0.5rem;
    }
    
    .logo {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
    
    .nav-controls {
        gap: 0.75rem;
    }
    
    .language-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
    }
    
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}

/* Ajustes específicos para 375px e menores */
@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-nav-menu {
        padding: 1rem;
    }
    
    .mobile-nav-menu li {
        max-width: 100%;
    }
    
    .mobile-nav-menu a {
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
    }
    
    /* MAIS ESPAÇO NO HEADER PARA TELAS PEQUENAS */
    .container {
        padding: 0 1rem;
    }
    
    .navbar {
        padding: 0;
    }
    
    .logo {
        font-size: 1.1rem;
        min-width: 120px; /* Garante espaço mínimo para o logo */
    }
    
    .nav-controls {
        gap: 0.5rem;
        min-width: 150px; /* Garante espaço para os controles */
    }
    
    .language-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
        min-width: 70px;
    }
    
    .language-btn span {
        display: inline-block;
        min-width: 20px;
    }
    
    .theme-toggle {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
    
    .mobile-menu-toggle {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        min-width: 32px;
    }
}

/* Ajustes específicos para 400px e menores */
@media (max-width: 400px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .logo {
        font-size: 1rem;
        gap: 0.25rem;
        min-width: 110px;
    }
    
    .nav-controls {
        gap: 0.4rem;
        min-width: 140px;
    }
    
    .language-btn {
        padding: 0.3rem 0.4rem;
        font-size: 0.7rem;
        min-width: 65px;
    }
    
    .language-btn i:first-child {
        font-size: 0.8rem;
    }
    
    .language-btn i:last-child {
        font-size: 0.7rem;
    }
    
    .theme-toggle {
        width: 30px;
        height: 30px;
    }
    
    .mobile-menu-toggle {
        width: 30px;
        height: 30px;
    }
}

/* Ajustes extremos para 320px e menores */
@media (max-width: 320px) {
    .logo {
        font-size: 0.9rem;
        min-width: 100px;
    }
    
    .nav-controls {
        gap: 0.3rem;
        min-width: 130px;
    }
    
    .language-btn {
        padding: 0.25rem 0.3rem;
        font-size: 0.65rem;
        min-width: 60px;
    }
    
    .language-btn span {
        display: none; /* Esconde o texto "EN" em telas muito pequenas */
    }
    
    .language-btn i:first-child {
        margin-right: 0;
    }
    
    .theme-toggle, 
    .mobile-menu-toggle {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
}

/* Ajustes para telas altas */
@media (max-width: 1200px) and (max-height: 700px) {
    .mobile-nav-menu {
        justify-content: flex-start;
        padding-top: 2rem;
    }
    
    .mobile-nav-menu li {
        margin-bottom: 1rem;
    }
    
    .mobile-nav-menu a {
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
    }
}