:root {
    /* Paleta Vibrante & Profissional */
    --primary: #1A237E;
    --primary-light: #534bae;
    --accent: #FFD700;
    --accent-glow: rgba(255, 215, 0, 0.3);

    --bg-gradient-start: #f3f4f6;
    --bg-gradient-end: #e8eaf6;

    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.10);

    --text-main: #1a1a1a;
    --text-muted: #666;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

/* RESET E TRAVAMENTO DE TELA */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 40px;
    width: 100%;
    overflow-x: hidden;
    /* Garante que nada vaze */
    position: relative;
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: border-box;
}

h1,
h2,
h3 {
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* === Header === */
header {
    background: rgba(255, 255, 255, 0.9);
    /* Pouco mais opaco para leitura */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.8rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    /* Margem segura desktop */
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    /* Logo na esquerda, Ícone na direita */
    align-items: center;
    position: relative;
    padding: 4px 0;
}

/* Remover classe .brand antiga pois agora os itens estão soltos */

.logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Fix lint */

    /* Centralização Absoluta */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    /* Evitar quebra de linha indesejada */
    text-align: center;
}

/* Garante que o ícone social da direita não precise de posição absoluta se usarmos space-between,
   mas como o texto está absoluto, space-between vai jogar o logo pro inicio e o icone pro fim.
   O Link social já está no fluxo normal como ultimo item flex. 
   Então apenas removemos o estilo anterior de position absolute do link.
*/
.nav-flex>a {
    position: static;
    /* Volta ao fluxo normal do flex */
    margin-left: auto;
    /* Garante que vá para a direita se precisasse, mas space-between já faz isso */
}

/* === Seletor de Idiomas (Abas Visuais) === */
.language-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.6);
    padding: 4px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-top: 2rem;
    justify-content: center;
    box-shadow: var(--glass-shadow);
    flex-wrap: wrap;
    gap: 4px;
}

.lang-tab {
    padding: 10px 24px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    white-space: nowrap;
    /* Não quebrar texto */
}

.lang-tab:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
}

.lang-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(26, 35, 126, 0.3);
}

/* === Hero Section === */
.hero {
    padding: 2rem 0 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Blob de fundo */
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translate(-50%, 0);
    width: 100%;
    /* Largura relativa */
    max-width: 600px;
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(26, 35, 126, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-featured {
    margin-top: 1rem;
    perspective: 1000px;
    width: 100%;
}

.hero-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 10px 30px rgba(26, 35, 126, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.4s ease;
    text-align: left;
    width: 100%;
}

.hero-img {
    flex-shrink: 0;
}

.hero-img img {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    box-shadow: 0 8px 20px rgba(26, 35, 126, 0.2);
    object-fit: cover;
}

.hero-content {
    flex: 1;
    min-width: 0;
    /* Impede quebra de layout flex */
}

.hero-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 215, 0, 0.15);
    color: #bfa004;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Grid de Cards === */
.section-title {
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--accent);
}

.app-grid {
    display: grid;
    /* Desktop: Colunas automáticas com mínimo de 280px */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.app-card {
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    /* Sombra mais leve para performance */
    transition: transform 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.app-card:active {
    transform: scale(0.98);
    /* Feedback tátil de clique */
}

.card-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #f0f0f0;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-download {
    margin-top: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    /* Mais moderno */
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.25);
}

/* === MOBILE OPTIMIZATION === */
@media (max-width: 768px) {
    .container {
        padding: 0 24px;
        /* Mais margem interna para não colar na borda */
    }

    /* Ajuste Header */
    .brand {
        font-size: 1.2rem;
    }

    /* Abas de Idioma - Grid 2x2 no Mobile */
    .language-tabs {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        /* Duas colunas iguais */
        gap: 8px;
        /* Espaço entre os botões */
        padding: 8px;
        margin-top: 1rem;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 16px;
        /* Borda arredondada no container */
        border: 1px solid rgba(255, 255, 255, 0.5);
        margin-left: 0;
        /* Reset margins */
        margin-right: 0;
        justify-content: stretch;
    }

    .lang-tab {
        width: 100%;
        justify-content: center;
        /* Centralizar texto/ícone */
        background: rgba(255, 255, 255, 0.5);
        /* Fundo leve para todos */
        margin: 0;
        border-radius: 12px;
        padding: 10px 4px;
        /* Padding vertical */
        font-size: 0.9rem;
        box-shadow: none;
    }

    .lang-tab.active {
        box-shadow: 0 4px 12px rgba(26, 35, 126, 0.2);
        background: var(--primary);
        color: white;
    }

    /* Hero Responsivo */
    .hero-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1rem;
    }

    .hero-img img {
        width: 100px;
        height: 100px;
        box-shadow: 0 5px 15px rgba(26, 35, 126, 0.15);
    }

    .hero-content h2 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
    }

    /* Grid Mobile: 1 Coluna Fluida */
    .app-grid {
        grid-template-columns: 1fr;
        /* Força 1 coluna */
        gap: 16px;
    }

    .app-card {
        padding: 16px;
        /* Respiro interno */
    }
}