/* ==========================================================================
   Fiel Web 14 — telas de entrada (código da igreja e login)
   Cores do design system (azul #2563eb, cinzas). Diretrizes Apple: luz suave no
   fundo, cartão em material translúcido, um só foco (logo + cartão no centro),
   tipografia com hierarquia, entrada suave e balanço quando a senha está errada.
   ========================================================================== */

.acesso { min-height: 100vh; margin: 0; font-size: .875rem; color: #111827; background: #f3f5f9; }

/* Fundo: cinza claro + grade fina que some nas bordas + três luzes que se movem bem devagar.
   Tudo fixo atrás da página (aria-hidden), só transform/opacity (leve para o navegador).
   Quem pediu "reduzir movimento" vê as luzes paradas. */
.acesso-fundo { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.acesso-fundo::before { content: ""; position: absolute; inset: 0; z-index: 2;
  background-image: linear-gradient(rgba(15,23,42,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(15,23,42,.07) 1px, transparent 1px);
  background-size: 48px 48px; background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 25%, transparent 80%); mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 25%, transparent 80%); }
/* Brilho atrás do cartão: destaca o centro */
.acesso-fundo::after { content: ""; position: absolute; left: 50%; top: 50%; width: 760px; height: 760px; transform: translate(-50%, -50%); z-index: 1;
  background: radial-gradient(circle, rgba(59,130,246,.22) 0%, rgba(59,130,246,.08) 35%, rgba(59,130,246,0) 65%); }
.acesso-orbe { position: absolute; border-radius: 50%; will-change: transform; }
.acesso-orbe.o1 { width: 70vmax; height: 70vmax; top: -30vmax; left: -22vmax; background: radial-gradient(circle, rgba(37,99,235,.42) 0%, rgba(37,99,235,.14) 38%, rgba(37,99,235,0) 66%); animation: acessoOrbe1 24s ease-in-out infinite alternate; }
.acesso-orbe.o2 { width: 68vmax; height: 68vmax; bottom: -34vmax; right: -24vmax; background: radial-gradient(circle, rgba(14,165,233,.40) 0%, rgba(14,165,233,.13) 38%, rgba(14,165,233,0) 66%); animation: acessoOrbe2 28s ease-in-out infinite alternate; }
.acesso-orbe.o3 { width: 44vmax; height: 44vmax; top: 18%; left: 58%; background: radial-gradient(circle, rgba(99,102,241,.30) 0%, rgba(99,102,241,.10) 40%, rgba(99,102,241,0) 66%); animation: acessoOrbe3 30s ease-in-out infinite alternate; }
.acesso-orbe.o4 { width: 40vmax; height: 40vmax; top: 52%; left: -8vmax; background: radial-gradient(circle, rgba(45,212,191,.26) 0%, rgba(45,212,191,.08) 40%, rgba(45,212,191,0) 66%); animation: acessoOrbe4 22s ease-in-out infinite alternate; }
@keyframes acessoOrbe1 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(22vmax, 14vmax, 0) scale(1.15); } }
@keyframes acessoOrbe2 { from { transform: translate3d(0,0,0) scale(1.1); } to { transform: translate3d(-20vmax, -16vmax, 0) scale(.92); } }
@keyframes acessoOrbe3 { from { transform: translate3d(0,0,0) scale(.9); opacity: .7; } to { transform: translate3d(-34vmax, 12vmax, 0) scale(1.1); opacity: 1; } }
@keyframes acessoOrbe4 { from { transform: translate3d(0,0,0); opacity: .6; } to { transform: translate3d(26vmax, -18vmax, 0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .acesso-orbe { animation: none !important; } }
/* Sem z-index de propósito: com ele, as janelas (modais) que ficam aqui dentro ficavam presas
   abaixo do escurecimento do Bootstrap e não dava para clicar nem fechar. */
.acesso-pagina { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; padding: 1rem; }

/* Topo e rodapé */
.acesso-topo, .acesso-rodape {
  width: 100%; max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .25rem .25rem;
}
.acesso-topo { justify-content: flex-end; }
.acesso-logo { display: block; height: 64px; width: auto; margin: 0 auto .75rem; }
.acesso-link { display: inline-flex; align-items: center; gap: .35rem; color: #4b5563; font-size: .8rem; font-weight: 500; text-decoration: none; background: none; border: 0; padding: .25rem .35rem; border-radius: .4rem; cursor: pointer; }
.acesso-link:hover { color: #1d4ed8; }
.acesso-campo-cab .acesso-link, .acesso-igreja .acesso-link { color: #2563eb; font-weight: 600; }
.acesso-campo-cab .acesso-link:hover, .acesso-igreja .acesso-link:hover { color: #1d4ed8; text-decoration: underline; }
.acesso-link i { font-size: 1rem; }
.acesso-rodape { font-size: .78rem; color: #6b7280; }
.acesso-rodape nav { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Coluna central */
.acesso-centro { width: 100%; max-width: 420px; margin: auto; display: flex; flex-direction: column; gap: 1.1rem; animation: acessoEntra .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes acessoEntra { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.acesso-cartao.balanca { animation: acessoBalanca .42s cubic-bezier(.36,.07,.19,.97); }
@keyframes acessoBalanca { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }

/* Etapas */
.acesso-etapas { display: flex; align-items: center; gap: .6rem; padding: 0 .25rem; }
.acesso-etapa { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 600; color: #6b7280; white-space: nowrap; }
.acesso-etapa .num { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; background: #e5e7eb; color: #4b5563; }
.acesso-etapa.atual { color: #111827; }
.acesso-etapa.atual .num { background: #2563eb; color: #fff; }
.acesso-etapa.feita .num { background: #dbeafe; color: #1d4ed8; }
.acesso-etapas .linha { flex: 1; height: 1px; background: #d1d5db; }
.acesso-etapas .linha.feita { background: #2563eb; }

/* Cartão */
.acesso-cartao {
  background: rgba(255,255,255,.86); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(209,213,219,.9); border-radius: 1.35rem; padding: 2rem; display: flex; flex-direction: column; gap: 1.35rem;
  box-shadow: 0 1px 1px rgba(15,23,42,.04), 0 2px 6px rgba(15,23,42,.04), 0 30px 60px -30px rgba(30,64,175,.35);
}
.acesso-titulo { font-size: 1.85rem; font-weight: 700; letter-spacing: -.03em; color: #0f172a; margin: 0; line-height: 1.1; }
.acesso-sub { color: #64748b; margin: .45rem 0 0; font-size: .92rem; line-height: 1.5; }

/* Igreja escolhida (login) e acessos recentes (código) */
.acesso-igreja { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .8rem; border: 1px solid #d1d5db; border-radius: .9rem; background: #f8fafc; }
.acesso-igreja-info { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.acesso-sigla { width: 38px; height: 38px; border-radius: .6rem; background: #2563eb; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex: 0 0 auto; text-transform: uppercase; }
.acesso-igreja-nome { font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acesso-igreja-cod { font-size: .75rem; color: #6b7280; }
.acesso-igreja-cod b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #111827; font-weight: 600; }
.acesso-rotulo-grupo { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; margin-bottom: .45rem; display: block; }
.acesso-recentes { display: flex; flex-direction: column; gap: .5rem; }
.acesso-recente { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; text-align: left; padding: .75rem .85rem; border: 1px solid #d1d5db; border-radius: .9rem; background: #fff; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .1s ease; }
.acesso-recente:hover { border-color: #93c5fd; background: #eff6ff; }
.acesso-recente:active { transform: scale(.99); }
.acesso-recente .seta { color: #9ca3af; font-size: 1.15rem; transition: color .15s ease, transform .15s ease; }
.acesso-recente:hover .seta { color: #2563eb; transform: translateX(2px); }
.acesso-esquecer { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #d1d5db; background: #fff; color: #6b7280; display: none; align-items: center; justify-content: center; font-size: .75rem; cursor: pointer; padding: 0; }
.acesso-recente-wrap { position: relative; }
.acesso-recente-wrap:hover .acesso-esquecer, .acesso-esquecer:focus-visible { display: inline-flex; }
@media (hover: none) { .acesso-esquecer { display: inline-flex; } }

.acesso-ou { display: flex; align-items: center; gap: .75rem; color: #6b7280; font-size: .75rem; }
.acesso-ou::before, .acesso-ou::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }

/* Campos */
.acesso-form { display: flex; flex-direction: column; gap: 1rem; }
.acesso-campo { display: flex; flex-direction: column; gap: .35rem; }
.acesso-campo-cab { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.acesso-campo label, .acesso-campo .rotulo { font-size: .8rem; font-weight: 600; color: #374151; margin: 0; }
.acesso-entrada { position: relative; display: flex; align-items: center; }
.acesso-entrada > i { position: absolute; left: .8rem; font-size: 1.1rem; color: #6b7280; pointer-events: none; z-index: 2; }
.acesso-entrada input, .acesso-entrada select {
  width: 100%; height: 50px; border: 1px solid #d1d5db; border-radius: .8rem; background: #f8fafc; padding: 0 .9rem 0 2.6rem; font-size: .95rem; color: #0f172a;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; appearance: none; -webkit-appearance: none;
}
.acesso-entrada input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.acesso-entrada input:focus, .acesso-entrada select:focus { outline: none; background: #fff; border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.14); }
.acesso-entrada input::placeholder { color: #9ca3af; font-family: inherit; letter-spacing: 0; }
.acesso-entrada .olho { position: absolute; right: .45rem; width: 36px; height: 36px; border: 0; background: none; color: #6b7280; border-radius: .45rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.1rem; }
.acesso-entrada .olho:hover { color: #111827; background: #f3f4f6; }
.acesso-entrada.com-olho input { padding-right: 2.9rem; }
.acesso-ajuda { font-size: .75rem; color: #6b7280; }
.acesso-erro { display: none; align-items: flex-start; gap: .3rem; font-size: .78rem; color: #dc2626; }
.acesso-campo.invalido .acesso-erro { display: flex; }
.acesso-campo.invalido input, .acesso-campo.invalido select, .acesso-campo.invalido .select2-selection { border-color: #dc2626 !important; }
.acesso-alerta { display: none; gap: .5rem; align-items: flex-start; padding: .7rem .8rem; border-radius: .6rem; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: .82rem; line-height: 1.4; }
.acesso-alerta.mostra { display: flex; }
.acesso-alerta i { font-size: 1rem; margin-top: .05rem; }
.acesso-alerta.ok { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* Select2 da filial com a mesma cara dos campos */
.acesso-entrada .select2-container { width: 100% !important; }
.acesso-entrada .select2-container--default .select2-selection--single { height: 50px !important; border: 1px solid #d1d5db !important; border-radius: .8rem !important; background: #f8fafc !important; padding: 0 !important; }
.acesso-entrada .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 48px !important; padding-left: 2.6rem !important; padding-right: 2rem !important; color: #111827; font-size: .9rem; }
.acesso-entrada .select2-container--default .select2-selection--single .select2-selection__arrow { height: 48px !important; right: .5rem; }
.acesso-entrada .select2-container--focus .select2-selection--single, .acesso-entrada .select2-container--open .select2-selection--single { border-color: #2563eb !important; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* Botões (modelo aprovado: largura total, ícone + texto) */
.acesso-btn { width: 100%; height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: .8rem; font-size: .95rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s ease, border-color .15s ease, transform .1s ease, opacity .15s ease; }
.acesso-btn:active { transform: scale(.98); }
.acesso-btn i { font-size: 1.15rem; }
.acesso-btn-primario { background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%); border: 1px solid #2563eb; color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 20px -10px rgba(37,99,235,.7); }
.acesso-btn-primario:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.acesso-btn-secundario { background: #fff; border: 1px solid #d1d5db; color: #111827; }
.acesso-btn-secundario:hover { background: #f9fafb; }
.acesso-btn-secundario i { color: #2563eb; }
.acesso-btn:disabled { opacity: .65; cursor: default; transform: none; }
.acesso-btn:focus-visible, .acesso-recente:focus-visible, .acesso-link:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.acesso-girando { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: acessoGira .7s linear infinite; }
@keyframes acessoGira { to { transform: rotate(360deg); } }

/* Selos de confiança (só o que é verdade) */
.acesso-selos { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; font-size: .75rem; color: #6b7280; }
.acesso-selos i { color: #15803d; }
.acesso-selos span { display: inline-flex; align-items: center; gap: .3rem; }

/* Janelas (esqueci a senha, privacidade) */
.acesso-modal .modal-content { border: 1px solid #d1d5db; border-radius: 1rem; }
.acesso-modal .modal-header { border-bottom: 1px solid #e5e7eb; padding: 1rem 1.25rem; }
.acesso-modal .modal-title { font-size: 1.05rem; font-weight: 600; color: #111827; display: flex; align-items: center; gap: .5rem; }
.acesso-modal .modal-title i { color: #2563eb; }
.acesso-modal .modal-body { padding: 1.25rem; color: #374151; line-height: 1.55; }
.acesso-modal .modal-footer { border-top: 1px solid #e5e7eb; padding: .85rem 1.25rem; gap: .5rem; }
.acesso-modal .modal-footer .acesso-btn { width: auto; height: 42px; padding: 0 1.1rem; }
/* Esqueci a senha: uma etapa por vez (pedido → codigo → pronto) */
.esqueci-etapa { display: none; }
#modalEsqueci[data-etapa="pedido"] .esqueci-etapa[data-mostra="pedido"],
#modalEsqueci[data-etapa="codigo"] .esqueci-etapa[data-mostra="codigo"] { display: flex; flex-direction: column; gap: .9rem; }
.esqueci-etapa p { margin: 0 !important; }
#modalEsqueci .acesso-alerta.mostra { margin-top: .9rem; }
#modalEsqueci[data-etapa="pronto"] #esqueciOk.mostra { margin-top: 0; }
#codigoEsqueci { letter-spacing: .35em; font-size: 1.15rem; }
.acesso-dica { font-size: .78rem; color: #6b7280; }
.acesso-campo.invalido .acesso-dica { display: none; }
.acesso-politica h6 { font-size: .9rem; font-weight: 600; color: #111827; margin: 1rem 0 .35rem; }
.acesso-politica p, .acesso-politica li { font-size: .84rem; }
.acesso-politica ul { padding-left: 1.1rem; margin-bottom: .5rem; }

@media (max-width: 575.98px) {
  .acesso-pagina { padding: .75rem; }
  .acesso-cartao { padding: 1.25rem; }
  .acesso-titulo { font-size: 1.35rem; }
  .acesso-topo .rotulo-longo { display: none; }
  .acesso-etapa .texto { font-size: .72rem; }
}
@media (prefers-reduced-motion: reduce) {
  .acesso-btn, .acesso-recente, .acesso-recente .seta { transition: none; }
  .acesso-btn:active, .acesso-recente:active { transform: none; }
  .acesso-centro, .acesso-cartao.balanca { animation: none; }
}

/* ==========================================================================
   Sem rolagem: a página ocupa exatamente a altura da janela e vai ficando
   mais compacta conforme a altura diminui (espaços, campos, textos de apoio).
   ========================================================================== */
.acesso-pagina { height: 100vh; height: 100dvh; min-height: 0; padding: .75rem 1rem; gap: .5rem; }
.acesso-topo, .acesso-rodape { flex: 0 0 auto; }
.acesso-rodape { flex-wrap: nowrap; }
.acesso-rodape-info { display: inline-flex; align-items: center; gap: .75rem; white-space: nowrap; }
.acesso-protegida { display: inline-flex; align-items: center; gap: .25rem; color: #6b7280; }
.acesso-protegida i { color: #15803d; }
.acesso-centro { flex: 0 1 auto; margin: auto; }

@media (max-height: 860px) {
  .acesso-logo { height: 56px; margin-bottom: .5rem; }
  .acesso-centro { gap: .8rem; }
  .acesso-cartao { padding: 1.5rem; gap: 1rem; }
  .acesso-titulo { font-size: 1.6rem; }
  .acesso-sub { margin-top: .3rem; font-size: .875rem; }
  .acesso-form { gap: .8rem; }
  .acesso-entrada input, .acesso-entrada select { height: 46px; }
  .acesso-entrada .select2-container--default .select2-selection--single { height: 46px !important; }
  .acesso-entrada .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 44px !important; }
  .acesso-entrada .select2-container--default .select2-selection--single .select2-selection__arrow { height: 44px !important; }
  .acesso-btn { height: 46px; }
  .acesso-recente { padding: .55rem .75rem; }
  .acesso-igreja { padding: .5rem .7rem; }
  .acesso-sigla { width: 34px; height: 34px; border-radius: .55rem; }
}
@media (max-height: 760px) {
  .acesso-pagina { padding: .5rem 1rem; }
  .acesso-logo { height: 46px; margin-bottom: .25rem; }
  .acesso-centro { gap: .6rem; }
  .acesso-cartao { padding: 1.2rem 1.35rem; gap: .8rem; border-radius: 1.1rem; }
  .acesso-titulo { font-size: 1.4rem; }
  .acesso-sub, .acesso-ajuda { display: none; }   /* repetem o óbvio; o rótulo do campo já diz */
  .acesso-form { gap: .65rem; }
  .acesso-campo { gap: .25rem; }
  .acesso-entrada input, .acesso-entrada select { height: 42px; }
  .acesso-entrada .select2-container--default .select2-selection--single { height: 42px !important; }
  .acesso-entrada .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 40px !important; }
  .acesso-entrada .select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px !important; }
  .acesso-btn { height: 44px; }
  .acesso-rotulo-grupo { margin-bottom: .3rem; }
  .acesso-recentes { gap: .4rem; }
  .acesso-recente { padding: .45rem .7rem; }
  .acesso-alerta { padding: .5rem .7rem; }
}
@media (max-height: 680px) {
  .acesso-logo { height: 40px; }
  .acesso-etapa .num { width: 20px; height: 20px; }
  .acesso-cartao { padding: 1rem 1.1rem; gap: .7rem; }
  .acesso-titulo { font-size: 1.25rem; }
  .acesso-recentes .acesso-recente-wrap:nth-child(n+3) { display: none; }   /* só os 2 mais recentes */
  .acesso-igreja-cod { font-size: .7rem; }
}
@media (max-width: 575.98px) {
  .acesso-pagina { padding: .5rem .75rem; }
  .acesso-rodape { font-size: .72rem; }
  .acesso-rodape-info { gap: .5rem; }
}

/* ==========================================================================
   Versão enxuta: logo, um título curto, campos com rótulo e um botão.
   Sem etapas, subtítulos, dicas nem ícones dentro dos campos.
   ========================================================================== */
.acesso-cartao { gap: 1.25rem; }
.acesso-titulo { font-size: 1.75rem; letter-spacing: -.03em; }
.acesso-entrada input, .acesso-entrada select { padding-left: .95rem; }
.acesso-entrada .select2-container--default .select2-selection--single .select2-selection__rendered { padding-left: .95rem !important; }
.acesso-entrada input.mono { font-size: 1.05rem; letter-spacing: .2em; }
.acesso-separador { height: 1px; background: #e5e7eb; margin-top: 1rem; }
/* Igreja escolhida: uma linha simples acima do título */
.acesso-igreja { border: 0; background: none; padding: 0; margin-bottom: -.35rem; }
.acesso-igreja .acesso-sigla { width: 28px; height: 28px; border-radius: .5rem; font-size: .7rem; }
.acesso-igreja-nome { font-size: .85rem; font-weight: 500; color: #475569; }
@media (max-height: 760px) { .acesso-titulo { font-size: 1.45rem; } .acesso-cartao { gap: .95rem; } }
@media (max-height: 680px) { .acesso-titulo { font-size: 1.3rem; } }
