/* Modern Cybersecurity Auth Styling & Animations for Kancil */

/* 1. Ambient Background & Cyber Grid */
.auth-stage-wrapper {
  position: relative;
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  width: 100%;
}

.auth-ambient-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Subtle cyber dot grid */
.auth-grid-texture {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(rgba(59, 130, 246, 0.12) 1px, transparent 1px),
    radial-gradient(rgba(16, 185, 129, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
  opacity: 0.6;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 80%);
}

/* Glowing floating orbs */
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  will-change: transform;
  pointer-events: none;
}

.auth-orb-primary {
  width: 500px;
  height: 500px;
  top: -100px;
  left: 50%;
  margin-left: -250px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.45) 0%, rgba(99, 102, 241, 0.2) 50%, transparent 70%);
  animation: authOrbPulse 9s ease-in-out infinite alternate;
}

.auth-orb-secondary {
  width: 400px;
  height: 400px;
  bottom: 10%;
  left: 15%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
  animation: authOrbDrift 14s ease-in-out infinite alternate;
}

.auth-orb-accent {
  width: 380px;
  height: 380px;
  top: 30%;
  right: 12%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
  animation: authOrbDrift 12s ease-in-out infinite alternate-reverse;
}

@keyframes authOrbPulse {
  0% {
    transform: scale(0.9) translateY(0);
    opacity: 0.28;
  }
  50% {
    transform: scale(1.1) translateY(20px);
    opacity: 0.42;
  }
  100% {
    transform: scale(0.95) translateY(-15px);
    opacity: 0.3;
  }
}

@keyframes authOrbDrift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, -25px) scale(1.08);
  }
  100% {
    transform: translate(-25px, 20px) scale(0.94);
  }
}

/* 2. Glassmorphism Modern Auth Card */
.auth-modern-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  background: rgba(18, 24, 38, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 
    0 24px 48px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 36px 32px 32px;
  margin: 0 auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Radiant top hairline */
.auth-card-radiance {
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.7), rgba(16, 185, 129, 0.7), transparent);
  border-radius: 2px;
}

/* 3. Staggered Entrance Animations */
@keyframes authFadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(22px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-anim-entry-1 {
  animation: authFadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-anim-entry-2 {
  opacity: 0;
  animation: authFadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.12s forwards;
}

.auth-anim-entry-3 {
  opacity: 0;
  animation: authFadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.22s forwards;
}

.auth-anim-entry-4 {
  opacity: 0;
  animation: authFadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.32s forwards;
}

/* 4. Interactive Micro-Interactions */
.launch-btn-google {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.launch-btn-google:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(66, 133, 244, 0.25);
  border-color: rgba(66, 133, 244, 0.4);
}

.launch-btn-google:active {
  transform: translateY(0) scale(0.98);
}

.auth-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--tinta);
  background: var(--kertas);
  border: 1px solid var(--garis);
  border-radius: 8px;
  text-decoration: none;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-btn-secondary:hover {
  background: var(--kertas-2);
  border-color: var(--aksen);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.12);
}

.auth-btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

/* 5. Modern Sandbox Developer Panel */
.auth-dev-box {
  margin-top: 24px;
  padding: 22px 20px;
  border-radius: 10px;
  border: 1px dashed rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.03);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.auth-dev-box:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.05);
}

.dev-role-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.dev-role-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--garis);
  background: var(--kertas);
  color: var(--tinta-2);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.dev-role-btn:hover {
  background: var(--kertas-2);
  color: var(--tinta);
  border-color: var(--aksen);
  transform: translateY(-1px);
}

.dev-role-btn.active-role {
  background: rgba(59, 130, 246, 0.14);
  color: var(--aksen);
  border-color: var(--aksen);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Flash animation for input when preset role is filled */
@keyframes inputFlashPulse {
  0% {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    border-color: var(--aksen);
  }
  100% {
    box-shadow: none;
    border-color: var(--garis);
  }
}

.input-flash-active {
  animation: inputFlashPulse 0.6s ease-out;
}

/* 6. Security Trust Badges */
.auth-trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--garis);
  flex-wrap: wrap;
}

.auth-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--tinta-2);
}

.auth-trust-item svg {
  color: var(--lumut);
  flex-shrink: 0;
}

/* 8. Pop-up Modal Login with Backdrop Blur */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 15, 29, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.auth-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.auth-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-backdrop.is-open .auth-modal-dialog {
  transform: scale(1) translateY(0);
}

.auth-modal-card {
  position: relative;
  background: var(--kertas, #0f172a);
  border: 1px solid var(--garis, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 30px 28px 26px;
}

.auth-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--garis, rgba(255, 255, 255, 0.1));
  background: transparent;
  color: var(--tinta-2, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--tinta, #f8fafc);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Role Selector Tabs */
.auth-role-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--garis, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 22px;
}

.auth-role-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--tinta-2, #94a3b8);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.auth-role-tab.active {
  background: var(--aksen, #3b82f6);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.auth-role-tab:not(.active):hover {
  color: var(--tinta, #f8fafc);
  background: rgba(255, 255, 255, 0.04);
}

@media (prefers-reduced-motion: reduce) {
  .auth-orb,
  .auth-orb-primary,
  .auth-orb-secondary,
  .auth-orb-accent {
    animation: none !important;
    transform: none !important;
  }
  
  .auth-anim-entry-1,
  .auth-anim-entry-2,
  .auth-anim-entry-3,
  .auth-anim-entry-4 {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .launch-btn-google:hover,
  .auth-btn-secondary:hover,
  .dev-role-btn:hover {
    transform: none !important;
  }

  .input-flash-active {
    animation: none !important;
  }
}

