/* KeySentinel PAM — Animasi Cahaya Biru Bergerak di Sisi Page & Kartu Login (Hitam Polos) */

/* 1. Layout Terpusat dengan Background Hitam Polos */
.login {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px 16px;
  overflow: hidden;
  background: #000000;
}

/* Pastikan saat .hidden, section login benar-benar disembunyikan dan tidak muncul di dashboard */
.login.hidden,
#login.hidden,
section#login.hidden,
.hidden {
  display: none !important;
}

#net {
  display: none !important;
}

.login-hero {
  display: none !important;
}

.login-aurora-bg {
  display: none !important;
}

/* ==========================================================================
   CAHAYA BIRU BERGERAK DI SISI LAYAR (VIEWPORT PAGE EDGES)
   ========================================================================== */
.page-glow-track {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

/* Cahaya Atas Layar: Bergerak dari Tengah ke Kiri */
.pbeam-top-l {
  position: absolute;
  top: 0;
  right: 50%;
  height: 3.5px;
  width: 50%;
  background: linear-gradient(270deg, #00f0ff 0%, #0088ff 50%, transparent 100%);
  box-shadow: 0 0 16px #00d2ff, 0 0 35px rgba(0, 210, 255, 0.75);
  animation: pbeamExpandLeft 2.8s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-origin: right center;
}

/* Cahaya Atas Layar: Bergerak dari Tengah ke Kanan */
.pbeam-top-r {
  position: absolute;
  top: 0;
  left: 50%;
  height: 3.5px;
  width: 50%;
  background: linear-gradient(90deg, #00f0ff 0%, #0088ff 50%, transparent 100%);
  box-shadow: 0 0 16px #00d2ff, 0 0 35px rgba(0, 210, 255, 0.75);
  animation: pbeamExpandRight 2.8s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-origin: left center;
}

/* Cahaya Bawah Layar: Bergerak dari Tengah ke Kiri */
.pbeam-bot-l {
  position: absolute;
  bottom: 0;
  right: 50%;
  height: 3.5px;
  width: 50%;
  background: linear-gradient(270deg, #00f0ff 0%, #0088ff 50%, transparent 100%);
  box-shadow: 0 0 16px #00d2ff, 0 0 35px rgba(0, 210, 255, 0.75);
  animation: pbeamExpandLeft 2.8s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-origin: right center;
}

/* Cahaya Bawah Layar: Bergerak dari Tengah ke Kanan */
.pbeam-bot-r {
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 3.5px;
  width: 50%;
  background: linear-gradient(90deg, #00f0ff 0%, #0088ff 50%, transparent 100%);
  box-shadow: 0 0 16px #00d2ff, 0 0 35px rgba(0, 210, 255, 0.75);
  animation: pbeamExpandRight 2.8s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-origin: left center;
}

/* Cahaya Sisi Kiri Layar */
.pbeam-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #00f0ff, #0077fe 50%, #00f0ff 100%);
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.6);
  animation: pbeamSidePulse 2.8s ease-in-out infinite alternate;
}

/* Cahaya Sisi Kanan Layar */
.pbeam-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #00f0ff, #0077fe 50%, #00f0ff 100%);
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.6);
  animation: pbeamSidePulse 2.8s ease-in-out infinite alternate 1.4s;
}

@keyframes pbeamExpandLeft {
  0% {
    transform: scaleX(0);
    opacity: 0.1;
  }
  25% {
    opacity: 1;
  }
  70% {
    transform: scaleX(1);
    opacity: 0.95;
  }
  100% {
    transform: scaleX(1);
    opacity: 0.2;
  }
}

@keyframes pbeamExpandRight {
  0% {
    transform: scaleX(0);
    opacity: 0.1;
  }
  25% {
    opacity: 1;
  }
  70% {
    transform: scaleX(1);
    opacity: 0.95;
  }
  100% {
    transform: scaleX(1);
    opacity: 0.2;
  }
}

@keyframes pbeamSidePulse {
  0% {
    opacity: 0.2;
    filter: drop-shadow(0 0 6px #00d2ff);
  }
  50% {
    opacity: 0.9;
    filter: drop-shadow(0 0 16px #00d2ff);
  }
  100% {
    opacity: 0.2;
    filter: drop-shadow(0 0 6px #00d2ff);
  }
}

/* ==========================================================================
   CAHAYA BIRU BERGERAK DI SISI KARTU LOGIN (CARD BORDER BEAMS)
   ========================================================================== */
.login-stage {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 440px;
  margin: auto;
  display: flex;

  justify-content: center;
}

.login-card-3d {
  position: relative;
  perspective: 1200px;
  width: 100%;
  border-radius: 20px;
}

/* Jalur Cahaya Mengelilingi Sisi Kartu */
.card-glow-track {
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

/* Cahaya Atas Kartu: Bergerak dari Tengah ke Kiri */
.cbeam-top-l {
  position: absolute;
  top: 0;
  right: 50%;
  height: 3.5px;
  width: 50%;
  background: linear-gradient(270deg, #00f0ff 0%, #0099ff 55%, transparent 100%);
  box-shadow: 0 0 14px #00d2ff, 0 0 28px rgba(0, 210, 255, 0.9);
  animation: cbeamExpandLeft 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-origin: right center;
}

/* Cahaya Atas Kartu: Bergerak dari Tengah ke Kanan */
.cbeam-top-r {
  position: absolute;
  top: 0;
  left: 50%;
  height: 3.5px;
  width: 50%;
  background: linear-gradient(90deg, #00f0ff 0%, #0099ff 55%, transparent 100%);
  box-shadow: 0 0 14px #00d2ff, 0 0 28px rgba(0, 210, 255, 0.9);
  animation: cbeamExpandRight 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-origin: left center;
}

/* Cahaya Bawah Kartu: Bergerak dari Tengah ke Kiri */
.cbeam-bot-l {
  position: absolute;
  bottom: 0;
  right: 50%;
  height: 3.5px;
  width: 50%;
  background: linear-gradient(270deg, #00f0ff 0%, #0099ff 55%, transparent 100%);
  box-shadow: 0 0 14px #00d2ff, 0 0 28px rgba(0, 210, 255, 0.9);
  animation: cbeamExpandLeft 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-origin: right center;
}

/* Cahaya Bawah Kartu: Bergerak dari Tengah ke Kanan */
.cbeam-bot-r {
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 3.5px;
  width: 50%;
  background: linear-gradient(90deg, #00f0ff 0%, #0099ff 55%, transparent 100%);
  box-shadow: 0 0 14px #00d2ff, 0 0 28px rgba(0, 210, 255, 0.9);
  animation: cbeamExpandRight 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-origin: left center;
}

/* Cahaya Sisi Kiri Kartu */
.cbeam-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #00f0ff, #0077fe, #00f0ff);
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.7);
  animation: cbeamSidePulse 2.4s ease-in-out infinite alternate;
}

/* Cahaya Sisi Kanan Kartu */
.cbeam-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #00f0ff, #0077fe, #00f0ff);
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.7);
  animation: cbeamSidePulse 2.4s ease-in-out infinite alternate 1.2s;
}

@keyframes cbeamExpandLeft {
  0% {
    transform: scaleX(0);
    opacity: 0.15;
  }
  25% {
    opacity: 1;
  }
  65% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(1) translateX(-6%);
    opacity: 0.3;
  }
}

@keyframes cbeamExpandRight {
  0% {
    transform: scaleX(0);
    opacity: 0.15;
  }
  25% {
    opacity: 1;
  }
  65% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(1) translateX(6%);
    opacity: 0.3;
  }
}

@keyframes cbeamSidePulse {
  0% {
    opacity: 0.25;
    transform: scaleY(0.7);
  }
  50% {
    opacity: 0.95;
    transform: scaleY(1);
  }
  100% {
    opacity: 0.25;
    transform: scaleY(0.7);
  }
}

/* 3. Panel Form */
.login-panel {
  position: relative !important;
  width: 100% !important;
  max-width: 440px !important;
  background: linear-gradient(165deg, #0c1628 0%, #060b14 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.32) !important;
  border-radius: 20px !important;
  clip-path: none !important;
  box-shadow:
    0 0 35px rgba(0, 210, 255, 0.12),
    0 25px 65px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  padding: 34px 28px 24px !important;
  display: flex;

  flex-direction: column !important;
  gap: 16px !important;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s ease;
}

/* Transisi Form 3D (Slide / Flip) */
.login-panel.flip-3d-anim {
  animation: card3DFlipIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes card3DFlipIn {
  0% {
    opacity: 0.15;
    transform: perspective(1200px) rotateY(-55deg) scale(0.92);
    filter: blur(5px);
  }
  65% {
    transform: perspective(1200px) rotateY(4deg) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: perspective(1200px) rotateY(0deg) scale(1);
    filter: blur(0);
  }
}

/* Getar saat login gagal (Shake Micro-interaction) */
.login-panel.form-shake {
  animation: cardShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}

/* 4. Maskot Vektor / Animasi Hologram Cyber Shield */
.login-mascot {
  display: flex;

  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  user-select: none;
}

.mascot-hologram {
  position: relative;
  width: 104px;
  height: 104px;
  display: flex;

  align-items: center;
  justify-content: center;
}

.gyro-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.ring-outer {
  inset: 0;
  border: 1.5px dashed rgba(0, 210, 255, 0.55);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.25);
  animation: gyroSpinCW 20s linear infinite;
}

.ring-middle {
  inset: 8px;
  border: 1px dotted rgba(129, 140, 248, 0.65);
  animation: gyroSpinCCW 13s linear infinite;
}

.ring-inner {
  inset: 16px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: inset 0 0 10px rgba(0, 210, 255, 0.15);
}

@keyframes gyroSpinCW {
  to { transform: rotate(360deg); }
}

@keyframes gyroSpinCCW {
  to { transform: rotate(-360deg); }
}

.mascot-shield-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;

  align-items: center;
  justify-content: center;
}

.mascot-shield-wrapper .brand-shield {
  display: block;
  width: 62px;
  height: auto;
  filter: drop-shadow(0 0 16px rgba(0, 210, 255, 0.65)) drop-shadow(0 6px 16px rgba(0, 20, 60, 0.5));
  animation: shieldLevitate 3.5s ease-in-out infinite alternate;
  transition: transform 0.3s ease, filter 0.3s ease;
}

@keyframes shieldLevitate {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-4px) scale(1.02); }
}

.scan-beam {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00d2ff, #ffffff, #00d2ff, transparent);
  box-shadow: 0 0 8px #00d2ff, 0 0 14px #00d2ff;
  top: 20%;
  opacity: 0.75;
  animation: scanLaser 2.6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes scanLaser {
  0% { top: 15%; opacity: 0.3; }
  50% { opacity: 0.95; }
  100% { top: 82%; opacity: 0.3; }
}

.quantum-core {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #00d2ff;
  border-radius: 50%;
  box-shadow: 0 0 14px #00d2ff, 0 0 28px #00d2ff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: all 0.35s ease;
}

.login-mascot.state-scanning .scan-beam {
  animation-duration: 1.1s;
  opacity: 1;
  background: linear-gradient(90deg, transparent, #38bdf8, #fff, #38bdf8, transparent);
  box-shadow: 0 0 12px #38bdf8;
}

.login-mascot.state-scanning .ring-outer {
  animation-duration: 7s;
  border-color: rgba(56, 189, 248, 0.9);
}

.login-mascot.state-lockdown .quantum-core {
  background: #ffc34d;
  box-shadow: 0 0 16px #ffc34d, 0 0 32px #ffc34d;
}

.login-mascot.state-lockdown .brand-shield {
  filter: drop-shadow(0 0 18px rgba(255, 195, 77, 0.75));
}

.login-mascot.state-lockdown .ring-outer {
  border-color: rgba(255, 195, 77, 0.75);
}

.login-mascot.state-granted .quantum-core {
  background: #10b981;
  box-shadow: 0 0 25px #10b981, 0 0 50px #10b981;
  transform: translate(-50%, -50%) scale(1.6);
}

.login-mascot.state-granted .brand-shield {
  filter: drop-shadow(0 0 25px rgba(16, 185, 129, 0.9));
}

.login-mascot.state-granted .ring-outer {
  border-color: rgba(16, 185, 129, 0.9);
  animation-duration: 4s;
}

/* Teks Merek & Badge Status */
.login-brand-text {
  display: flex;

  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}

.login-brand-text .brand-text-img {
  width: 195px;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.security-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  background: rgba(0, 210, 255, 0.08);
  border: 1px solid rgba(0, 210, 255, 0.28);
  border-radius: 20px;
  font: 600 10.5px var(--mono);
  color: #38bdf8;
  letter-spacing: 0.07em;
  margin-top: 2px;
}

.pulse-beacon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00d2ff;
  box-shadow: 0 0 8px #00d2ff;
  animation: beaconPulse 1.8s infinite;
}

@keyframes beaconPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 12px #00d2ff; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Heading Sign In */
.login-panel .ph.login-heading {
  justify-content: center !important;
  margin-bottom: 2px;
}

.login-panel .ph h2 {
  font-size: 21px !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em;
  color: #f1f5f9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* 5. Kolom Input */
label.f {
  display: flex;

  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
}

.input-glow-wrap {
  position: relative;
  display: flex;

  align-items: center;
  width: 100%;
}

.login-panel input {
  width: 100%;
  background: rgba(8, 14, 26, 0.85) !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  border-radius: 10px !important;
  padding: 11px 14px !important;
  font-size: 14px !important;
  color: #f8fafc !important;
  transition: all 0.25s ease !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.login-panel input:focus {
  border-color: #00d2ff !important;
  background: rgba(10, 20, 40, 0.95) !important;
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.2), 0 0 16px rgba(0, 210, 255, 0.25) !important;
  outline: none !important;
}

/* Sembunyikan tombol toggle mata */
.btn-toggle-pass {
  display: none !important;
}

/* 6. Tombol Submit (Loading & Centang Sukses Micro-interactions) */
.btn-submit {
  position: relative !important;
  display: flex;

  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  padding: 12px 20px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #00d2ff 0%, #0077fe 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.32) !important;
  box-shadow: 0 4px 22px rgba(0, 210, 255, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
  color: #030d1d !important;
  cursor: pointer !important;
  overflow: hidden !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 30px rgba(0, 210, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
  filter: brightness(1.1) !important;
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0) !important;
}

/* Kilauan Sheen pada Tombol */
.btn-submit::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -70%;
  width: 45%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: rotate(25deg);
  pointer-events: none;
  transition: left 0.75s ease;
}

.btn-submit:hover::after {
  left: 130%;
}

.btn-submit .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.2px solid rgba(3, 13, 29, 0.3);
  border-top-color: #030d1d;
  border-radius: 50%;
  animation: btnSpinAnim 0.7s linear infinite;
}

.btn-submit .btn-check {
  display: none;
  width: 20px;
  height: 20px;
}

.btn-submit.btn-loading {
  pointer-events: none !important;
  opacity: 0.92 !important;
}

.btn-submit.btn-loading .btn-spinner {
  display: inline-block !important;
}

.btn-submit.btn-loading .btn-text {
  font-size: 0 !important;
}

.btn-submit.btn-loading .btn-text::after {
  content: "Verifying credentials...";
  font-size: 15px !important;
}

.btn-submit.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
  color: #ffffff !important;
  pointer-events: none !important;
}

.btn-submit.btn-success .btn-spinner {
  display: none !important;
}

.btn-submit.btn-success .btn-check {
  display: inline-block !important;
  animation: checkPopAnim 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.btn-submit.btn-success .btn-text {
  font-size: 0 !important;
}

.btn-submit.btn-success .btn-text::after {
  content: "Access Granted";
  font-size: 15px !important;
}

@keyframes btnSpinAnim {
  to { transform: rotate(360deg); }
}

@keyframes checkPopAnim {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  70% { transform: scale(1.22) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Tombol Sekunder (Reset 2FA) */
#forgotPassword {
  background: rgba(19, 32, 58, 0.7) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  color: #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 10px 16px !important;
  transition: all 0.2s ease !important;
}

#forgotPassword:hover {
  background: rgba(24, 42, 74, 0.9) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2) !important;
}

.login-panel .foot {
  font-size: 11.5px !important;
  color: #64748b !important;
  border-top: 1px solid rgba(56, 189, 248, 0.16) !important;
  padding-top: 14px !important;
  margin-top: 4px !important;
  text-align: center;
  line-height: 1.45;
}

/* Responsivitas Layar Sempit */
@media (max-width: 520px) {
  .login-panel {
    padding: 24px 18px 20px !important;
    border-radius: 16px !important;
  }
  .mascot-hologram {
    width: 90px;
    height: 90px;
  }
  .mascot-shield-wrapper .brand-shield {
    width: 54px;
  }
}
