/* === Anti White Flash: fallback warna gelap sejak awal === */
html, body{
  height: 100%;
  background-color: #0f1b3d;           /* warna gelap senada bg */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fullscreen background untuk halaman auth */
.auth-page{
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background-color: rgba(14,46,120,.35); /* fallback saat gambar belum siap */
  opacity: 0;                            /* siap untuk fade-in */
  animation: authFadeIn .22s ease-out .05s forwards;
}

/* Background & overlay di BELAKANG dan tidak menutup klik */
.auth-page::before,
.auth-page::after{
  content: ""; position: absolute; inset: 0;
  z-index: 0;                 /* di bawah konten */
  pointer-events: none;       /* jangan blok interaksi */
}

/* Gambar latar + warna fallback saat loading */
.auth-page::before{
  background-color: #0f1b3d;             /* fallback instant (anti putih) */
  background-image: url("../img/bg-auth.jpg"); /* pastikan file ada di public/img */
  background-size: cover; background-position: center;
  filter: blur(2px) brightness(0.9);
  transform: scale(1.05);
}

/* Overlay halus agar form kontras */
.auth-page::after{
  background: linear-gradient(180deg, rgba(14,46,120,.25), rgba(14,46,120,.25));
}

/* Kartu form (di atas background) */
.auth-card{
  position: relative; z-index: 1;
  width: 100%; max-width: 520px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  padding: 28px 24px;
  opacity: 0;                          /* fade-in ringan untuk kartu */
  animation: cardPop .24s ease-out .12s forwards;
}

.auth-title{
  font-weight: 700; color: #2e59d9;
  text-align: center; margin-bottom: 18px;
}
.auth-card .form-group{ margin-bottom: 14px; }
.auth-alert{ margin-bottom: 14px; }
.auth-btn{
  width: 100%; padding: 10px 14px;
  font-weight: 600; border-radius: 8px;
}

/* Animations */
@keyframes authFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes cardPop {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce){
  .auth-page, .auth-card { animation: none !important; opacity: 1; }
}

/* (Opsional) responsif kecil */
@media (max-width: 420px){
  .auth-card{ padding: 22px 18px; }
}
