/* Reutilizar as cores, tipografia e botões existentes na plataforma. */
.assoc-module { min-height: 100vh; }
.assoc-brand { color: var(--b-text-color-primary); font-size: 18px; font-weight: 600; }
.assoc-brand small { font-size: 13px; font-weight: 400; }
.assoc-module .card { border: 1px solid #e4e7eb; }
.assoc-module .form-control, .assoc-module .form-select { min-height: 40px; }
.assoc-module textarea.form-control { min-height: 160px; }
.assoc-cartaz { max-height: 420px; object-fit: contain; }
.assoc-descricao { overflow-wrap: anywhere; }
.assoc-descricao img { max-width: 100%; height: auto; }
#agenda-entidades .fc-toolbar { flex-wrap: wrap; gap: 12px; }
#agenda-entidades .fc-button-primary { background: var(--b-bg-color-primary); border-color: var(--b-bg-color-primary); }
@media (max-width: 575px) {
    #agenda-entidades .fc-toolbar-chunk { width: 100%; text-align: center; }
}


/* Separar o estado da ação, como nas tabelas com uma única ação. */
.tables-conteudos #dt-aprovacoes-entidades td:last-child {
    border-left: 1px solid var(--b-border-color-lightgrey);
}

#filtro-aprovacoes > .col, .assoc-filtros > .col { min-width: 0; }
#filtro-aprovacoes .btn, .assoc-filtros .btn { white-space: nowrap; }
#filtro-aprovacoes .bootstrap-select > .dropdown-toggle, .assoc-filtros .form-select { height: 40px; }

#dt-aprovacoes-entidades_wrapper .dataTables_length label,
#dt-aprovacoes-entidades_wrapper .dataTables_filter label { white-space: nowrap; margin-bottom: 0; }
#dt-aprovacoes-entidades_wrapper .dataTables_filter input { width: 170px; }

.switch-aprovacao { width: 125px; }
.switch-aprovacao.switch-flat .switch-input:checked ~ .switch-handle { left: 97px; }

.assoc-authentication-bg { background-image: url("../img/defaults/auth/bg-associacoes-futebol.jpg"); }
#filtro-aprovacoes .input-group > .bootstrap-select { flex: 1 1 auto; width: 1% !important; min-width: 0; }
#filtro-aprovacoes .input-group:has(> #limpar-aprovacoes:not([hidden])) > .bootstrap-select > .dropdown-toggle { border-top-right-radius: 0; border-bottom-right-radius: 0; }
#filtro-aprovacoes .input-group:has(> #limpar-aprovacoes[hidden]) > .bootstrap-select > .dropdown-toggle { border-radius: 4px; }
#filtro-aprovacoes #limpar-aprovacoes { height: 40px; border: 1px solid var(--b-border-color-grey); }

@media (max-width: 767px) {
    #agenda-calendario .fc-header-toolbar { flex-wrap: wrap; gap: 12px; }
    #agenda-calendario .fc-toolbar-chunk { width: 100%; display: flex; justify-content: center; }
    #agenda-calendario .fc-toolbar-title { font-size: 20px; }
}

.assoc-auth-title { font-size: 18px; line-height: 1.4; white-space: nowrap; }
@media (max-width: 575px) {
    .assoc-auth-title { font-size: clamp(12px, 3.8vw, 18px); }
}

#agenda-separadores .btn-tab:not(.active) { color: var(--b-text-color-darkgrey) !important; }

/* Cores de aprovação no calendário do backoffice. */
#agenda-calendario .agenda-aprovado {
    --fc-event-bg-color: #d1e7dd;
    --fc-event-border-color: #a3cfbb;
    --fc-event-text-color: #0f5132;
}
#agenda-calendario .agenda-nao-aprovado {
    --fc-event-bg-color: #f8d7da;
    --fc-event-border-color: #f1aeb5;
    --fc-event-text-color: #842029;
}
#agenda-calendario .agenda-aprovado,
#agenda-calendario .agenda-nao-aprovado {
    color: var(--fc-event-text-color) !important;
    background-color: var(--fc-event-bg-color) !important;
    border-color: var(--fc-event-border-color) !important;
}
#agenda-calendario .agenda-aprovado .fc-event-main,
#agenda-calendario .agenda-nao-aprovado .fc-event-main,
#agenda-calendario .agenda-aprovado .agenda-event-content,
#agenda-calendario .agenda-nao-aprovado .agenda-event-content,
#agenda-calendario .fc-list-event.agenda-aprovado a,
#agenda-calendario .fc-list-event.agenda-nao-aprovado a {
    color: var(--fc-event-text-color) !important;
}
#agenda-calendario .fc-list-event.agenda-aprovado > td,
#agenda-calendario .fc-list-event.agenda-nao-aprovado > td {
    background-color: var(--fc-event-bg-color);
    color: var(--fc-event-text-color);
}

/* Os eventos da Junta e das entidades abrem os respetivos detalhes. */
#agenda-calendario .fc-event.agenda-aprovado,
#agenda-calendario .fc-event.agenda-nao-aprovado {
    cursor: pointer;
}

.card-body.agenda-calendario-ativo { min-height: 0; }

.content-page.agenda-pagina-calendario { min-height: 0; }

.assoc-module { display: flex; flex-direction: column; padding-bottom: 0; }
.assoc-module > #main-content { flex: 1 0 auto; }
.assoc-topbar { position: relative; z-index: 1020; }
.assoc-module .footer { position: static; left: 0; flex-shrink: 0; }
#assoc-agenda-separadores .btn-tab:not(.active) { color: var(--b-text-color-darkgrey) !important; }
.assoc-filtro-eventos > .bootstrap-select { flex: 1 1 auto; width: 1% !important; min-width: 0; }
.assoc-filtro-eventos .dropdown-toggle, #assoc-limpar-filtro { height: 40px; }
.assoc-filtro-eventos:has(> #assoc-limpar-filtro:not([hidden])) > .bootstrap-select > .dropdown-toggle { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.assoc-filtro-eventos:has(> #assoc-limpar-filtro[hidden]) > .bootstrap-select > .dropdown-toggle { border-radius: 4px; }
#assoc-limpar-filtro { border: 1px solid var(--b-border-color-grey); }
#dt-eventos-entidade td:last-child { border-left: 1px solid var(--b-border-color-lightgrey); }

/* Cabeçalho das entidades com o aspeto do cabeçalho do website. */
.assoc-topbar { height: 95px; min-height: 95px; padding: 0; flex-shrink: 0; background: var(--b-bg-color-white); border-bottom: 5px solid var(--b-border-color-primary); }
.assoc-topbar > .container-fluid { padding-left: 40px; padding-right: 40px; }
.assoc-topbar .assoc-logo-box { width: 210px; height: 90px; line-height: 90px; }
.assoc-topbar .assoc-logo-box img { height: 90px; }
.assoc-topbar .assoc-topbar-titulo { min-width: 0; }
.assoc-topbar .assoc-brand { color: var(--b-text-color-primary); font-size: 18px; font-weight: 400; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assoc-topbar .assoc-topbar-titulo small { color: var(--b-text-color-primary); font-size: 12px; }
@media (max-width: 767px) {
    .assoc-topbar { height: 80px; min-height: 80px; }
    .assoc-topbar > .container-fluid { padding-left: 12px; padding-right: 12px; }
    .assoc-topbar .assoc-logo-box { width: 60px; height: 75px; line-height: 75px; }
    .assoc-topbar .assoc-logo-box img { height: 60px; }
    .assoc-topbar .assoc-brand { font-size: 14px; }
    .assoc-topbar .assoc-topbar-titulo small { font-size: 11px; }
}

/* O cabeçalho reaparece ao descer a página, como no website da Junta. */
.assoc-topbar-space { height: 95px; flex-shrink: 0; }
.assoc-topbar.assoc-fixed-header { position: fixed; top: 0; left: 0; right: 0; box-shadow: 0 0 15px rgba(0,0,0,.10); animation: assoc-header-descer 320ms cubic-bezier(.22, .61, .36, 1) backwards; }
@keyframes assoc-header-descer { from { opacity: 0; transform: translate3d(0, -100%, 0); } to { opacity: 1; transform: none; } }
@media (max-width: 767px) { .assoc-topbar-space { height: 80px; } }
@media (prefers-reduced-motion: reduce) { .assoc-topbar.assoc-fixed-header { animation: none; } }

.assoc-filtro-eventos { width: 280px; max-width: 100%; }

.assoc-acoes-evento { width: 1%; min-width: 136px; white-space: nowrap; }
.agenda-legenda { color: var(--b-text-color-darkgrey); font-size: 12px; }
.agenda-legenda > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.agenda-legenda-cor { display: inline-block; width: 16px; height: 16px; border-radius: 3px; }
.agenda-legenda-ativo { background-color: #d1e7dd; border: 1px solid #a3cfbb; }
.agenda-legenda-oculto { background-color: #f8d7da; border: 1px solid #f1aeb5; }

.agenda-estado { display: inline-block; width: 125px; min-width: 125px; text-align: center; font-size: 12px; padding: 5px 10px; border: 1px solid; border-radius: 3px; white-space: nowrap; }
.agenda-estado-ativo { background-color: #d1e7dd; border-color: #a3cfbb; color: #0f5132; }
.agenda-estado-oculto { background-color: #f8d7da; border-color: #f1aeb5; color: #842029; }




/* Espaço para os dois rótulos de publicação sem sobrepor o indicador. */
.switch-publicacao { width: 125px; }
.switch-publicacao.switch-flat .switch-input:checked ~ .switch-handle { left: 97px; }

/* Contador dos pedidos que aguardam resposta da entidade. */
.assoc-contador-notificacoes { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #dc3545; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

.assoc-module > .loader-box { inset: 0; }

/* A validação do textarea deve marcar a caixa visível do TinyMCE. */
.tinyarea textarea.error ~ .tox-tinymce,
.tinyarea textarea.is-invalid ~ .tox-tinymce {
    border-color: var(--b-border-color-danger) !important;
}

/* Conversação de ticket: pedidos à esquerda e respostas à direita. */
.agenda-interacao:last-child { margin-bottom: 0 !important; }
.agenda-interacao-junta .agenda-interacao-caixa { border-left: 3px solid var(--b-border-color-primary) !important; }
.agenda-interacao-entidade .agenda-interacao-caixa { border-right: 3px solid #198754 !important; }
.agenda-interacao-junta .agenda-interacao-cabecalho { background-color: #eff6fa !important; }
.agenda-interacao-entidade .agenda-interacao-cabecalho { background-color: #eef7f2 !important; }
.agenda-interacao .assoc-descricao > :last-child { margin-bottom: 0; }

.assoc-cartaz-detalhe { max-height: 320px; }

/* Uma linha cronológica liga os cartões, mantendo os dois lados da conversa. */
.agenda-conversacao-lista { position: relative; padding-left: 40px !important; }
.agenda-conversacao-lista::before { content: ''; position: absolute; left: 22px; top: 16px; bottom: 16px; width: 2px; background: var(--b-border-color-lightgrey); }
.agenda-interacao { position: relative; }
.agenda-interacao::before { content: ''; position: absolute; z-index: 2; left: -22px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--b-bg-color-primary); }
.agenda-interacao-entidade::before { background: #198754; }
.agenda-interacao::after { content: ''; position: absolute; left: -18px; top: 21px; width: 18px; border-top: 1px solid var(--b-border-color-lightgrey); }
.agenda-interacao.justify-content-end::after { width: calc(16.666667% + 18px); }
.agenda-interacao-caixa { position: relative; z-index: 1; background: var(--b-bg-color-white); }
@media (max-width: 767px) { .agenda-interacao.justify-content-end::after { width: calc(8.333333% + 18px); } }

.caixa-notificacoes-agenda { width: 420px; max-width: calc(100vw - 24px); }
.lista-notificacoes-agenda { max-height: min(440px, calc(100vh - 180px)); overflow-y: auto; }
.lista-notificacoes-agenda article:last-child { margin-bottom: 0 !important; }

/* A lupa aparece sobre o cartaz, com o mesmo acesso por teclado. */
.assoc-cartaz-ampliar { position: relative; overflow: hidden; cursor: zoom-in; }
.assoc-cartaz-lupa { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(0, 0, 0, .3); font-size: 28px; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.assoc-cartaz-ampliar:hover .assoc-cartaz-lupa,
.assoc-cartaz-ampliar:focus-visible .assoc-cartaz-lupa { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .assoc-cartaz-lupa { transition: none; } }

.navbar-custom .topnav-menu:has(.agenda-sino-junta) { display: flex; align-items: center; gap: 10px; height: 70px; margin: 0; }
.navbar-custom .topnav-menu:has(.agenda-sino-junta) > li { float: none; display: flex; align-items: center; height: auto; margin: 0; padding: 0; }
.navbar-custom .topnav-menu:has(.agenda-sino-junta) .btn-dt-actions,
.navbar-custom .topnav-menu:has(.agenda-sino-junta) .btn-fullscreen { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; }
.navbar-custom .topnav-menu:has(.agenda-sino-junta) .nav-user { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 !important; line-height: normal; }
.navbar-custom .topnav-menu:has(.agenda-sino-junta) .nav-user img { display: block; width: 40px; height: 40px; }

.form-conversa-agenda .bootstrap-select, .form-pedido-agenda .bootstrap-select { width: 25% !important; min-width: 200px; max-width: 100%; }
@media (max-width: 575px) { .form-conversa-agenda .bootstrap-select, .form-pedido-agenda .bootstrap-select { width: 100% !important; min-width: 0; } }

/* Notificações compactas junto ao sino. */
.lista-notificacoes-agenda { font-size: 12px; line-height: 1.5; padding: 12px !important; }
.lista-notificacoes-agenda > .text-muted { font-size: 11px; margin-bottom: 10px; }
.lista-notificacoes-agenda article { padding: 12px !important; margin-bottom: 10px !important; }
.lista-notificacoes-agenda h3 { font-size: 12px; line-height: 1.4; }
.lista-notificacoes-agenda small { font-size: 10px; }
.lista-notificacoes-agenda .assoc-descricao { margin-bottom: 10px !important; }
.lista-notificacoes-agenda .assoc-descricao p { font-size: inherit; margin-bottom: 6px; }
.lista-notificacoes-agenda .btn { padding: 5px 10px; font-size: 11px; line-height: 1.5; letter-spacing: .3px; min-height: 0; }

/* Aviso de sobreposição: destaque suave, sem fazer o texto desaparecer. */
.agenda-aviso-sobreposicao { animation: agenda-aviso-pulsar 3s ease-in-out infinite; }
.agenda-aviso-icone { color: #b45309; animation: agenda-icone-pulsar 3s ease-in-out infinite; }
@keyframes agenda-aviso-pulsar { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); } 50% { box-shadow: 0 0 0 4px rgba(255, 193, 7, .16); } }
@keyframes agenda-icone-pulsar { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .agenda-aviso-sobreposicao, .agenda-aviso-icone { animation: none; } }

/* Manter o sino visível ao passar o rato sobre o cabeçalho azul. */
.assoc-notificacoes .abrir-notificacoes-agenda:hover,
.assoc-notificacoes .abrir-notificacoes-agenda:active,
.assoc-notificacoes .abrir-notificacoes-agenda:focus-visible,
.assoc-notificacoes .abrir-notificacoes-agenda[aria-expanded="true"] { background-color: #f1f3f5 !important; border-color: #d1d5db !important; color: #6c757d !important; }

.assoc-filtro-estado { width: 280px; max-width: 100%; }

/* A conclusão da conversa tem um fundo cinzento mais visível. */
.estado-conversa-agenda[data-concluida="1"] { --bs-btn-color: #212529; --bs-btn-bg: #dee2e6; --bs-btn-border-color: #dee2e6; --bs-btn-hover-color: #212529; --bs-btn-hover-bg: #ced4da; --bs-btn-hover-border-color: #ced4da; --bs-btn-active-color: #212529; --bs-btn-active-bg: #c6ccd2; --bs-btn-active-border-color: #c6ccd2; --bs-btn-disabled-color: #212529; --bs-btn-disabled-bg: #dee2e6; --bs-btn-disabled-border-color: #dee2e6; }

.conversa-botao-acao { display: inline-flex; align-items: center; justify-content: center; width: 225px; max-width: 100%; height: 42px; }

.conversa-estado-concluida { color: #212529; font-size: 14px; line-height: 1.2; font-weight: 400; }

/* Entrada comum: duas opções com a mesma hierarquia e dimensão. */
.acesso-container { display: flex; align-items: center; justify-content: center; }
.acesso-painel { width: 100%; max-width: 900px; padding: 36px; background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .2); }
.acesso-cabecalho { margin-bottom: 32px; }
.acesso-cartao { margin-bottom: 0; border: 1px solid #dce1e5; border-radius: 10px; box-shadow: none; }
.acesso-cartao .card-body { padding: 28px 24px; }
.acesso-icone { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: #edf5f8; color: var(--b-bg-color-primary, #08628a); font-size: 26px; }
.acesso-cartao h2 { min-height: 58px; display: flex; align-items: center; justify-content: center; }
.acesso-cartao .btn { min-height: 46px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 767.98px) {
    .acesso-painel { padding: 28px 20px; }
    .acesso-cartao h2 { min-height: 0; }
    .acesso-cartao .card-body { padding: 24px 20px; }
}

/* Espaço para a informação de autorização numa só linha no computador. */
.assoc-auth-recovery-column { max-width: 700px; }
.assoc-auth-notice { white-space: nowrap; }
@media (max-width: 767.98px) {
    .assoc-auth-notice { white-space: normal; }
}


#perfil-gerar-password { background-color: #dedfe1; border-color: #d3d5d7; color: #212529; }
#perfil-gerar-password:hover, #perfil-gerar-password:focus-visible { background-color: #cfd2d5; border-color: #c4c8cb; color: #212529; }
