:root {
    --header-height: 70px;
    --app-height: 100vh;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    background: #000;
}

body {
    color: #fff;
}

body.no-scroll {
    overflow: hidden;
    touch-action: none;
}

.hidden {
    display: none !important;
}

.login-section {
    background-image: url('assets/ceup.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

.secure-login-box {
    background: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 50px 40px;
    border-radius: 6px;
    text-align: center;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.auth-icon {
    font-size: 32px;
    color: #fff;
    margin-bottom: 20px;
    opacity: 0.8;
}

.secure-login-box h2 {
    font-weight: 300;
    letter-spacing: 6px;
    font-size: 20px;
    color: #fff;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.secure-login-box p {
    color: #888;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.secure-input-group {
    margin-bottom: 30px;
}

.secure-input-group input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 0;
    color: #fff;
    font-size: 24px;
    letter-spacing: 12px;
    text-align: center;
    font-family: monospace;
    outline: none;
    transition: 0.3s;
}

.secure-input-group input:focus {
    border-bottom-color: #fff;
}

.secure-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 15px;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    border-radius: 2px;
}

.secure-btn:hover {
    background: #ccc;
    transform: translateY(-2px);
}

.error-text {
    color: #ff4757 !important;
    font-size: 12px !important;
    letter-spacing: 1px !important;
    margin-top: 20px !important;
    margin-bottom: 0 !important;
    text-transform: uppercase;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: var(--header-height);
    width: 100%;
    background: rgba(0,0,0,0.95);
    border-bottom: 1px solid #222;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: transform 0.4s ease;
}

header.collapsed {
    transform: translateY(-100%);
}

.logo {
    height: 40px;
    display: flex;
    align-items: center;
}

.logo img {
    height: 100%;
    max-width: 250px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-btn {
    background: transparent;
    color: #888;
    border: none;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
}

.nav-btn:hover,
.active-btn {
    color: #fff;
    border-bottom: 1px solid #fff;
}

.add-color {
    background: #fff;
    color: #000;
    border-radius: 2px;
    font-weight: bold;
}

.add-color:hover {
    background: #ddd;
    border: none;
}

#toggle-header-btn {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 30px;
    background: rgba(0,0,0,0.9);
    border: 1px solid #222;
    border-top: none;
    border-radius: 0 0 15px 15px;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    font-size: 16px;
    backdrop-filter: blur(10px);
}

#toggle-header-btn:hover {
    color: #fff;
    background: rgba(20,20,20,1);
}

.page-view {
    display: none;
    padding-top: var(--header-height);
}

.page-view.active {
    display: block;
}

/* Fundo ativo para a apresentação (mostra nas extremidades) */
#presentation-page {
    background-image: url('assets/ceus.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: #111;
    transition: padding-top 0.4s ease;
}

#presentation-page.fullscreen-mode {
    padding-top: 0;
}

/* CONTAINER SCROLLÁVEL - CONFIGURADO COM GRID PARA SOBREPOR E ALINHAR NO FUNDO */
.long-presentation-container {
    position: relative;
    width: 100%;
    height: calc(var(--app-height) - var(--header-height));
    min-height: calc(var(--app-height) - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
    background: transparent; 
    scroll-behavior: smooth;
    display: grid;
    grid-template-columns: 1fr;
}

#presentation-page.fullscreen-mode .long-presentation-container {
    height: var(--app-height);
    min-height: var(--app-height);
}

.mobile-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: var(--app-height) !important;
    min-height: var(--app-height) !important;
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000 !important;
}

body.mobile-fullscreen-active #main-header,
body.mobile-fullscreen-active #toggle-header-btn {
    display: none !important;
}

#fullscreen-btn {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 85px);
    right: calc(env(safe-area-inset-right, 0px) + 20px);
    z-index: 50;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

#presentation-page.fullscreen-mode #fullscreen-btn {
    top: calc(env(safe-area-inset-top, 0px) + 15px);
}

#fullscreen-btn:hover {
    background: #fff;
    color: #000;
}

/* IMAGEM E CONTACTOS OCUPAM A MESMA CÉLULA DA GRID PARA SOBREPOSIÇÃO PERFEITA */
.long-presentation-img {
    grid-area: 1 / 1;
    align-self: start;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    max-width: 1920px;
}

/* CONTACTOS - COLADOS NA BASE DA GRID DA IMAGEM E FOSCO SOBRE A IMAGEM */
.contacts-footer {
    grid-area: 1 / 1;
    align-self: end;
    width: 100%;
    /* Fundo semi-transparente */
    background: rgba(15, 15, 15, 0.45); 
    /* Efeito de vidro / desfoque no que está por trás */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 60px 40px;
    z-index: 20;
}

.contacts-title-row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.contacts-main-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 5px;
    color: #ffffff;
    text-transform: uppercase;
    margin: 0;
    text-align: center;
}

.contacts-content-row {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(260px, 360px);
    justify-content: center;
    gap: 80px;
    align-items: start;
    max-width: 900px;
    margin: 0 auto;
}

.contact-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.left-column {
    text-align: left;
    align-items: flex-start;
}

.right-column {
    text-align: right;
    align-items: flex-end;
}

.contact-column p {
    font-size: 13px;
    letter-spacing: 1px;
    color: #ddd;
    margin-bottom: 10px;
    line-height: 1.5;
}

.contact-column strong {
    color: #fff;
    font-weight: 600;
}

.contact-link {
    color: #ddd;
    text-decoration: none;
    transition: 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.contact-link:hover {
    color: #fff;
    opacity: 1;
}

.contact-link i {
    color: #fff;
    font-size: 16px;
}

/* APOIOS / NEWS / BTS */
#news-page,
#bts-page,
#apoios-page {
    background-image: url('assets/ceus.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: #111;
    min-height: 100vh;
    min-height: 100dvh;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 50px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 15px;
}

/* APOIOS GRID */
.apoios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 36px 42px;
    align-items: center;
    justify-items: center;
    margin-top: 10px;
}

.apoio-card {
    width: 100%;
    min-height: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 12px;
    box-shadow: none;
    backdrop-filter: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Efeito Fosco (Halo) só no logo 1 */
.apoio-card.logo-soft {
    position: relative;
}

.apoio-card.logo-soft::before {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 90px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08); /* Fosco leve */
    filter: blur(22px);
    z-index: 0;
    pointer-events: none;
}

.apoio-card.logo-soft img {
    position: relative;
    z-index: 1;
}

.apoio-card:hover {
    transform: translateY(-4px) scale(1.03);
}

.apoio-card img {
    max-width: 100%;
    max-height: 110px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.95;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.apoio-card:hover img {
    opacity: 1;
    transform: scale(1.04);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
}

.news-card {
    background: rgba(10,10,10,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: 0.4s;
}

.news-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.img-container {
    height: 220px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: 0.4s;
}

.img-container.no-img::after {
    content: 'IMAGEM NÃO DISPONÍVEL';
    font-size: 11px;
    letter-spacing: 2px;
    color: #555;
}

.news-card:hover .img-container img {
    opacity: 1;
    transform: scale(1.05);
}

.card-content {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content h4 {
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.card-content p {
    color: #888;
    font-size: 14px;
    margin-bottom: 25px;
    flex: 1;
    line-height: 1.6;
}

.card-content a {
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid #fff;
    align-self: flex-start;
    padding-bottom: 3px;
    margin-bottom: 15px;
}

.delete-btn {
    background: transparent;
    color: #ff4757;
    border: 1px solid #ff4757;
    padding: 8px 15px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    align-self: flex-start;
    transition: 0.3s;
}

.delete-btn:hover {
    background: #ff4757;
    color: #fff;
}

.modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.modal-content {
    background: #0a0a0a;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #555;
    transition: 0.3s;
}

.close-btn:hover {
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #888;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    outline: none;
    transition: 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
}

.save-btn {
    width: 100%;
    padding: 15px;
    background: #fff;
    color: #000;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 10px;
    transition: 0.3s;
}

.save-btn:hover {
    background: #ccc;
}

@media (max-width: 768px) {
    :root {
        --header-height: 110px;
    }

    .secure-login-box {
        padding: 30px 20px;
    }

    .secure-login-box h2 {
        font-size: 16px;
        letter-spacing: 4px;
    }

    .secure-input-group input {
        font-size: 20px;
        letter-spacing: 6px;
    }

    header {
        flex-direction: column;
        justify-content: center;
        gap: 15px;
        padding: 10px;
    }

    .logo {
        height: 35px;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    #fullscreen-btn {
        top: calc(env(safe-area-inset-top, 0px) + 120px);
        right: calc(env(safe-area-inset-right, 0px) + 15px);
    }

    .contacts-footer {
        padding: 40px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
    }

    .contacts-title-row {
        margin-bottom: 18px;
    }

    .contacts-main-title {
        font-size: 13px;
        letter-spacing: 4px;
    }

    .contacts-content-row {
        grid-template-columns: 1fr;
        justify-content: center;
        gap: 20px;
    }

    .left-column,
    .right-column {
        text-align: center;
        align-items: center;
    }

    .contact-column p {
        font-size: 11px;
    }

    .page-container {
        padding: 30px 15px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 30px;
    }

    .apoios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px 20px;
    }

    .apoio-card {
        min-height: 100px;
        padding: 4px;
    }

    .apoio-card img {
        max-height: 72px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }

    .card-content {
        padding: 20px;
    }

    .card-content h4 {
        font-size: 16px;
    }

    .modal-content {
        padding: 25px 20px;
    }

    .close-btn {
        top: 10px;
        right: 15px;
    }
}