/* ================= Váriaveis de Cores ================= */
:root {
    --primary: #1c7c8a;
    --bg-light-1: #f4f6f8;
    --bg-light-2: #f4f8fa;
    --bg-light-3: #f0f2f4;
    --white: #ffffff;
    --text-dark: #333333;
    --text-medium: #555555;
    --text-light: #777777;
    --font-title: 'Montserrat', sans-serif;
    --font-text: 'Open Sans', sans-serif;
}

/* ================= Reset e Estilos Globais ================= */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 50px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-text);
    color: var(--text-medium);
    line-height: 1.6;
    background-color: var(--white);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-title);
    color: var(--text-dark);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.3s ease;
}

a:hover {
    color: #145a64;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 0;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--white);
    color: var(--primary);
    border-radius: 4px;
    font-weight: 600;
    font-family: var(--font-title);
    border: 2px solid var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

/* ================= Preloader ================= */
body.no-scroll {
    overflow: hidden;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--primary);
    /* Usa a cor verde-azulada da P4S */
    z-index: 99999;
    /* Garante que fica por cima de ABSOLUTAMENTE tudo */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Classe adicionada pelo JS para esconder suavemente */
#preloader.hide {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: var(--white);
    width: 80%;
    max-width: 350px;
}

.loader-logo {
    width: 180px;
    margin-bottom: 25px;
    animation: pulse 1.5s infinite;
    /* Pequena animação na logo */
}

/* Fundo da barra */
.progress-container {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

/* A barra que vai encher */
.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--white);
    transition: width 0.2s ease;
}

.progress-text {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

/* Animação de "pulsar" para a logo não ficar estática */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

/* ================= Botão Outline Específico do Hero ================= */
.btn-hero-outline {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

/* O que acontece ao passar o rato (Hover) */
.btn-hero-outline:hover {
    background-color: var(--white);
    color: var(--primary);
    border-color: var(--white);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary);
}

/* ================= Header e Nav ================= */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
}

.logo {
    display: inline-block;
    /* Essencial para o link suportar a animação de zoom */
    text-decoration: none;
}

.logo img {
    height: 45px;
    /* Define uma altura ideal para o menu. Pode aumentar ou diminuir se precisar! */
    width: auto;
    /* Garante que a imagem não fica distorcida/esticada */
    display: block;
    transition: transform 0.3s ease;
    /* Cria a animação suave */
}

/* Efeito de Zoom ao passar o rato */
.logo:hover img {
    transform: scale(1.1);
    /* Dá um zoom de 10% na imagem */
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
    /* OBRIGATÓRIO: Permite que o link sofra transformações como o zoom */
    transition: transform 0.3s ease, color 0.3s ease;
    /* Deixa o zoom e a mudança de cor suaves */
}

.nav-links a:hover {
    color: var(--primary);
    /* Muda a cor para o verde-azulado */
    transform: scale(1.1);
    /* Faz o texto dar um zoom de 10% */
}

/* Estado ativo (página atual) */
.nav-links a.active,
.nav-links a[aria-current="page"] {
    color: var(--primary);
}

/* ================= Seletor de Idioma Moderno ================= */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 5px;
    /* Espaço entre os botões */
    background-color: var(--bg-light-2);
    /* Fundo cinzento muito clarinho para a cápsula */
    padding: 4px;
    border-radius: 50px;
    /* Cria o formato de pílula/cápsula */
    border: 1px solid var(--bg-light-3);
}

.lang-btn {
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-light);
    /* Cor cinzenta para o idioma inativo */
    text-decoration: none;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    color: var(--primary);
    /* Fica verde-azulado ao passar o rato se estiver inativo */
}

/* O idioma que está selecionado atualmente */
.lang-btn.active {
    background-color: var(--white);
    /* Fundo branco para destacar */
    color: var(--primary);
    /* Texto na cor principal */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* Sombra suave para parecer que está em relevo */
}

/* Menu Mobile Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary);
    margin-bottom: 4px;
}

/* ================= Hero Section ================= */
.hero {
    position: relative;
    min-height: 94vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
    overflow: hidden;
    /* Esconde qualquer parte do vídeo que saia das bordas */
    padding: 2rem 5%;
}


.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/*
.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
*/

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 27, 31, 0.7);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    color: var(--white);
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
    /* Força o título a ser branco para contrastar com o vídeo */
}

.hero-content p {
    font-size: 1.2rem;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: left;
}

.hero-badge-glass {
    width: 70px;
    height: 70px;
    position: absolute;
    /* Permite posicionar livremente dentro do Hero */
    bottom: 30px;
    /* Distância do fundo */
    left: 5%;
    /* Alinhado com o resto do conteúdo do site (os 5% de padding laterais) */
    z-index: 10;
    /* Garante que fica por cima do vídeo e do overlay escuro */

    /* --- O EFEITO GLASSMORPHISM --- */
    /* Fundo branco super transparente */
    background: rgba(255, 255, 255, 0.1);
    /* O desfoque mágico do que está atrás */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Essencial para funcionar no Safari/Mac/iPhone */
    /* Uma borda fina e subtil para definir o vidro */
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Uma sombra suave para dar profundidade */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    padding: 15px;
    /* Espaço entre a imagem e a borda do vidro */
    border-radius: 10px;
    /* Bordas arredondadas ficam melhor com este efeito */
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeUp 1s ease-out 0.5s backwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Efeito de Zoom ao passar o rato no vidro */
.hero-badge-glass:hover {
    transform: scale(1.8);
    /* Aumenta o tamanho em 10% */
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    /* Aumenta a sombra para dar mais profundidade */
}

/* Define o tamanho da imagem dentro do vidro */
.hero-badge-glass img {
    width: 60px;
    /* Ajuste este valor se quiser a imagem maior ou menor */
    height: auto;
    display: block;
}

/* Pequena animação para o crachá aparecer suavemente de baixo para cima */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================= Botão Scroll Down (Hero) ================= */
.scroll-down-btn {
    position: absolute;
    bottom: 40px;
    /* Distância do fundo */
    left: 50%;
    z-index: 10;
    /* Mantém o botão por cima do vídeo */
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
    font-size: 1.5rem;
    text-decoration: none;
    border-radius: 50%;

    /* Efeito Glassmorphism para combinar com o crachá */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);

    /* Centra o botão e aplica a animação */
    transform: translate(-50%, 0);
    animation: bounce 2.5s infinite;
    transition: all 0.3s ease;
}

/* O que acontece ao passar o rato (Hover) */
.scroll-down-btn:hover {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation-play-state: paused;
    /* Pára de saltar para facilitar o clique */
    transform: translate(-50%, -3px);
}

/* Animação do "salto" (Bounce) */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translate(-50%, 0);
    }

    40% {
        transform: translate(-50%, -15px);
        /* Salto mais alto */
    }

    60% {
        transform: translate(-50%, -7px);
        /* Salto mais baixo */
    }
}

/* ================= Quem Somos ================= */
.quem-somos-content {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.quem-somos-text {
    flex: 1;
}

.quem-somos-text p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Botão primário da página Quem Somos */
.quem-somos-page .btn.btn-quem-somos-contact {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.quem-somos-page .btn.btn-quem-somos-contact:hover {
    background-color: var(--white);
    color: var(--primary);
    border-color: var(--primary);
}

.quem-somos-image {
    flex: 1;
}

.quem-somos-image img {
    height: 450px;
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quem-somos-image img:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

blockquote {
    background-color: var(--bg-light-2);
    border-left: 5px solid var(--primary);
    padding: 1.5rem;
    margin-top: 1rem;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-dark);
    font-family: var(--font-title);
}

/* ================= Público ================= */
.publico {
    background-color: var(--bg-light-3);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    text-align: left;

    position: relative;
    /* Mantém o ícone/elementos absolutos no lugar */
    overflow: hidden;
    /* Garante que a nossa nova borda animada respeita os cantos arredondados do card */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Deixa o card suave caso queiramos que ele flutue */
}

/* Criamos a "borda" dinâmica encostada à esquerda */
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    /* Espessura da borda lateral */
    height: 100%;
    background-color: var(--primary);
    /* Cor da borda */

    /* A magia da animação acontece aqui: */
    transform: scaleY(0);
    /* Começa com altura zero (invisível) */
    transform-origin: bottom;
    /* Faz a borda crescer de baixo para cima! */
    transition: transform 0.4s ease;
    /* Controla a velocidade da animação */
}

/* Efeito Hover: O que acontece quando passamos o rato no card */
.card:hover {
    transform: translateY(-5px);
    /* Dá um leve salto para cima (opcional, mas fica ótimo) */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    /* Aumenta a sombra suavemente */
}

/* Efeito Hover na borda: Faz ela crescer */
.card:hover::before {
    transform: scaleY(1);
    /* A borda estica até 100% da altura do card */
}

/* Agrupamento para ícone + título (MANTÉM-SE IGUAL) */
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.icone-titulo {
    font-size: 1.5rem;
    color: var(--primary);
    /* Usa a cor principal da P4S */
}

.card h3 {
    color: var(--primary);
    margin-bottom: 0;
    /* Removemos a margem do h3 porque o card-header já trata disso */
}

.card p {
    text-align: justify;
}

/* ================= Equipa (Flipcards 3D) ================= */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.flip-card {
    background-color: transparent;
    height: 400px;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.flip-card-front {
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.flip-card-front img {
    width: 100%;
    height: 75%;
    object-fit: cover;
}

.flip-card-front h3 {
    height: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 1.1rem;
}

.flip-card-back {
    background-color: var(--primary);
    color: var(--white);
    transform: rotateY(180deg);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    /* Permite scroll se o texto for muito grande */
    display: flex;
    flex-direction: column;
}

.flip-card-back p {
    font-size: 0.85rem;
    text-align: justify;
    margin-bottom: 1rem;
    color: var(--bg-light-1);
}

.flip-card-back .btn {
    margin-top: auto;
    align-self: center;
    padding: 8px 20px;
    font-size: 0.9rem;
}

.flip-card-back::-webkit-scrollbar {
    width: 6px;
}

.flip-card-back::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

/* ================= Ferramentas & Formações ================= */
.ferramentas,
.formacoes {
    background-color: var(--bg-light-1);
}

.list-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.tag {
    display: inline-block;
    /* Garante que o link respeite os espaçamentos */
    background-color: var(--white);
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-weight: 600;
    color: var(--primary);
    border: 0px solid var(--bg-light-3);
    text-decoration: none;
    /* Remove o sublinhado padrão dos links */
    transition: all 0.3s ease;
    /* Cria uma transição suave */
    cursor: pointer;
    /* Muda o cursor para a "mãozinha" de clique */
}

.tag:hover {
    background-color: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
    /* Faz o botão dar um leve "pulo" para cima */
    box-shadow: 0 5px 15px rgba(28, 124, 138, 0.3);
    /* Aumenta a sombra */
}

/* Tags apenas informativas (não clicáveis) */
.tag.tag-static {
    cursor: default;
    transition: all 0.3s ease;
}

.tag.tag-static:hover {
    background-color: var(--primary);
    color: var(--white);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 15px rgba(28, 124, 138, 0.3);
}

/* ================= Cards de Formações ================= */
.formacao-card {
    display: block;
    /* Garante que o link ocupe todo o espaço do card */
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    /* Garante que a imagem respeite as bordas arredondadas */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    /* Remove o sublinhado do link */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Efeito ao passar o rato por cima do card inteiro */
.formacao-card:hover {
    transform: translateY(-5px);
    /* Dá um pequeno salto para cima */
    box-shadow: 0 8px 20px rgba(28, 124, 138, 0.2);
    /* Sombra com a cor primária */
}

.formacao-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    /* Faz a imagem preencher o espaço sem distorcer */
    display: block;
    transition: transform 0.5s ease;
}

/* Efeito de zoom na imagem ao passar o rato (opcional, mas fica elegante) */
.formacao-card:hover img {
    transform: scale(1.05);
}

.formacao-card h3 {
    color: var(--primary);
    font-size: 1.2rem;
    text-align: center;
    padding: 1.5rem 1rem;
    margin: 0;
    background-color: var(--white);
    position: relative;
    /* Mantém o texto acima da imagem durante o zoom */
    z-index: 2;
}

/* ================= Separador ================= */
.modern-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--text-light) 50%, transparent 100%);
    width: 70%;
    margin: 0 auto;
    opacity: 0.4;
    border-radius: 5px;
}

/* ================= Parceiros ================= */
.parceiros-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.parceiros-grid img {
    max-height: 80px;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.parceiros-grid img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* ================= Blog ================= */
.blog {
    background-color: var(--bg-light-1);
}

.blog-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover img {
    transform: scale(1.03);
}

.blog-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Garante que os botões fiquem alinhados no fundo se os textos tiverem tamanhos diferentes */
}

.blog-content h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.blog-content p {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-bottom: 1.5rem;
    text-align: justify;
    flex-grow: 1;
}

.blog-btn {
    align-self: flex-start;
    font-size: 0.85rem;
    padding: 8px 20px;
}

.blog-footer {
    text-align: center;
    margin-top: 3.5rem;
}

/* ================= Testemunhos (Slider) ================= */
.testemunhos {
    background-color: var(--bg-light-2);
}

.slider-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.slider-container {
    overflow: hidden;
    /* Esconde os testemunhos que estão de fora */
    flex-grow: 1;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    /* Animação suave a deslizar */
    will-change: transform;
}

.slide {
    min-width: 100%;
    /* Cada testemunho ocupa 100% do espaço visível */
    padding: 0 2rem;
    box-sizing: border-box;
}

.slide-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Empurra o texto para cima e o footer para baixo */
    gap: 2rem;
    background: var(--white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    min-height: 100%;
    /* Garante que os cartões estiquem para ter a mesma altura */
}

.slide-text {
    width: 100%;
}

.slide-text p {
    font-style: italic;
    color: var(--text-medium);
    margin-bottom: 0;
    /* A margem agora é controlada pelo gap no slide-content */
    text-align: justify;
    line-height: 1.8;
}

/* --- O Novo Rodapé do Testemunho --- */
.slide-footer {
    display: flex;
    justify-content: space-between;
    /* Empurra o autor para a esquerda e o logo para a direita */
    align-items: flex-end;
    /* Alinha ambos pelo fundo */
    width: 100%;
    border-top: 1px solid var(--bg-light-3);
    /* Linha opcional para separar o texto da assinatura */
    padding-top: 1.5rem;
}

.slide-author {
    text-align: left;
}

.slide-logo {
    display: flex;
    justify-content: flex-end;
}

.slide-logo img {
    max-width: 140px;
    max-height: 60px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.slide-author h4 {
    color: var(--primary);
    margin-bottom: 0.2rem;
    font-size: 1.1rem;
}

.slide-author span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
}

/* Botões de Navegação (Setas) */
.slider-btn {
    background-color: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    position: absolute;
    z-index: 10;
}

.slider-btn.prev {
    left: -20px;
}

.slider-btn.next {
    right: -20px;
}

.slider-btn:hover {
    background-color: var(--primary);
    color: var(--white);
    transform: scale(1.1);
}

.testemunhos-footer {
    text-align: center;
    margin-top: 3rem;
}

/* Responsividade para telemóveis */
@media (max-width: 768px) {
    .slide-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 2rem 1.5rem;
    }

    .slide-text p {
        text-align: center;
    }

    .slider-btn.prev {
        left: 0;
    }

    .slider-btn.next {
        right: 0;
    }

    .slide {
        padding: 0 1rem;
    }
}

/* ================= Contato ================= */
.contato {
    background-color: var(--bg-light-1);
}

.contato-wrapper {
    display: flex;
    gap: 4rem;
    flex-wrap: wrap;
}

.formulario {
    flex: 1;
    min-width: 300px;
}

#contato .btn {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border-radius: 8px;
    margin-top: 10px;
    transition: all 0.3s ease;
    font-weight: 700;
}

/* Efeito exclusivo ao passar o rato (Hover) */
#contato .btn:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(28, 124, 138, 0.3);
}

.info-contato {
    flex: 1;
    min-width: 300px;
    background-color: var(--white);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: var(--font-text);
}

.info-bloco {
    margin-bottom: 2rem;
}

.info-bloco h4 {
    color: var(--primary);
}

/* ================= Footer ================= */
footer {
    background-color: var(--text-dark);
    color: var(--bg-light-1);
    padding: 4rem 5% 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

footer .logo img {
    height: 50px;
}

.distincao {
    height: 200px;
    width: 100%px;
}

.footer-col h3 {
    color: var(--white);
}

.footer-col a {
    color: var(--bg-light-1);
    display: block;
    margin-bottom: 0.5rem;
}

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

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.social-links a {
    color: var(--bg-light-1);
    font-size: 1.5rem;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease, color 0.3s ease;
}

.footer-extra-images {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    align-items: center;
}

.footer-extra-images img {
    max-width: 150px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 15px;
}

.footer-extra-images img:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

/* Efeito Hover: O que acontece ao passar o rato */
.social-links a:hover {
    color: var(--primary);
    transform: translateY(-5px) scale(1.1);
}

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

/* ================= Chatbot Moderno ================= */
.chatbot-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-text);
}

.chat-toggle {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(28, 124, 138, 0.4);
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle:hover {
    transform: scale(1.1);
    background-color: #145a64;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* Estado inicial fechado */
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

/* Classe para quando o chat está aberto */
.chat-window.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-header {
    background-color: var(--primary);
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-title);
}

.close-chat {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.close-chat:hover {
    transform: scale(1.2) rotate(90deg);
}

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--bg-light-2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Personalização da barra de rolagem do chat */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: fadeInMsg 0.3s ease forwards;
}

.msg-bot {
    background-color: var(--white);
    color: var(--text-dark);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.msg-user {
    background-color: var(--primary);
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-options {
    padding: 15px;
    background-color: var(--white);
    border-top: 1px solid var(--bg-light-3);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-btn {
    background-color: var(--bg-light-2);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

@keyframes fadeInMsg {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade do Chat em Telemóveis */
@media (max-width: 400px) {
    .chat-window {
        width: 300px;
        height: 400px;
        right: -10px;
    }
}

/* ================= Certificações ================= */
.certificacao-box {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background-color: var(--bg-light-2);
    padding: 1.5rem;
    border-radius: 8px;
}

.certificacao-box img {
    max-width: 120px;
    height: auto;
}

.certificacao-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.certificacao-box li {
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.certificacao-box li:last-child {
    margin-bottom: 0;
}

/* Responsividade para a caixa no mobile */
@media (max-width: 768px) {
    .certificacao-box {
        flex-direction: column;
        /* Coloca a imagem em cima e o texto em baixo */
        align-items: center;
        /* Centra os elementos horizontalmente */
    }

    .certificacao-box img {
        max-width: 140px;
        /* Um pouco maior no mobile para dar destaque */
        margin-bottom: 0.5rem;
    }

    .certificacao-box ul {
        width: 100%;
    }
}

/* ================= Layout Dividido (Autoconsciência / Plano de Ação) ================= */
.grid-split {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .grid-split {
        grid-template-columns: 1fr;
    }
}

/* ================= Risk Type Compass ================= */
/* Classe reutilizável para efeito de flutuação em imagens */
.imagem-flutuante {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.imagem-flutuante:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ================= Neurofeedback/Biofeedback ================= */
.intro-flexbox {
    display: flex;
    gap: 3rem;
    align-items: center;
    margin-bottom: 2rem;
}

.intro-texto {
    flex: 1.2;
}

.intro-imagem {
    flex: 1;
}

.intro-imagem img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.intro-imagem img:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .intro-flexbox {
        flex-direction: column;
        gap: 1.5rem;
    }

    .intro-texto .membro-title {
        margin-bottom: 1rem;
    }
}

/* ================= Responsividade ================= */
@media (max-width: 768px) {

    .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        text-align: center;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        padding: 0;
        transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
    }

    .nav-links.active {
        max-height: 500px;
        opacity: 1;
        padding: 1rem 0;
    }

    .menu-toggle {
        display: flex;
    }

    .quem-somos-content {
        flex-direction: column-reverse;
        gap: 15px;
    }

    .quem-somos-image img {
        height: auto;
        max-height: 300px;
        aspect-ratio: 16 / 9;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero {
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-badge-glass {
        width: 50px;
        height: 50px;
        border-radius: 8px;
    }

    .hero-badge-glass img {
        width: 40px;
        height: 40px;
    }

    /* -- Ferramentas -- */
    .list-grid {
        flex-direction: column;
        width: 100%;
    }

    .tag {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    /* -- Testemunhos -- */
    .slide-content {
        gap: 0;
        padding: 2rem 1.5rem;
        text-align: center;
    }

    .slide-text p {
        text-align: justify;
    }

    .slider-btn.prev {
        left: -15px;
    }

    .slider-btn.next {
        right: -15px;
    }

    .slide {
        padding: 0 1rem;
    }

    .slide-author {
        text-align: center;
    }

    .slide-footer {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .slide-logo {
        justify-content: flex-center;
    }

}

/* ================= Página da Equipa (Membro) ================= */
.hero-membro {
    min-height: 94vh;
    padding: 2rem 5%;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-bg-membro {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.hero-membro-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
    gap: 3rem;
    position: relative;
    z-index: 2;
}

.hero-membro-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
}

.hero-membro-imagebox {
    flex: 1;
    position: relative;
    aspect-ratio: 1 / 1;
    align-self: center;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Criamos a "borda" dinâmica encostada à esquerda para a imagem */
.hero-membro-imagebox::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    /* Espessura da borda lateral um pouco maior para a foto */
    height: 100%;
    background-color: var(--primary);
    z-index: 5;
    /* Fica acima da imagem */
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.4s ease;
}

.hero-membro-imagebox:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.hero-membro-imagebox:hover::before {
    transform: scaleY(1);
}

.hero-image-membro {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    z-index: 0;
}

@media (max-width: 991px) {
    .hero-membro {
        min-height: auto;
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .hero-membro-container {
        flex-direction: column-reverse;
        /* Texto em baixo, imagem em cima no mobile */
    }

    .hero-membro-imagebox {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        aspect-ratio: 1 / 1;
    }
}

.membro-content {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.membro-text {
    flex: 2;
}

.membro-title {
    text-align: left;
    margin-bottom: 2rem;
}

.membro-text p {
    text-align: justify;
    margin-bottom: 1.5rem;
}

.membro-quote {
    background-color: var(--bg-light-2);
    border-left: 5px solid var(--primary);
    padding: 1.5rem;
    margin-top: 2rem;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.membro-certificacoes {
    flex: 1;
    background-color: var(--bg-light-2);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 100px;
}

.membro-certificacoes h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.certificacoes-list {
    list-style: none;
    padding: 0;
}

.certificacoes-list li {
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.4;
}

.certificacoes-list li i {
    position: absolute;
    left: 0;
    top: 3px;
    color: var(--primary);
}

@media (max-width: 991px) {
    .membro-content {
        flex-direction: column;
    }

    .membro-certificacoes {
        width: 100%;
        position: static;
        margin-top: 2rem;
    }
}

/* ================= Modais ================= */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    position: relative;
    background-color: var(--white);
    margin: 5% auto;
    padding: 3rem;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    color: var(--text-light);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--text-dark);
    text-decoration: none;
}

.modal-body {
    max-height: 80vh;
    overflow-y: auto;
    padding-right: 15px;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.modal-flex-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.modal-flex-text {
    flex: 2;
}

.modal-flex-image {
    flex: 1;
}

@media (max-width: 991px) {
    .modal-flex-layout {
        flex-direction: column;
    }

    .modal-flex-image {
        padding-top: 0px !important;
        margin-top: -30px !important;
    }
}

/* ================= Páginas Simples (Sem Sidebar ou Imagem Hero) ================= */
.hero-single .hero-membro-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.hero-single .hero-content {
    max-width: 100%;
    text-align: center;
    position: relative;
}

.hero-single h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-single p.hero-subtitle {
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.hero-single .hero-buttons {
    justify-content: center;
    margin-top: 2rem;
}

.content-single .membro-content {
    display: block;
}

.content-single .membro-text {
    max-width: 800px;
    margin: 0 auto;
}

.content-single p {
    text-align: justify;
    margin-bottom: 1.5rem;
}

.content-single .membro-title.mt-2 {
    margin-top: 2rem;
}

.content-single .certificacoes-list {
    margin-bottom: 2rem;
}

.content-single .certificacoes-list li {
    margin-bottom: 1rem;
}

.content-single .certificacoes-list i {
    color: var(--primary);
    margin-right: 10px;
}

.content-single .membro-quote.quote-primary {
    background-color: var(--primary);
    color: var(--white);
    border-left: none;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 3rem;
    font-style: normal;
    margin-top: 3rem;
}

/* ================= Página de Testemunhos (Grelha) ================= */
.testemunhos-grid {
    display: grid;
    /* Usa 2 colunas em ecrãs grandes, cai para 1 em telemóveis */
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

/* Garante que os cartões estiquem para ter a mesma altura na linha */
.testemunhos-grid .slide-content {
    height: 100%;
    margin: 0;
}

@media (max-width: 768px) {
    .testemunhos-grid {
        grid-template-columns: 1fr;
    }
}