/* ── Entrada e boas-vindas no padrão dos sistemas Safety ─────────────────────────
   Seis fotos (banco Magnific) se alternam devagar sob um véu vinho com a marca d'água
   da Safety; à direita, o formulário. Tudo cabe na tela, sem barra de rolagem,
   no computador e no celular. */
:root { --ac-vinho: #6E1828; --ac-vinho-esc: #3B0A14; --ac-vermelho: #C3161C; }

/* assinatura (símbolo + logotipo) em imagem: funciona também abrindo o arquivo direto do computador */
.ac-sim { display: block; width: 46px; aspect-ratio: 256 / 185; }
.ac-pal { display: block; width: 108px; aspect-ratio: 512 / 164; }

#login { position: fixed; inset: 0; z-index: 200; display: grid; overflow: hidden;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); grid-template-rows: minmax(0, 1fr) auto;
  height: 100vh; height: 100dvh; background: var(--bg); font-family: var(--font); color: var(--text); }

/* ── lado da arte: fotos + véu + marca d'água + áreas ── */
.login-arte, #boas-vindas { background: var(--ac-vinho-esc); isolation: isolate; }
.login-arte { grid-row: 1; grid-column: 1; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 48px 48px; }
.capa-fotos { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.capa-foto { position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.06); filter: grayscale(.2) contrast(1.05);
  transition: opacity .8s ease, transform 2.4s ease-out; }
.capa-foto.ativa { opacity: 1; transform: scale(1); }
.capa-veu { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(59,10,20,.30) 0%, rgba(59,10,20,.06) 34%, rgba(59,10,20,.55) 70%, rgba(36,6,12,.92) 100%),
    linear-gradient(115deg, rgba(110,24,40,.55) 0%, rgba(110,24,40,.18) 55%, rgba(140,30,50,0) 100%); }
.capa-veu::after { content: ""; position: absolute; inset: 0; background: var(--ac-vinho); mix-blend-mode: color; opacity: .28; }
.marca-dagua { position: absolute; top: -14%; right: -22%; width: 118%; max-width: none; aspect-ratio: 256 / 185; opacity: .07; z-index: 0; pointer-events: none; user-select: none; }
.capa-areas { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; }
.capa-areas span { font-family: var(--font-title); font-weight: 500; font-size: clamp(24px, 2.7vw, 40px); line-height: 1.12;
  letter-spacing: .01em; color: #fff; text-transform: uppercase; }
.capa-areas span::before { content: ""; display: inline-block; width: 20px; height: 3px; margin-right: 11px; vertical-align: middle;
  background: var(--ac-vermelho); border-radius: 2px; transform: translateY(-3px); }

/* ── lado do formulário ── */
.login-lado { grid-row: 1; grid-column: 2; display: grid; place-items: center; padding: 16px 24px; min-width: 0; min-height: 0; overflow: hidden; background: var(--surface); }
.login-caixa { width: 100%; max-width: 348px; }
.login-marca { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 22px; }
.login-caixa h1 { font-family: var(--font-title); font-weight: 500; font-size: 26px; margin: 0; color: var(--heading); text-transform: none; letter-spacing: .01em; }
.login-sub { margin: 3px 0 16px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.login-campo { display: block; margin-bottom: 12px; }
.login-campo > span:first-child { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.login-campo input { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 10px 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--input-bg); color: var(--text); }
.login-campo input:focus { outline: 2px solid rgba(195,22,28,.35); outline-offset: 1px; border-color: var(--ac-vermelho); }
.so-campo { position: relative; display: block; }
.so-campo input { padding-right: 42px; }
.olho { position: absolute; top: 0; right: 0; height: 100%; width: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 0 8px 8px 0; }
.olho:hover { color: var(--text); } .olho[aria-pressed="true"] { color: var(--ac-vermelho); }
#login-btn { width: 100%; margin-top: 6px; padding: 11px 15px; border: 0; border-radius: 8px; background: var(--ac-vinho); color: #fff;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
#login-btn:hover { background: var(--ac-vermelho); } #login-btn:disabled { opacity: .6; cursor: wait; }
.login-link { display: block; margin: 10px auto 0; padding: 4px 6px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ac-vinho); cursor: pointer; border-radius: 6px; }
.login-link.discreto { font-weight: 500; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.login-link:hover { text-decoration: underline; }
.login-aviso { min-height: 17px; margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.login-aviso.ruim { color: var(--bad); font-weight: 600; } .login-aviso.bom { color: var(--ok); font-weight: 600; }
.login-lgpd { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 10px; line-height: 1.5; color: var(--muted); }
:root[data-theme="dark"] .login-link { color: #f08a8d; }

/* ── rodapé da marca (barra inferior) ── */
#login > .rodape { grid-row: 2; grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; margin: 0; padding: 10px 28px;
  background: var(--surface); border-top: 1px solid var(--border); }
.rodape-marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rodape .ac-sim { width: 24px; } .rodape .ac-pal { width: 68px; }
.rodape-sep { color: var(--muted); font-size: 12px; }
.rodape-tag { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.rodape-dir { margin: 0 0 0 auto; text-align: right; font-size: 10.5px; line-height: 1.4; color: var(--muted); white-space: nowrap; }
.rodape-dir b { font-weight: 700; color: var(--heading); }

/* janelas baixas no computador: o formulário encolhe por inteiro, sem rolagem */
@media (min-width: 761px) and (max-height: 660px) { .login-caixa { zoom: .9; } #login > .rodape { padding: 7px 28px; } }
@media (min-width: 761px) and (max-height: 590px) { .login-caixa { zoom: .8; } }
@media (min-width: 761px) and (max-height: 530px) { .login-caixa { zoom: .72; } .login-lgpd { display: none; } }

/* ── celular: arte em faixa no alto, formulário no meio, rodapé enxuto ── */
@media (max-width: 760px) {
  #login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .login-arte { grid-row: 1; grid-column: 1; height: clamp(108px, 22dvh, 190px); padding: calc(14px + env(safe-area-inset-top)) 20px 16px; align-items: flex-end; }
  .marca-dagua { top: -40%; right: -30%; width: 90%; }
  .capa-areas span { font-size: clamp(17px, 5.2vw, 24px); }
  .capa-areas span::before { width: 14px; margin-right: 8px; }
  .login-lado { grid-row: 2; grid-column: 1; padding: 14px 22px; align-items: center; }
  .login-marca { flex-direction: row; align-items: center; gap: 10px; margin-bottom: 14px; }
  .login-marca .ac-sim { width: 38px; } .login-marca .ac-pal { width: 92px; }
  .login-caixa h1 { font-size: 23px; }
  .login-sub { margin-bottom: 12px; }
  .login-campo { margin-bottom: 10px; }
  .login-campo input { font-size: 16px; padding: 10px 11px; } /* 16px evita o zoom automático do iPhone */
  #login-btn { padding: 12px 15px; font-size: 15px; }
  #login > .rodape { grid-row: 3; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); gap: 10px; }
  .rodape-tag, .rodape-sep, .rodape .ac-pal { display: none; }
  .rodape-dir { white-space: normal; font-size: 10px; }
}
@media (max-width: 760px) and (max-height: 720px) { .login-lgpd { display: none; } .login-sub { display: none; } .login-marca { margin-bottom: 10px; } }
@media (max-width: 760px) and (max-height: 600px) { .login-arte { height: 96px; } .capa-areas { flex-direction: row; flex-wrap: wrap; gap: 0 12px; } .login-caixa { zoom: .9; } }

/* ── Boas-vindas depois de entrar: fotos em movimento, nome, data e versículo do dia ── */
#boas-vindas { position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center; overflow: hidden;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); text-align: center; color: #fff; font-family: var(--font); }
#boas-vindas .marca-dagua { position: absolute; top: -18%; right: -16%; width: 70%; }
#boas-vindas.saindo { animation: bv-sair .42s ease forwards; }
@keyframes bv-sair { to { opacity: 0; transform: scale(1.02); } }
.bv-palco { position: relative; z-index: 1; max-width: 560px; width: 100%; max-height: 100%; }
.bv-marca { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: clamp(12px, 3vh, 24px); }
.bv-simbolo { width: clamp(64px, 11vh, 92px); aspect-ratio: 256 / 185; opacity: 0; animation: bv-simbolo .9s cubic-bezier(.17,.84,.44,1) .15s forwards; }
.bv-logotipo { width: clamp(128px, 22vh, 184px); aspect-ratio: 512 / 164; opacity: 0; transform: translateY(10px); animation: bv-sobe .7s cubic-bezier(.17,.84,.44,1) .62s forwards; }
@keyframes bv-simbolo {
  0% { opacity: 0; transform: scale(.72) translateY(14px) rotate(-9deg); }
  60% { opacity: 1; transform: scale(1.06) translateY(0) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) translateY(0) rotate(0); }
}
@keyframes bv-sobe { to { opacity: 1; transform: translateY(0); } }
.bv-brilho { position: absolute; top: -18%; left: 50%; width: 260px; height: 260px; margin-left: -130px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.18) 0%, transparent 68%); opacity: 0; transform: scale(.4); animation: bv-brilho 1.5s ease-out .1s forwards; }
@keyframes bv-brilho { 40% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.5); } }
.bv-olho, .bv-t, .bv-s, .bv-botao, .bv-vers { opacity: 0; animation: bv-sobe .6s ease forwards; }
.bv-olho { animation-delay: .9s; } .bv-t { animation-delay: 1.02s; } .bv-s { animation-delay: 1.14s; } .bv-vers { animation-delay: 1.3s; } .bv-botao { animation-delay: 1.5s; }
.bv-olho { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.bv-t { font-family: var(--font-title); font-weight: 500; font-size: clamp(28px, 5.4vh, 40px); line-height: 1.12; margin: 0; color: #fff; overflow-wrap: anywhere; text-transform: none; }
#bv-nome { color: #f6b3b8; }
.bv-s { margin: 10px 0 0; font-size: 13.5px; color: rgba(255,255,255,.8); line-height: 1.6; }
.bv-vers { margin: clamp(16px, 3.5vh, 30px) auto 0; padding: clamp(14px, 2.6vh, 22px) 0 0; max-width: 480px; border-top: 1px solid rgba(255,255,255,.24); }
.bv-vers-texto { margin: 0; font-family: var(--font-title); font-weight: 400; font-size: clamp(15px, 2.5vh, 19px); line-height: 1.5; color: #fff; }
.bv-vers-texto::before { content: "\201C"; } .bv-vers-texto::after { content: "\201D"; }
.bv-vers-ref { margin-top: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.bv-botao { margin-top: clamp(16px, 3.5vh, 30px); padding: 13px 34px; font: inherit; font-size: 14px; font-weight: 600; transform: translateY(10px); border: 0; border-radius: 8px; cursor: pointer;
  background: #fff; color: var(--ac-vinho); box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.bv-botao:hover { background: #fbe9eb; }
@media (max-width: 560px) {
  .bv-t { font-size: 27px; } .bv-botao { width: 100%; } .bv-vers-texto { font-size: 15.5px; }
  #boas-vindas .marca-dagua { width: 120%; top: -8%; right: -40%; }
}
@media (max-height: 560px) { .bv-vers-texto { font-size: 14px; line-height: 1.4; } .bv-s { margin-top: 4px; } }

@media (prefers-reduced-motion: reduce) {
  .capa-foto { transition: opacity .8s ease; transform: none; }
  .bv-simbolo, .bv-logotipo, .bv-olho, .bv-t, .bv-s, .bv-botao, .bv-vers { animation: none; opacity: 1; transform: none; }
  .bv-brilho { display: none; } #boas-vindas.saindo { animation: none; }
}
