/**
 * Portal Cajamar — identidade cromática (brasão)
 * Cores :root em style.css | Carregar após style.css
 */

html {
    height: 100%;
    box-sizing: border-box;
    font-family: 'Titillium Web', sans-serif;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body.body-portal {
    position: relative;
    margin: 0;
    padding-bottom: 6rem;
    min-height: 100%;
    font-family: 'Titillium Web', sans-serif;
    color: var(--prad-texto);
    background: linear-gradient(180deg, var(--prad-branco) 0%, rgba(167, 169, 172, 0.18) 100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.w3-hide {
    display: none !important;
}

.w3-show-block,
.w3-show {
    display: block !important;
}

.w3-show-inline-block {
    display: inline-block !important;
}

@media (max-width: 1205px) {
    .w3-auto {
        max-width: 95%;
    }
}

@media (max-width: 600px) {
    .w3-modal-content {
        margin: 0 10px;
        width: auto !important;
    }
    .w3-modal {
        padding-top: 30px;
    }
    .w3-dropdown-hover.w3-mobile .w3-dropdown-content,
    .w3-dropdown-click.w3-mobile .w3-dropdown-content {
        position: relative;
    }
    .w3-hide-small {
        display: none !important;
    }
    .w3-mobile {
        display: block;
        width: 100% !important;
    }
    .w3-bar-item.w3-mobile,
    .w3-dropdown-hover.w3-mobile,
    .w3-dropdown-click.w3-mobile {
        text-align: center;
    }
    .w3-dropdown-hover.w3-mobile,
    .w3-dropdown-hover.w3-mobile .w3-btn,
    .w3-dropdown-hover.w3-mobile .w3-button,
    .w3-dropdown-click.w3-mobile,
    .w3-dropdown-click.w3-mobile .w3-btn,
    .w3-dropdown-click.w3-mobile .w3-button {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .w3-modal-content {
        width: 500px;
    }
    .w3-modal {
        padding-top: 50px;
    }
}

@media (min-width: 1301px) {
    .w3-modal-content {
        width: 900px;
    }
    .w3-hide-large {
        display: none !important;
    }
    .w3-sidebar.w3-collapse {
        display: block !important;
    }
}

@media (max-width: 1300px) and (min-width: 601px) {
    .w3-hide-medium {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .w3-sidebar.w3-collapse {
        display: none;
    }
    .w3-main {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .w3-auto {
        max-width: 100%;
    }
}

/* Overlay de loading (estilo Golden Mix) */
#loading {
    display: none;
    background-color: rgba(0, 0, 0, 0.7);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#loading .loader-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding-top: 0;
}

#loading .loaderMenu {
    border: 5px solid rgba(0, 0, 0, 0);
    border-radius: 50%;
    border-top: 5px solid var(--prad-azul);
    width: 100px;
    height: 100px;
    margin: auto;
    -webkit-animation: spin-portal 1s linear infinite;
    animation: spin-portal 1s linear infinite;
}

#loading .loader,
.loader-inline {
    border: 3px solid rgba(0, 0, 0, 0);
    border-radius: 50%;
    border-top: 3px solid var(--prad-azul);
    width: 40px;
    height: 40px;
    -webkit-animation: spin-portal 1s linear infinite;
    animation: spin-portal 1s linear infinite;
}

.loaderMenu {
    margin: auto;
    border: 5px solid rgba(0, 0, 0, 0);
    border-radius: 50%;
    border-top: 5px solid var(--prad-azul);
    width: 100px;
    height: 100px;
    -webkit-animation: spin-portal 1s linear infinite;
    animation: spin-portal 1s linear infinite;
}

@-webkit-keyframes spin-portal {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin-portal {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.divTransitionHome {
    -webkit-animation: fadeEffect 2s;
    animation: fadeEffect 2s;
}

.divTransition {
    display: none;
    -webkit-animation: fadeEffect 2s;
    animation: fadeEffect 2s;
}

@-webkit-keyframes fadeEffect {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeEffect {
    from { opacity: 0; }
    to { opacity: 1; }
}

.box-select {
    cursor: pointer;
    width: 120px;
    height: 120px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    transition: 0.25s ease;
    background-color: var(--prad-branco);
    background-image: linear-gradient(180deg, var(--prad-branco) 0%, #f0f0f0 100%);
    border: 1px solid var(--prad-cinza);
    padding-top: 25px;
    font: inherit;
    text-align: center;
}

button.box-select {
    appearance: none;
    -webkit-appearance: none;
}

a.box-select {
    text-decoration: none !important;
    color: inherit;
    display: inline-block;
    vertical-align: top;
    text-align: center;
}

a.box-select:hover,
a.box-select:focus {
    text-decoration: none !important;
    color: inherit;
}

.box-select-inativo {
    cursor: default;
    width: 120px;
    height: 120px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    transition: 0.25s ease;
    background-color: rgba(209, 211, 212, 0.4);
    background-image: none;
    border: 1px solid var(--prad-cinza);
    padding-top: 25px;
}

.box-select .img2,
.box-select-inativo .img2 {
    display: none;
}

.box-select:hover {
    background-color: var(--prad-ouro);
    background-image: linear-gradient(145deg, var(--prad-ouro) 0%, var(--prad-ouro-escuro) 100%);
    color: var(--prad-branco);
    box-shadow: 0 6px 20px rgba(0, 119, 200, 0.28);
    border-color: var(--prad-ouro-escuro);
    transition: 0.25s ease;
}

.box-select:hover .img1 {
    display: none;
}

.box-select:hover .img2 {
    display: block;
}

.box-select p,
.box-select-inativo p {
    position: relative;
    z-index: 3;
    font-size: 14px;
    margin: 8px 0 0 0;
    color: var(--prad-preto);
    padding: 0 4px;
}

.box-select:hover p {
    color: var(--prad-branco);
}

.box-select i.mdi,
.box-select-inativo i.mdi,
.box-select .prad-mdi-2x,
.box-select-inativo .prad-mdi-2x {
    color: var(--prad-azul);
    position: relative;
    z-index: 3;
    font-size: 2.25em;
    line-height: 1;
}

.box-select:hover i.mdi,
.box-select:hover .prad-mdi-2x {
    color: var(--prad-branco);
}

.box-select-inativo i.mdi,
.box-select-inativo .prad-mdi-2x,
.box-select-inativo p {
    color: var(--prad-texto-suave);
}

body.body-portal ::-webkit-scrollbar {
    display: none;
}

.inativo {
    opacity: 0.5;
}

/* Login: botão e formulário (Golden Mix) */
#acessarAreaInterna#acessarAreaInterna,
form#acessarAreaInterna {
    max-width: 100%;
}

#acessarAreaInterna #sendLogin {
    width: 100%;
    height: 40px;
    font-size: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background-color: var(--prad-vermelho) !important;
    border-color: var(--prad-vermelho) !important;
    border: none !important;
    font-weight: bold;
    color: var(--prad-branco) !important;
    border-radius: 8px;
    margin-top: 8px;
}

#acessarAreaInterna #sendLogin:hover {
    background-color: var(--prad-vermelho-escuro) !important;
    border-color: var(--prad-vermelho-escuro) !important;
}

.login-form-portal {
    width: 35%;
    min-width: 280px;
    max-width: 480px;
    margin: 0 auto;
}

@media (max-width: 1093px) {
    .login-form-portal {
        width: 45%;
    }
    .divTransitionHome-login {
        margin-top: 40px;
    }
}

@media (max-width: 911px) {
    .login-form-portal {
        width: 60%;
    }
}

@media (max-width: 683px) {
    .login-form-portal {
        width: 80%;
        margin-bottom: 100px;
    }
}

@media (max-width: 455px) {
    .login-form-portal {
        width: 100%;
    }
}

.titulo-portal-home {
    color: var(--prad-preto);
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin: 0;
    padding: 0;
    letter-spacing: 0.02em;
}

.subtitulo-portal-home {
    color: var(--prad-texto-suave);
    font-size: 23px;
    text-align: center;
    margin: 0;
    padding: 0;
}

.titulo-portal-sec {
    color: var(--prad-preto);
    font-size: 20px;
    text-align: center;
    margin: 0 0 8px 0;
}

/* Home: tabela e botão alinhados ao CTA do tema */
body.body-portal .main,
body.body-portal .divTransitionHome.main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 1rem;
}

body.body-portal .btnNegociar {
    background-color: var(--prad-vermelho);
    border: none;
    color: var(--prad-branco);
    border-radius: 8px;
    padding: 8px 24px;
    font-weight: bold;
    cursor: pointer;
}

body.body-portal .btnNegociar:hover {
    background-color: var(--prad-vermelho-escuro);
    color: var(--prad-branco);
}

/* Modal de negociação acima do conteúdo da página */
body.body-portal .modal {
    z-index: 10050;
}

body.body-portal .tbAcordos {
    background: var(--prad-branco);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--prad-cinza);
}

body.body-portal .tbAcordos thead th {
    background: rgba(0, 119, 200, 0.18);
    color: var(--prad-preto);
    border-color: var(--prad-cinza);
    font-weight: 700;
}

body.body-portal .tbAcordos.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(209, 211, 212, 0.2);
    color: var(--prad-texto);
}

body.body-portal .form-control:focus {
    border-color: var(--prad-azul);
    box-shadow: 0 0 0 0.2rem rgba(0, 174, 239, 0.2);
    outline: none;
}

body.body-portal footer a,
body.body-portal .acesso-texto a {
    color: var(--prad-azul);
}

/* Navegação: full width (inclui cabeçalho fora do .container) */
body.body-portal .prad-nav-top {
    width: 100%;
    max-width: 100%;
}

/* Cabeçalho: logo à esquerda, título/subtítulo centralizados na largura do ecrã */
body.body-portal .prad-header-shell {
    position: relative;
    width: 100%;
    min-height: 5rem;
    padding: 0.9rem 0.75rem;
    box-sizing: border-box;
    display: block;
}

body.body-portal .prad-header-logo {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

body.body-portal .prad-header-logo img {
    width: auto;
    max-width: 88px;
    max-height: 96px;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    display: block;
}

body.body-portal .prad-header-titles {
    width: 100%;
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
    margin: 0;
    padding: 0.4rem 6rem 0.4rem 6rem;
}

body.body-portal .prad-header-titles .navbar-prad-titulo {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    color: var(--prad-preto, #000);
}

body.body-portal .prad-header-titles .navbar-prad-subtitulo {
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--prad-texto-suave, #2d2d2d);
    margin: 0.2rem 0 0 0;
}

body.body-portal .prad-header-titles .navbar-prad-subtitulo strong {
    font-weight: 700;
}

@media (min-width: 768px) {
    body.body-portal .prad-header-titles .navbar-prad-titulo {
        font-size: 1.55rem;
    }
    body.body-portal .prad-header-titles .navbar-prad-subtitulo {
        font-size: 1.05rem;
    }
}

/* Área interna: alças para logo (esq.) e Sair (dir.) com o texto centrado */
body.body-portal .prad-header-titles--interno {
    padding: 0.4rem 6.5rem 0.4rem 5.5rem;
}

body.body-portal .prad-header-sair {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

/* Títulos da área interna: tamanhos ligeiramente menores que o menu público */
body.body-portal .prad-header-titles--interno .navbar-prad-titulo,
body.body-portal .prad-header-shell--interno .navbar-prad-titulo {
    font-size: 1.2rem;
    line-height: 1.2;
    margin: 0;
    font-weight: 700;
    color: var(--prad-preto, #000);
}

body.body-portal .prad-header-titles--interno .navbar-prad-subtitulo,
body.body-portal .prad-header-shell--interno .navbar-prad-subtitulo {
    font-size: 0.9rem;
    line-height: 1.3;
    margin: 0.15rem 0 0 0;
    color: var(--prad-texto-suave, #2d2d2d);
}

body.body-portal .prad-header-titles--interno .navbar-prad-subtitulo strong,
body.body-portal .prad-header-shell--interno .navbar-prad-subtitulo strong {
    font-weight: 700;
}

@media (min-width: 768px) {
    body.body-portal .prad-header-titles--interno .navbar-prad-titulo,
    body.body-portal .prad-header-shell--interno .navbar-prad-titulo {
        font-size: 1.4rem;
    }
}

@media (max-width: 576px) {
    body.body-portal .prad-header-titles {
        padding-left: 4.25rem;
        padding-right: 4.25rem;
    }
    body.body-portal .prad-header-titles--interno {
        padding: 0.4rem 3.6rem 0.4rem 3.4rem;
    }
    body.body-portal .prad-header-logo img {
        max-width: 64px;
        max-height: 80px;
    }
}

/* Navegação: faixa inferior (azul heráldico) */
body.body-portal .navbar {
    background: var(--prad-branco);
    border-bottom: 4px solid var(--prad-ouro);
    padding: 0.5rem 0 10px 0;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Rodapé: brasão com “borda moeda” (arredondado, não círculo) — borda prata do escudo */
body.body-portal .prad-footer-crest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 3px;
    border: 2px solid var(--caj-prata);
    border-radius: 18px;
    background: linear-gradient(160deg, #ffffff 0%, #f0f0f0 50%, #e8e8e8 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05),
        0 1px 4px rgba(0, 0, 0, 0.1);
}

body.body-portal .prad-footer-crest img {
    display: block;
    width: 36px;
    height: 40px;
    object-fit: contain;
    border-radius: 12px;
}

body.body-portal .prad-footer-copy {
    max-width: 20rem;
    line-height: 1.45;
}

body.body-portal .prad-header-sair .divLogout p,
body.body-portal .prad-header-sair p {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0 4px 2px 4px;
    cursor: pointer;
    transition: 0.2s;
}

body.body-portal .divLogout p {
    color: var(--prad-vermelho) !important;
    font-weight: 600;
}

body.body-portal .divLogout p:hover {
    color: var(--prad-vermelho-escuro) !important;
    border-bottom-color: var(--prad-ouro) !important;
}

/* Rodapé */
body.body-portal footer#footer {
    color: var(--prad-texto-suave);
    background: transparent;
}

body.body-portal footer#footer p {
    color: var(--prad-texto-suave);
}

body.body-portal hr {
    border-color: var(--prad-cinza);
    opacity: 1;
}

/* Títulos da página no cabeçalho: espaço do conteúdo abaixo da faixa dourada */
body.body-portal .divTransitionHome-conteudo {
    padding-top: 0.5rem;
}

body.body-portal .divTransitionHome-login {
    padding-top: 1.25rem;
}

/* Integração: avisos API / modo demo (ver Docs/portal-cajamar/DOC_integracao_WOMM_API_v2.MD) */
.cajamar-dev-banner {
    max-width: 1200px;
    margin: 0 auto 1rem;
    padding: 0.75rem 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    font-size: 0.9rem;
}
.cajamar-api-err {
    max-width: 1200px;
    margin: 0 auto 1rem;
    padding: 0.6rem 1rem;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    font-size: 0.9rem;
}
.cajamar-api-ok {
    padding: 0.6rem 0.75rem;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    color: #155724;
    font-size: 0.9rem;
}

.cajamar-modal-negocia-wide {
    max-width: 520px;
    width: 95%;
}

.caj-checkout-aviso {
    color: var(--prad-texto-suave, #2d2d2d);
    line-height: 1.4;
    margin: 0 0 0.75rem 0;
}

.caj-checkout-secure {
    border: 1px solid var(--prad-cinza, #d1d1d1);
    border-radius: 10px;
    padding: 0.75rem 0.85rem 1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(180deg, #fafbfd 0%, #fff 40%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.caj-checkout-secure__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.6rem;
    font-weight: 600;
    color: var(--prad-preto, #000);
    margin: 0;
    font-size: 0.98rem;
}

.caj-checkout-badge {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 600;
}

.caj-checkout-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.caj-checkout-op {
    flex: 1 1 120px;
    min-width: 100px;
    max-width: 150px;
    margin: 0;
    cursor: pointer;
    position: relative;
}

.caj-checkout-op input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.caj-checkout-op__vis {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 3.2rem;
    border: 2px solid var(--prad-cinza, #d1d1d1);
    border-radius: 8px;
    background: #fff;
    color: var(--prad-texto, #2d2d2d);
    font-weight: 600;
    padding: 0.45rem 0.3rem 0.35rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    gap: 0.1rem;
}

.caj-checkout-op__vis i.mdi {
    font-size: 1.6rem;
    line-height: 1;
    color: var(--prad-azul, #0077c8);
}

.caj-checkout-op input:focus + .caj-checkout-op__vis {
    outline: 2px solid var(--prad-azul, #00aeef);
    outline-offset: 2px;
}

.caj-checkout-op input:checked + .caj-checkout-op__vis {
    border-color: #198754;
    background: #f0fff4;
    box-shadow: 0 0 0 1px rgba(25, 135, 84, 0.2);
}

.caj-checkout-ledger {
    color: #6c757d;
    margin: 0;
}

#loading[aria-hidden="true"] {
    display: none !important;
}
