@font-face {
    font-family: 'Poppins';
    src: url('/fonts/Poppins/Poppins-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('/fonts/Poppins/Poppins-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('/fonts/Poppins/Poppins-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('/fonts/Poppins/Poppins-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
}

:root {
    --cgr-petroleo: #0b3544;
    --cgr-azul: #079fca;
    --cgr-turquesa: #3eb6d4;
    --cgr-fundo: #eaf3f5;
    --cgr-texto: #103b4a;
    --cgr-secundario: #88a9b2;
    --cgr-branco: #fff;
    --cgr-borda: #dce9ec;
    --cgr-sombra: 0 14px 35px rgb(11 53 68 / 9%);
}

html {
    min-height: 100%;
    font-size: 16px;
    position: relative;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--cgr-fundo);
    color: var(--cgr-texto);
    font-family: "Poppins", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { transition: color .2s ease, background-color .2s ease, transform .2s ease; }

.cgr-cabecalho {
    position: relative;
    z-index: 5;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #eaf3f5;
    border: 0;
    border-radius: 0 0 36px 36px;
    box-shadow: 0 3px 18px rgb(11 53 68 / 6%);
    /* O próprio cabeçalho é o elemento arredondado; não usar clip-path. */
}

.cgr-cabecalho-interior {
    width: min(calc(100% - 64px), 1600px);
    min-height: 124px;
    margin: 0 auto;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.cgr-marca {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    padding: 4px 0;
}

.cgr-logo {
    display: block;
    width: 250px;
    max-width: 100%;
    max-height: 112px;
    height: auto;
    object-fit: contain;
}

.cgr-navegacao {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 14px;
    min-width: 0;
}

.cgr-navegacao a {
    min-height: 46px;
    padding: 0 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.cgr-link-inicio { color: var(--cgr-petroleo); background: #e0edf0; }
.cgr-link-inicio:hover { color: var(--cgr-petroleo); background: #d0e4e9; }
.cgr-link-contactos { color: var(--cgr-branco); background: var(--cgr-petroleo); }
.cgr-link-contactos:hover { color: var(--cgr-branco); background: #15556a; }

main { flex: 1 0 auto; }

/* Página inicial */
.portal-hero {
    position: relative;
    isolation: isolate;
    min-height: 650px;
    overflow: hidden;
    padding: 54px 32px 66px;
    background: var(--cgr-fundo);
}

.portal-fundo {
    position: absolute;
    z-index: -2;
    inset: 0;
    background-image: url("../images/fundo-cgr.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

.portal-conteudo {
    position: relative;
    width: min(100%, 1520px);
    min-height: 530px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(480px, .92fr) minmax(420px, 1.08fr);
    align-items: center;
    gap: clamp(28px, 4vw, 76px);
}

.portal-coluna { width: 100%; max-width: 700px; padding: 0 0 18px; }
.portal-etiqueta {
    margin-bottom: 10px;
    color: #7299a4;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 1.8px;
}
.portal-coluna h1 {
    margin: 0 0 12px;
    color: var(--cgr-petroleo);
    font-size: clamp(2.3rem, 3.7vw, 3.6rem);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -1.4px;
}
.portal-introducao {
    max-width: 560px;
    margin: 0 0 28px;
    color: #789da7;
    font-size: 1rem;
    line-height: 1.8;
}

.portal-cartoes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.portal-cartao {
    min-height: 145px;
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--cgr-branco);
    border: 1px solid rgb(255 255 255 / 80%);
    border-radius: 17px;
    box-shadow: 0 9px 25px rgb(11 53 68 / 7%);
    color: var(--cgr-texto);
    text-decoration: none;
}
.portal-cartao:hover {
    color: var(--cgr-petroleo);
    transform: translateY(-4px);
    box-shadow: var(--cgr-sombra);
}
.portal-icone {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: #dcebef;
    color: var(--cgr-petroleo);
}
.portal-icone-turquesa { background: #d8f0f5; color: #148ba8; }
.portal-icone svg, .portal-gerir-icone svg {
    width: 29px; height: 29px; fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.portal-cartao-texto { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 7px; }
.portal-cartao-texto strong { color: var(--cgr-petroleo); font-size: 1rem; font-weight: 700; }
.portal-cartao-texto small { color: #83a1aa; font-size: .79rem; line-height: 1.65; }
.portal-seta { color: var(--cgr-turquesa); font-size: 1.7rem; line-height: 1; }

.portal-gerir {
    margin-top: 18px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 17px;
    border-radius: 17px;
    background: var(--cgr-petroleo);
    color: white;
    box-shadow: 0 12px 26px rgb(11 53 68 / 12%);
}
.portal-gerir-icone {
    flex: 0 0 52px; width: 52px; height: 52px;
    display: grid; place-items: center;
    border-radius: 15px; color: white; background: rgb(255 255 255 / 12%);
}
.portal-gerir-texto { flex: 1; min-width: 0; }
.portal-gerir-texto h2 { margin: 0 0 5px; font-size: 1.02rem; font-weight: 700; }
.portal-gerir-texto p { margin: 0; color: #c1dbe2; font-size: .78rem; line-height: 1.65; }
.portal-botao {
    min-height: 46px; padding: 0 22px; display: inline-flex; align-items: center;
    justify-content: center; gap: 10px; flex-shrink: 0;
    border-radius: 999px; background: var(--cgr-turquesa);
    color: var(--cgr-petroleo); font-size: .8rem; font-weight: 700; text-decoration: none;
}
.portal-botao:hover { color: var(--cgr-petroleo); background: #66c9df; transform: translateY(-1px); }
.portal-nota { margin: 20px 0 0; color: #7c9da6; font-size: .69rem; line-height: 1.8; }
.portal-nota a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.portal-nota a:hover { color: var(--cgr-petroleo); }

.portal-imagem-bebe {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}
.portal-imagem-bebe::before {
    content: "";
    position: absolute;
    width: min(95%, 650px);
    aspect-ratio: 1.18;
    border-radius: 49% 51% 48% 52% / 48% 43% 57% 52%;
    background: rgb(255 255 255 / 88%);
}
.portal-imagem-bebe img {
    position: relative;
    display: block;
    width: min(100%, 760px);
    max-height: 490px;
    object-fit: contain;
    filter: drop-shadow(0 12px 14px rgb(11 53 68 / 5%));
}

/* Rodapé institucional — faixa compacta semelhante ao site CGR */
.cgr-rodape {
    position: relative;
    z-index: 2;
    width: calc(100% - 48px);
    max-width: 1600px;
    margin: 0 auto 22px;
    padding: 24px 28px 16px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 28px rgb(11 53 68 / 5%);
}

.cgr-rodape-interior {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) 190px;
    align-items: center;
    gap: 24px;
}

.cgr-rodape-marca {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.cgr-logo-rodape {
    display: block;
    width: 150px;
    max-width: 100%;
    height: auto;
}

.cgr-rodape-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.cgr-rodape-links a {
    color: #8daeb7;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    text-decoration: none;
}

.cgr-rodape-links a:hover { color: var(--cgr-petroleo); }
.cgr-rodape-ers { color: #8daeb7; font-size: .72rem; white-space: nowrap; }

.cgr-certificacoes {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
}

.cgr-certificacoes img {
    display: block;
    width: 175px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.cgr-rodape-final {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #edf2f3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 20px;
    color: #88a8b1;
    font-size: .7rem;
}

.cgr-desenvolvimento a {
    color: #6e929d;
    font-weight: 600;
    text-decoration: none;
}

.cgr-desenvolvimento a:hover {
    color: var(--cgr-petroleo);
    text-decoration: underline;
}

/* Tablets */
@media (max-width: 1050px) {
    .portal-conteudo {
        grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
        gap: 24px;
    }

    .portal-cartoes { grid-template-columns: 1fr; }
    .portal-cartao { min-height: 112px; }

    .cgr-rodape-interior {
        grid-template-columns: 140px minmax(0, 1fr);
        gap: 18px;
    }

    .cgr-certificacoes {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .cgr-certificacoes img { width: 160px; }
}

/* Telemóveis */
@media (max-width: 700px) {
    .cgr-cabecalho {
        border-radius: 0 0 24px 24px;
    }

    .cgr-cabecalho-interior {
        width: calc(100% - 32px);
        min-height: auto;
        padding: 16px 0 18px;
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .cgr-logo {
        width: 210px;
        max-height: 100px;
    }

    .cgr-navegacao {
        width: 100%;
        gap: 9px;
    }

    .cgr-navegacao a {
        flex: 1 1 auto;
        min-height: 42px;
        padding: 8px 10px;
        font-size: .72rem;
    }

    .portal-hero { padding: 35px 18px 38px; }
    .portal-fundo { background-position: 62% center; }
    .portal-conteudo { display: flex; flex-direction: column; gap: 22px; }
    .portal-coluna { order: 1; padding: 0; }
    .portal-imagem-bebe { order: 0; width: 100%; min-height: 210px; }
    .portal-imagem-bebe::before { width: 75%; }
    .portal-imagem-bebe img { max-height: 240px; width: 90%; }
    .portal-coluna h1 { font-size: clamp(2rem, 9vw, 2.8rem); }
    .portal-introducao { font-size: .9rem; margin-bottom: 22px; }
    .portal-cartoes { grid-template-columns: 1fr; gap: 12px; }
    .portal-cartao { min-height: 105px; padding: 17px; }
    .portal-gerir { padding: 18px; flex-wrap: wrap; gap: 13px; }
    .portal-gerir-icone { width: 46px; height: 46px; flex-basis: 46px; }
    .portal-gerir-texto { flex: 1; min-width: calc(100% - 65px); }
    .portal-botao { width: 100%; }
    .portal-nota { font-size: .68rem; }

    .cgr-rodape {
        width: calc(100% - 28px);
        margin-bottom: 14px;
        padding: 22px 20px 16px;
        border-radius: 18px;
    }

    .cgr-rodape-interior {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .cgr-logo-rodape { width: 145px; }
    .cgr-rodape-links {
        justify-content: flex-start;
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .cgr-rodape-links a { font-size: .66rem; }
    .cgr-certificacoes { justify-content: flex-start; }
    .cgr-certificacoes img { width: 160px; }
    .cgr-rodape-final { flex-direction: column; align-items: flex-start; font-size: .68rem; }
}
/* Uniformizar o título "Sexo" com os restantes rótulos do modal */
#modalIdentificacao fieldset legend.form-label {
    float: none;
    width: auto;
    margin-bottom: 0.5rem;
    font-family: "Poppins", Arial, sans-serif;
    font-size: 1rem !important;
    font-weight: 400;
    line-height: 1.5;
    color: var(--cgr-texto);
}
/* Rótulos do formulário de identificação */
#modalIdentificacao .form-label,
#modalIdentificacao fieldset legend.form-label {
    font-family: "Poppins", Arial, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--cgr-petroleo);
}

/* O título "Sexo" deve ter o mesmo tamanho dos restantes rótulos */
#modalIdentificacao fieldset legend.form-label {
    float: none;
    width: auto;
    margin-bottom: 0.5rem;
}


/* Gráficos circulares do dashboard */
.dashboard-donut {
    --percentagem: 0%;
    width: 142px;
    height: 142px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient( #D97757 0 var(--percentagem), #35AFC7 var(--percentagem) 100% );
}

.dashboard-donut-centro {
    width: 102px;
    height: 102px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .dashboard-donut-centro strong {
        font-size: 1.65rem;
        line-height: 1.2;
        color: #0B3544;
    }

    .dashboard-donut-centro span {
        font-size: 0.75rem;
        color: #6c757d;
    }

.dashboard-legenda {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    margin-right: 5px;
}

.dashboard-legenda-ativas {
    background: #35AFC7;
}

.dashboard-legenda-canceladas {
    background: #D97757;
}

.app-version {
    position: fixed;
    right: 10px;
    bottom: 6px;
    font-size: 10px;
    color: #888;
    opacity: 0.75;
    z-index: 1000;
    pointer-events: none;
}