/* ULTRATHINK: Hero section otimizada para todos os dispositivos */
.hero-section {
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg-off-white) 100%);
    min-height: 100vh !important;
    /* Hero sempre ocupa viewport total */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    padding-top: var(--header-height) !important;
    /* Espaço para header fixo */
    padding-bottom: var(--space-xl) !important;
    position: relative;
    overflow: hidden;
}

.hero-background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.hero-background-elements .shape {
    position: absolute;
    /* Tarefa 1.3: Modernizar as formas flutuantes com gradientes e border-radius */
    background-image: linear-gradient(135deg,
            rgba(74, 144, 226, 0.2) 0%,
            rgba(74, 144, 226, 0.05) 100%);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    /* background-color: var(--color-accent-secondary-light); */
    /* Removido para usar background-image */
    opacity: 0;
    /* Controlado pela animação fadeInOut */
    /* Tarefa 1.3: Adicionar filtro de desfoque */
    filter: blur(40px);
    animation-duration: 20s;
    /* Duração base */
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    will-change: transform, opacity;
}

.hero-background-elements .shape-1 {
    width: 250px;
    height: 250px;
    top: 10%;
    left: 5%;
    background-color: rgba(74, 144, 226, 0.08);
    /* Azul claro */
    animation-name: floatShape, fadeInOut;
    animation-delay: 0s, 0s;
}

.hero-background-elements .shape-2 {
    width: 180px;
    height: 180px;
    top: 60%;
    right: 10%;
    background-color: rgba(255, 107, 107, 0.06);
    /* Vermelho claro */
    animation-name: floatShapeReverse, fadeInOut;
    animation-delay: 3s, 3s;
}

.hero-background-elements .shape-3 {
    width: 100px;
    height: 100px;
    bottom: 15%;
    left: 20%;
    background-color: rgba(74, 144, 226, 0.1);
    /* Azul um pouco mais forte */
    animation-name: floatShape, fadeInOut;
    animation-duration: 25s;
    animation-delay: 6s, 6s;
}

.hero-background-elements .shape-4 {
    width: 60px;
    height: 60px;
    top: 20%;
    right: 30%;
    background-color: rgba(255, 107, 107, 0.08);
    /* Vermelho um pouco mais forte */
    animation-name: floatShapeReverse, fadeInOut;
    animation-duration: 18s;
    animation-delay: 9s, 9s;
}

/* Dark mode adjustments for hero background shapes */
body.dark-mode .hero-background-elements .shape-1 {
    background-color: rgba(96, 165, 250, 0.08);
    /* Azul mais visível no dark */
}

body.dark-mode .hero-background-elements .shape-2 {
    background-color: rgba(255, 107, 107, 0.08);
    /* Vermelho mais visível no dark */
}

body.dark-mode .hero-background-elements .shape-3 {
    background-color: rgba(96, 165, 250, 0.12);
    /* Azul mais forte no dark */
}

body.dark-mode .hero-background-elements .shape-4 {
    background-color: rgba(255, 107, 107, 0.1);
    /* Vermelho mais forte no dark */
}

.hero-container {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - var(--header-height) - var(--space-xxl) * 2);
    /* Mobile first: layout em coluna */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.hero-content {
    max-width: 680px;
    width: 100%;
    display: flex;
    position: relative;
    z-index: 20;
    /* Para ficar na frente da imagem em mobile/tablet */
    flex-direction: column;
    align-items: flex-start;
    /* Alinhado à esquerda */
    /* Espaço fixo e seguro */
    padding-bottom: 180px;
    /* Espaço extra para os stats posicionados de forma absoluta */
}

/* Wrapper para o título principal - estabiliza dimensões */
.hero-title-wrapper {
    width: 100%;
    max-width: 680px;
    margin-bottom: 1.2rem;
    /* Previne qualquer reflow durante animações */
    contain: layout style paint;
    position: relative;
}

.hero-title {
    font-size: 2.7rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
    color: var(--color-heading-primary);
    background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    transition: color 0.3s, background 0.3s;
    width: 100%;
    max-width: 680px;
    /* Sem margens para evitar inconsistências */
    margin: 0;
    padding: 0;
    /* Estilo para nova estrutura */
    display: inline-block;
}

/* Estilo para cada linha individual do título */
.title-line {
    display: inline;
    /* Permite quebras normais de texto */
    white-space: normal;
}

body.dark-mode .hero-title {
    background: linear-gradient(90deg, #4A90E2 20%, #FF6B6B 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
    /* Pode ser específico se diferente do global h1 */
    margin-bottom: var(--space-md);
}

.hero-title .highlight {
    /* Estilo do highlight já está em .section-title .highlight */
    color: var(--color-accent-primary);
    /* Adiciona cor para garantir que a regra não esteja vazia */
}

.hero-subtitle {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-top: 1.2rem;
    margin-bottom: 2.2rem;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: color 0.3s;
}

body.dark-mode .hero-subtitle {
    color: var(--color-text-dark-secondary);
    text-shadow: none;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
    max-width: 600px;
}

.hero-cta-group {
    display: flex;
    flex-wrap: wrap;
    /* Permite quebrar em mobile */
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    /* Ajustado para depois do subtítulo */
    width: 100%;
    /* CORREÇÃO: Limitar largura em mobile */
    max-width: 100%;
    padding: 0 var(--space-sm);
    box-sizing: border-box;
}

/* Tarefa 5.1.2: Implementar gradientes em elementos de destaque (botão hero) */
.hero-cta-main {
    background-image: var(--gradient-primary);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
    background-color: transparent;
    /* Sobrescreve a cor sólida do .button-primary */
    border-color: transparent;
    /* Remove a borda sólida se houver */
    color: var(--color-bg-light);
    /* Garante texto branco */
    /* CORREÇÃO: Responsividade em mobile */
    max-width: 100%;
    box-sizing: border-box;
}

/* Fim Tarefa 5.1.2 */

/* Container para isolamento completo dos contadores - estilo Bento integrado */
.hero-stats-container {
    position: relative;
    width: 100%;
    height: auto;
    /* Isola completamente do fluxo de layout */
    transform: translateZ(0);
    /* Posicionado atrás dos mascotes */
    z-index: 1;
    /* Ajuste para não sobrepor os mascotes */
    margin-top: 35px;
    /* Ocupa toda a largura da página */
    max-width: 100%;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    /* Cria um layout tipo Bento moderno */
    position: relative;
    top: -240px;
    /* Ajusta a posição para ficar ao lado dos mascotes */
    left: 0;
    /* Layout responsivo */
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    gap: var(--space-xs);
}

.stat-item {
    /* Tarefa 1.2: Implementar efeito glassmorphism nos cards de estatísticas */
    background-color: rgba(255, 255, 255, 0.7);
    /* Cor de fundo semi-transparente */
    backdrop-filter: blur(10px);
    /* Desfoque do fundo */
    -webkit-backdrop-filter: blur(10px);
    /* Desfoque para Safari */
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius-lg);
    /* Estilo Material Design 2025 - sombra mais sutil e elegante */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    /* Grid já controla o tamanho agora */
    transition: all var(--transition-base);
    /* Contorno mais sutil - tendência minimalista 2025 */
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Borda sutil para efeito glass */
    /* Removido background: linear-gradient para usar background-color sólido */
    /* Isolamento de layout */
    contain: content;
    /* Melhor integração com os mascotes */
    z-index: 20;
}

/* Tarefa 1.2: Adicionar efeito hover com transição suave para cards */
.stat-item:hover {
    transform: translateY(-5px);
    /* Ajustado conforme TODO */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    /* Ajustado conforme TODO */
    /* A transição base já está no .stat-item, mas podemos refinar se necessário */
    /* transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); */
    /* Opcional: Adicionar transição específica do TODO aqui ou no .stat-item */
}

.stat-number {
    display: block;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-accent-primary);
    line-height: 1.1;
    /* Otimização sutil */
    transform: translateZ(0);
}

.stat-text {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: var(--space-xxs);
}

.hero-visual {
    /* Mobile first: imagem em posição normal no fluxo */
    width: 80%;
    /* Controla o tamanho da imagem em mobile */
    max-width: 450px;
    /* Limita o tamanho máximo em mobile */
    margin: var(--space-lg) auto 0 auto;
    /* Espaçamento e centralização */
    position: relative;
    /* Para z-index dos ícones funcionar corretamente */
    z-index: 15;
    /* Colocado acima dos stats para não haver sobreposição indesejada */
    pointer-events: none;
    /* Para não interferir com cliques no conteúdo */
    /* Apenas position absolute será aplicado em desktop via media query */
}

.hero-main-image {
    position: relative;
    /* Para z-index dos ícones flutuantes */
    z-index: 10;
    opacity: 0.7;
    /* Suavizar um pouco */
    pointer-events: auto;
    /* Permitir eventos na imagem principal, se necessário */
    /* animation: none !important;  Removido, pode ser útil para outras animações */
    display: block;
    margin: 0 auto;
    /* Centraliza a imagem dentro do .hero-visual */
}

.floating-icon {
    position: absolute;
    width: 30px !important;
    /* Tamanho base */
    height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
    animation: floatingIcon 6s ease-in-out infinite;
    opacity: 0.4;
    /* Mais transparente por padrão */
    /* z-index relativo ao .hero-visual ou .hero-main-image */

    /* Tarefa 5.2.1: Adicionar efeito 3D aos ícones flutuantes */
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.5s ease;
}

/* Tarefa 5.2.1: Efeito hover 3D */
.floating-icon:hover {
    transform: translateZ(20px) rotateY(10deg) rotateX(5deg);
}

/* Fim Tarefa 5.2.1 */

/* Dark mode adjustments for floating icons */
body.dark-mode .floating-icon {
    opacity: 0.6;
    /* Mais visível no dark mode */
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
    /* Sombra mais forte */
}

body.dark-mode .floating-icon:hover {
    opacity: 0.8;
    /* Ainda mais visível no hover */
    transform: translateZ(20px) rotateY(10deg) rotateX(5deg) scale(1.1);
}

/* Posições dos ícones flutuantes (ajustadas para mobile/tablet primeiro) */
/* Ícones atrás (z-index < z-index da imagem principal) */
.icon-1 {
    top: 5%;
    left: 5%;
    z-index: 5;
    animation-delay: 0s;
}

.icon-2 {
    top: 50%;
    right: 5%;
    z-index: 5;
    animation-delay: 1.5s;
}

.icon-3 {
    bottom: 10%;
    left: 20%;
    z-index: 5;
    animation-delay: 3s;
}

.icon-4 {
    top: 20%;
    right: 30%;
    z-index: 5;
    animation-delay: 2s;
}

.icon-5 {
    bottom: 30%;
    left: 5%;
    z-index: 5;
    animation-delay: 1s;
}

.icon-6 {
    top: 70%;
    left: 40%;
    z-index: 5;
    animation-delay: 2.5s;
}

/* Ícones na frente (z-index > z-index da imagem principal) */
.icon-7 {
    bottom: 5%;
    right: 10%;
    z-index: 15;
    animation-delay: 0.5s;
}

.icon-8 {
    top: 10%;
    left: 35%;
    z-index: 15;
    animation-delay: 2s;
}

.icon-9 {
    bottom: 15%;
    right: 20%;
    z-index: 15;
    animation-delay: 1.2s;
}

.icon-10 {
    bottom: 0%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    animation-delay: 3.5s;
}

.icon-11 {
    top: 75%;
    right: 25%;
    z-index: 15;
    animation-delay: 0.8s;
}

.icon-12 {
    bottom: 40%;
    right: 40%;
    z-index: 15;
    animation-delay: 1.8s;
}


/* Media Queries para Hero Section */
@media (max-width: 520px) {
    .stat-item {
        /* Em telas muito pequenas, podem ocupar mais largura */
        flex-basis: calc(50% - var(--space-sm));
        /* Duas colunas */
        max-width: calc(50% - var(--space-sm));
    }
}

@media (max-width: 767px) {

    /* Ajustes para dispositivos móveis */
    .hero-stats {
        /* Reposicionar para mobile */
        position: static;
        top: auto;
        margin-top: var(--space-md);
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .hero-stats-container {
        margin-top: 0;
        margin-bottom: var(--space-lg);
    }

    .stat-item {
        max-width: 100%;
        margin: 0 auto;
    }

    .hero-container {
        flex-direction: column;
        /* ULTRATHINK: Aplicando melhores práticas baseadas em eye-tracking research */
        /* Ordem otimizada seguindo padrões F-pattern e Z-pattern para mobile */
    }

    /* ULTRATHINK: Reordenação móvel que preserva desktop */
    .hero-container {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Mobile: Aplicar ordem específica aos elementos do hero-content */
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        order: 0;
        /* hero-content fica primeiro por padrão */
    }

    .hero-content .hero-title-wrapper {
        order: 1;
        /* Título primeiro */
        text-align: center;
        margin-bottom: var(--space-md);
    }

    .hero-content .hero-subtitle {
        order: 3;
        /* Subtítulo terceiro */
        text-align: center;
        margin-bottom: var(--space-lg);
    }

    .hero-content .hero-cta-group {
        order: 4;
        /* CTA quarto */
        justify-content: center;
        margin-bottom: var(--space-lg);
    }

    .hero-visual {
        order: 2;
        /* Imagem segundo */
        width: 80%;
        max-width: 450px;
        margin: var(--space-lg) auto;
    }

    .hero-stats-container {
        order: 5;
        /* Stats quinto */
        width: 100%;
        margin-bottom: 0;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {

    /* Ajustes para tablets */
    .hero-stats {
        top: -120px;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-xs);
    }
}

/* ULTRATHINK: Media queries responsivas inteligentes */
@media (max-height: 600px) {
    .hero-section {
        min-height: 100vh !important;
        padding-top: calc(var(--header-height-scrolled) + var(--space-lg)) !important;
        padding-bottom: var(--space-lg) !important;
    }
}

@media (max-height: 500px) {
    .hero-section {
        min-height: auto !important;
        padding-top: calc(var(--header-height-scrolled) + var(--space-md)) !important;
        padding-bottom: var(--space-md) !important;
    }
}

@media (min-width: 768px) {
    .hero-section {
        text-align: left;
        /* Alinha texto à esquerda */
        min-height: 100vh !important;
        padding-top: var(--header-height) !important;
        padding-bottom: var(--space-xl) !important;
    }
}

/* Desktop com altura pequena */
@media (min-width: 768px) and (max-height: 700px) {
    .hero-section {
        padding-top: calc(var(--header-height-scrolled) + var(--space-lg)) !important;
        padding-bottom: var(--space-lg) !important;
    }
}

@media (min-width: 768px) {
    .hero-container {
        display: flex;
        /* Ativa layout flex */
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: var(--space-xl);
    }

    .hero-content {
        /* ULTRATHINK: Reset order para desktop - ordem natural do HTML */
        order: initial;
        flex-basis: 55%;
        /* Conteúdo ocupa mais espaço */
        max-width: 600px;
        align-items: flex-start;
        /* Alinha itens do conteúdo à esquerda */
        margin-left: 0;
        margin-right: auto;
        margin-bottom: 0;
        /* Remove margin-bottom do mobile */
        padding-bottom: 0;
        /* Remove padding inferior pois a imagem estará ao lado */
        z-index: 20;
        /* Garante que o texto fique sobre a imagem */
        text-align: left;
        /* Alinhamento à esquerda em desktop */
        display: block;
        /* Reset flex do mobile */
    }

    /* ULTRATHINK: Reset completo para desktop - layout original */
    .hero-content {
        display: block;
        /* Reset do flex do mobile */
        order: initial;
        text-align: left;
    }

    .hero-content .hero-title-wrapper {
        order: initial;
        text-align: left;
        margin-bottom: var(--space-md);
    }

    .hero-content .hero-subtitle {
        order: initial;
        text-align: left;
        margin-bottom: var(--space-lg);
    }

    .hero-content .hero-cta-group {
        order: initial;
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .hero-stats {
        justify-content: flex-start;
        flex-wrap: nowrap;
        /* Impede quebra de linha dos stats */
        gap: var(--space-md);
        width: auto;
        /* Largura automática baseada no conteúdo */
        max-width: 100%;
    }

    .stat-item {
        flex-basis: auto;
        /* Tamanho baseado no conteúdo */
        flex-grow: 0;
        /* Não cresce para preencher espaço */
    }

    .hero-visual {
        /* ULTRATHINK: Reset completo para desktop - layout original */
        order: initial;
        flex-basis: 45%;
        position: absolute;
        top: 0;
        right: 0;
        width: 60%;
        height: 100%;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1;
        overflow: visible;
    }

    .hero-stats-container {
        order: initial;
    }

    .hero-main-image {
        width: auto;
        /* Tamanho automático baseado na altura */
        height: auto;
        max-width: 120%;
        /* Aumentado para 120% para permitir que a imagem seja maior */
        max-height: 95%;
        /* Aumentado para 95% para permitir que a imagem seja maior */
        object-fit: contain;
        opacity: 0.8;
        /* Aumentado ligeiramente para melhor visibilidade */
        margin-left: -10%;
        /* Desloca a imagem para a esquerda para melhor posicionamento */
    }

    /* Ajuste dos ícones flutuantes para o layout desktop */
    .floating-icon {
        width: 35px !important;
        height: 35px !important;
        max-width: 35px !important;
        max-height: 35px !important;
        opacity: 0.5;
    }

    /* Posições relativas ao .hero-visual */
    .icon-1 {
        top: 10%;
        left: 5%;
        z-index: 5;
    }

    .icon-2 {
        top: 60%;
        right: 10%;
        z-index: 5;
    }

    .icon-3 {
        bottom: 15%;
        left: 25%;
        z-index: 5;
    }

    .icon-4 {
        top: 25%;
        right: 40%;
        z-index: 5;
    }

    .icon-5 {
        bottom: 40%;
        left: 5%;
        z-index: 5;
    }

    .icon-6 {
        top: 70%;
        left: 45%;
        z-index: 5;
    }

    .icon-7 {
        bottom: 10%;
        right: 5%;
        z-index: 15;
    }

    .icon-8 {
        top: 15%;
        left: 40%;
        z-index: 15;
    }

    .icon-9 {
        bottom: 20%;
        right: 15%;
        z-index: 15;
    }

    .icon-10 {
        bottom: 5%;
        left: 50%;
        z-index: 15;
    }

    .icon-11 {
        top: 80%;
        right: 30%;
        z-index: 15;
    }

    .icon-12 {
        bottom: 50%;
        right: 45%;
        z-index: 15;
    }
}

@media (min-width: 1024px) {
    .hero-stats {
        gap: var(--space-xl);
        /* Mais espaço entre stats */
    }

    .hero-content {
        flex-basis: 50%;
        /* Ajuste fino da proporção */
        position: relative;
        /* Garante que o z-index funcione */
        z-index: 20;
        /* Mantém o texto na frente da imagem */
    }

    .hero-visual {
        flex-basis: 50%;
        width: 65%;
        /* Aumentado para permitir uma imagem ainda maior em telas grandes */
    }

    .hero-main-image {
        max-width: 130%;
        /* Aumentado para telas maiores */
        margin-left: -15%;
        /* Ajustado para telas maiores */
    }
}

@media (min-width: 1200px) {
    .hero-content {
        padding-right: var(--space-lg);
        /* Mais espaço se a imagem estiver muito próxima */
        flex-basis: 45%;
        /* Reduzido para dar mais espaço à imagem */
    }

    .hero-visual {
        width: 70%;
        /* Aumentado para permitir uma imagem ainda maior em telas muito grandes */
    }

    .hero-main-image {
        max-width: 140%;
        /* Aumentado para telas muito grandes */
        margin-left: -20%;
        /* Ajustado para telas muito grandes */
    }

    .floating-icon {
        /* Ícones um pouco maiores em telas grandes */
        width: 40px !important;
        height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        opacity: 0.6 !important;
    }
}