*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; font-family: "Segoe UI", system-ui, sans-serif; }

.bg {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  z-index: 0;
}
.bg-cell {
  background-size: cover; background-position: center;
  animation: kenburns 20s ease-in-out infinite alternate;
  filter: brightness(.55) saturate(1.1);
}
.bg-cell:nth-child(1)  { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2021/06/15145129/home.jpg'); animation-delay: 0s; }
.bg-cell:nth-child(2)  { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2019/04/30163026/Campo-Grande-e1562878167161.jpg'); animation-delay: -3s; }
.bg-cell:nth-child(3)  { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2022/03/09151823/cg2fachada-scaled.jpg'); animation-delay: -6s; }
.bg-cell:nth-child(4)  { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2019/07/11123612/BANGU-1-as-Smart-Object-1-copy.jpg'); animation-delay: -9s; }
.bg-cell:nth-child(5)  { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2020/10/19144653/del_castilho.jpg'); animation-delay: -2s; }
.bg-cell:nth-child(6)  { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2019/04/30162346/jpa-e1562878253339.jpg'); animation-delay: -5s; }
.bg-cell:nth-child(7)  { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2020/10/19144328/Recepcao-Del-Castilho.jpg'); animation-delay: -8s; }
.bg-cell:nth-child(8)  { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2024/04/05115830/madureira.jpg'); animation-delay: -11s; }
.bg-cell:nth-child(9)  { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2022/03/09152145/cpnhofachada.jpg'); animation-delay: -4s; }
.bg-cell:nth-child(10) { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2020/02/21140942/nillopolis2102.jpg'); animation-delay: -7s; }
.bg-cell:nth-child(11) { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2019/07/11130213/REALENGO-1-as-Smart-Object-1-copy.jpg'); animation-delay: -1s; }
.bg-cell:nth-child(12) { background-image: url('https://camim-site.s3.sa-east-1.amazonaws.com/wp-content/uploads/2019/04/30162920/NI-e1562878495907.jpg'); animation-delay: -10s; }
@keyframes kenburns {
  0%   { transform: scale(1) translate(0,0); }
  100% { transform: scale(1.12) translate(-2%,-2%); }
}
.bg-overlay {
  position: fixed; inset: 0; z-index: 1;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(0,20,10,.45) 0%, rgba(0,10,5,.82) 100%);
}
.bg-grid {
  position: fixed; inset: 0; z-index: 2;
  background-image: linear-gradient(rgba(0,180,80,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(0,180,80,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridpulse 6s ease-in-out infinite;
}
@keyframes gridpulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
.scanline {
  position: fixed; left: 0; right: 0; height: 2px; z-index: 3;
  background: linear-gradient(90deg, transparent, rgba(0,220,100,.4), transparent);
  animation: scan 8s linear infinite;
}
@keyframes scan { 0% { top: -2px; opacity: 0; } 5% { opacity: 1; } 95% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

.stage {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; justify-content: safe center; padding: 24px;
  overflow-y: auto; /* segurança: nunca corta conteúdo em telas muito baixas */
}
.top-brand { text-align: center; margin-bottom: 32px; animation: fadeDown .8s ease both; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.logo-wrap { position: relative; display: inline-block; margin-bottom: 16px; }
.logo-wrap img {
  height: 80px; width: 80px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(0,200,80,.4);
  filter: drop-shadow(0 0 24px rgba(0,220,100,.5));
  animation: logopulse 3s ease-in-out infinite;
}
@keyframes logopulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(0,220,100,.4)); }
  50%       { filter: drop-shadow(0 0 36px rgba(0,220,100,.75)); }
}
.ring {
  position: absolute; top: 50%; left: 50%; border-radius: 50%;
  border: 1.5px solid rgba(0,200,80,.3);
  transform: translate(-50%,-50%) scale(0);
  animation: ringout 3s ease-out infinite;
  width: 80px; height: 80px;
}
.ring:nth-child(2) { animation-delay: 1s; }
.ring:nth-child(3) { animation-delay: 2s; }
@keyframes ringout { 0% { transform: translate(-50%,-50%) scale(.6); opacity: .8; } 100% { transform: translate(-50%,-50%) scale(2.4); opacity: 0; } }
.brand-name { font-size: 2.4rem; font-weight: 900; color: #fff; letter-spacing: .06em; text-shadow: 0 0 40px rgba(0,200,80,.4); }
.brand-slogan { font-size: .95rem; color: rgba(255,255,255,.55); letter-spacing: .12em; text-transform: uppercase; margin-top: 4px; }

.card {
  width: min(380px, 100%);
  background: rgba(5,20,10,.72); border: 1px solid rgba(0,200,80,.2);
  border-radius: 20px; padding: 36px 40px;
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(0,200,80,.08), 0 8px 40px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  animation: fadeUp .9s ease .2s both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.card-title { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
.card-sub   { font-size: .82rem; color: rgba(255,255,255,.35); margin-bottom: 20px; }

.alert-error {
  font-size: .83rem; padding: 9px 13px; border-radius: 8px; margin-bottom: 14px;
  background: rgba(220,50,50,.15); border: 1px solid rgba(220,80,80,.3); color: #ff8080;
  display: flex; align-items: center; gap: 8px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .72rem; font-weight: 700; color: rgba(0,220,100,.7); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 7px; }
.input-row { display: flex; align-items: center; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.input-row:focus-within { border-color: rgba(0,200,80,.6); box-shadow: 0 0 0 3px rgba(0,180,70,.15); }
.input-row .icon { width: 42px; display: flex; align-items: center; justify-content: center; color: rgba(0,200,80,.5); font-size: .9rem; flex-shrink: 0; }
.input-row input { flex: 1; background: transparent; border: none; outline: none; color: #fff; font-size: .95rem; padding: 12px 10px 12px 0; }
.input-row input::placeholder { color: rgba(255,255,255,.18); }
.toggle-pwd { background: none; border: none; cursor: pointer; padding: 0 13px; color: rgba(255,255,255,.25); font-size: .85rem; transition: color .2s; }
.toggle-pwd:hover { color: rgba(0,200,80,.7); }

.btn-login {
  width: 100%; padding: 13px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #00cc55 0%, #006633 100%);
  color: #fff; font-size: .97rem; font-weight: 800; letter-spacing: .05em; cursor: pointer;
  position: relative; overflow: hidden; margin-top: 6px;
  transition: transform .15s, box-shadow .2s; box-shadow: 0 4px 24px rgba(0,180,70,.4);
}
.btn-login:hover  { box-shadow: 0 6px 32px rgba(0,200,80,.55); transform: translateY(-1px); }
.btn-login:active { transform: scale(.98); }
.btn-login::after { content: ''; position: absolute; top: -50%; left: -75%; width: 50%; height: 200%; background: rgba(255,255,255,.18); transform: skewX(-20deg); animation: btnshine 4s ease-in-out infinite 1.5s; }
@keyframes btnshine { 0%, 100% { left: -75%; opacity: 0; } 45% { left: 130%; opacity: 1; } }

/* badge admin restrito */
.admin-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(220,150,0,.12); border: 1px solid rgba(220,170,0,.25);
  color: rgba(255,200,60,.8); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  padding: 4px 10px; border-radius: 20px; margin-bottom: 18px;
}

/* Telas baixas e largas o suficiente (muitos laptops / janelas com zoom):
   marca à esquerda + card à direita, para não estourar a altura e cortar o botão. */
@media (max-height: 820px) and (min-width: 760px) {
  .stage {
    flex-direction: row;
    align-items: center; justify-content: center;
    gap: clamp(32px, 6vw, 80px);
  }
  .top-brand { margin-bottom: 0; flex-shrink: 0; }
  .brand-name { font-size: 2rem; }
  .brand-slogan { font-size: .88rem; }
  .logo-wrap { margin-bottom: 12px; }
  .logo-wrap img { height: 64px; width: 64px; }
  .ring { width: 64px; height: 64px; }
}

/* Telas ainda mais baixas: encolhe o card para garantir folga vertical. */
@media (max-height: 640px) and (min-width: 760px) {
  .card { padding: 24px 30px; }
  .card-sub { margin-bottom: 14px; }
  .permissions { margin-bottom: 16px; }
  .permissions li { padding: 8px 16px; }
}

@media (max-width: 480px) {
  .bg { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(6, 1fr); }
  .brand-name { font-size: 1.8rem; }
  .card { padding: 28px 22px; }
}