/* ==========================================
   siReka Login - Jarvis-style Animations
   ========================================== */

/* ---------- Animated Gradient Background ---------- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(-45deg, #0a1628, #0d2137, #0f2b4a, #0a1628);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  z-index: 0;
}

/* ---------- Hex Grid Overlay ---------- */
.hex-grid-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image:
    linear-gradient(30deg, #00d4ff 12%, transparent 12.5%, transparent 87%, #00d4ff 87.5%, #00d4ff),
    linear-gradient(150deg, #00d4ff 12%, transparent 12.5%, transparent 87%, #00d4ff 87.5%, #00d4ff),
    linear-gradient(30deg, #00d4ff 12%, transparent 12.5%, transparent 87%, #00d4ff 87.5%, #00d4ff),
    linear-gradient(150deg, #00d4ff 12%, transparent 12.5%, transparent 87%, #00d4ff 87.5%, #00d4ff),
    linear-gradient(60deg, rgba(0,212,255,0.3) 25%, transparent 25.5%, transparent 75%, rgba(0,212,255,0.3) 75%, rgba(0,212,255,0.3)),
    linear-gradient(60deg, rgba(0,212,255,0.3) 25%, transparent 25.5%, transparent 75%, rgba(0,212,255,0.3) 75%, rgba(0,212,255,0.3));
  background-size: 80px 140px;
  background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
}

/* ---------- Scan Line ---------- */
@keyframes scanLine {
  0% { top: -5%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 105%; opacity: 0; }
}

.scan-line {
  position: fixed;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.4), rgba(0,212,255,0.6), rgba(0,212,255,0.4), transparent);
  box-shadow: 0 0 20px rgba(0,212,255,0.3), 0 0 60px rgba(0,212,255,0.1);
  z-index: 1;
  pointer-events: none;
  animation: scanLine 6s linear infinite;
}

/* ---------- Floating Shapes ---------- */
@keyframes floatShape1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(30px, -30px) rotate(120deg) scale(1.05); }
  66% { transform: translate(-20px, 20px) rotate(240deg) scale(0.95); }
}

@keyframes floatShape2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-40px, 40px) rotate(180deg); }
}

@keyframes floatShape3 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.15; }
  50% { transform: translate(30px, -50px) scale(1.2); opacity: 0.25; }
}

.floating-shape {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.floating-shape.shape-1 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0,212,255,0.08) 0%, transparent 70%);
  top: -50px; right: -50px;
  animation: floatShape1 20s ease-in-out infinite;
}

.floating-shape.shape-2 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,180,255,0.06) 0%, transparent 70%);
  bottom: 10%; left: -30px;
  animation: floatShape2 18s ease-in-out infinite;
}

.floating-shape.shape-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,200,255,0.04) 0%, transparent 70%);
  bottom: -100px; right: 20%;
  animation: floatShape3 25s ease-in-out infinite;
}

.floating-shape.shape-4 {
  width: 150px; height: 150px;
  border: 2px solid rgba(0,212,255,0.08);
  top: 20%; left: 15%;
  animation: floatShape2 22s ease-in-out infinite reverse;
}

/* ---------- Particles ---------- */
@keyframes particleUp {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

/* ---------- Card Entrance Animation ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(60px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.animate-card {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---------- Staggered Elements ---------- */
.animate-stagger {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-stagger:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger:nth-child(2) { animation-delay: 0.25s; }
.animate-stagger:nth-child(3) { animation-delay: 0.4s; }
.animate-stagger:nth-child(4) { animation-delay: 0.55s; }

/* ---------- Logo Float ---------- */
@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

/* ---------- Typing Effect ---------- */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

.typing-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid rgba(255,255,255,0.8);
  animation: typing 1.5s steps(30, end) forwards, blink 0.8s step-end infinite;
  max-width: fit-content;
}

/* ---------- Input Field Modern Styling ---------- */
.form-group.modern-input {
  position: relative;
  margin-bottom: 1.75rem;
}

.form-group.modern-input .form-control {
  border: none;
  border-bottom: 2px solid rgba(0,212,255,0.2);
  border-radius: 0;
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  background: transparent;
  transition: all 0.3s ease;
  color: #2d2d44;
  font-size: 0.95rem;
  height: auto;
  box-shadow: none !important;
}

.form-group.modern-input .form-control:focus {
  border-bottom-color: #00d4ff;
  background: transparent;
}

.form-group.modern-input .form-control:focus ~ .input-icon {
  color: #00d4ff;
  text-shadow: 0 0 8px rgba(0,212,255,0.5);
}

.form-group.modern-input .form-control::placeholder {
  color: #a0a0c0;
  font-weight: 400;
}

.form-group.modern-input .input-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #b0b0d0;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  z-index: 2;
}

/* Underline animation on focus */
.form-group.modern-input .input-underline {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #00d4ff, #0090ff);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0,212,255,0.5);
}

.form-group.modern-input .form-control:focus ~ .input-underline {
  width: 100%;
}

/* ---------- Button Styling ---------- */
.btn-login {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #00d4ff 0%, #0090ff 100%);
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.5px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,212,255,0.3);
}

.btn-login:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,212,255,0.4);
  color: #fff;
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0,212,255,0.3);
}

/* Button shimmer effect */
@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

.btn-login::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: skewX(-20deg);
  animation: shimmer 3s ease-in-out infinite;
}

/* Ripple effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  pointer-events: none;
}

@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ---------- Card Styling ---------- */
.login-card {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0,212,255,0.1);
  background: transparent;
}

.login-card .left-panel {
  background: linear-gradient(135deg, #0a1628 0%, #0d2847 50%, #0a1628 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 500px;
}

.login-card .left-panel::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: radial-gradient(circle at 30% 50%, rgba(0,212,255,0.05) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(0,180,255,0.08) 0%, transparent 50%);
  animation: floatShape1 30s ease-in-out infinite;
}

/* Hex grid on left panel */
.hex-grid-left {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0.06;
  background-image:
    linear-gradient(30deg, #00d4ff 12%, transparent 12.5%, transparent 87%, #00d4ff 87.5%, #00d4ff),
    linear-gradient(150deg, #00d4ff 12%, transparent 12.5%, transparent 87%, #00d4ff 87.5%, #00d4ff),
    linear-gradient(30deg, #00d4ff 12%, transparent 12.5%, transparent 87%, #00d4ff 87.5%, #00d4ff),
    linear-gradient(150deg, #00d4ff 12%, transparent 12.5%, transparent 87%, #00d4ff 87.5%, #00d4ff),
    linear-gradient(60deg, rgba(0,212,255,0.4) 25%, transparent 25.5%, transparent 75%, rgba(0,212,255,0.4) 75%, rgba(0,212,255,0.4)),
    linear-gradient(60deg, rgba(0,212,255,0.4) 25%, transparent 25.5%, transparent 75%, rgba(0,212,255,0.4) 75%, rgba(0,212,255,0.4));
  background-size: 60px 104px;
  background-position: 0 0, 0 0, 30px 52px, 30px 52px, 0 0, 30px 52px;
  pointer-events: none;
}

.login-card .right-panel {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  padding: 3rem 2.5rem;
  min-height: 500px;
}

@supports not (backdrop-filter: blur(20px)) {
  .login-card .right-panel {
    background: #ffffff;
  }
}

/* ---------- Welcome Text ---------- */
.welcome-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2d2d44;
  margin-bottom: 0.25rem;
}

.welcome-sub {
  font-size: 0.9rem;
  color: #8888aa;
  margin-bottom: 2rem;
}

/* ---------- 3D Perspective & Card Tilt ---------- */
.perspective-container {
  perspective: 1200px;
}

.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

.tilt-card .left-panel,
.tilt-card .right-panel {
  transform-style: preserve-3d;
}

.tilt-layer-0 { transform: translateZ(0px); }
.tilt-layer-1 { transform: translateZ(20px); }
.tilt-layer-2 { transform: translateZ(40px); }
.tilt-layer-3 { transform: translateZ(60px); }

/* ---------- 3D Parallax Wrapper ---------- */
.parallax-wrapper {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  will-change: transform;
  transition: transform 0.1s ease-out;
}

/* ---------- 3D Rotating Cube ---------- */
@keyframes cubeRotate {
  0% { transform: rotateX(-20deg) rotateY(0deg); }
  100% { transform: rotateX(-20deg) rotateY(360deg); }
}

.cube-container {
  width: 80px;
  height: 80px;
  perspective: 600px;
  pointer-events: none;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: cubeRotate 12s linear infinite;
}

.cube-face {
  position: absolute;
  width: 80px;
  height: 80px;
  background: rgba(0, 212, 255, 0.06);
  border: 1.5px solid rgba(0, 212, 255, 0.15);
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.cube-face.front  { transform: translateZ(40px); }
.cube-face.back   { transform: rotateY(180deg) translateZ(40px); }
.cube-face.right  { transform: rotateY(90deg) translateZ(40px); }
.cube-face.left   { transform: rotateY(-90deg) translateZ(40px); }
.cube-face.top    { transform: rotateX(90deg) translateZ(40px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(40px); }

/* ---------- 3D Orb/Sphere ---------- */
@keyframes spherePulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}

.sphere-3d {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0,212,255,0.12), rgba(0,180,255,0.08) 50%, transparent 70%);
  box-shadow: 0 0 60px rgba(0, 212, 255, 0.15), inset 0 0 60px rgba(0,212,255,0.05);
  z-index: 1;
  pointer-events: none;
  animation: spherePulse 8s ease-in-out infinite;
  transform-style: preserve-3d;
}

.sphere-3d::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 20%;
  width: 40%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.2), transparent);
  transform: rotate(-20deg);
}

/* ---------- 3D Ring ---------- */
@keyframes ringRotate {
  0% { transform: rotateX(60deg) rotateY(0deg) rotateZ(0deg); }
  100% { transform: rotateX(60deg) rotateY(360deg) rotateZ(0deg); }
}

.ring-3d {
  position: relative;
  width: 100px;
  height: 100px;
  border: 2px solid rgba(0, 212, 255, 0.1);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  transform-style: preserve-3d;
  animation: ringRotate 15s linear infinite;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.05), inset 0 0 30px rgba(0, 212, 255, 0.05);
}

.ring-3d::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(0, 212, 255, 0.06);
  border-radius: 50%;
  animation: ringRotate 20s linear infinite reverse;
}

/* ---------- Card Glow Edge ---------- */
.login-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(0,212,255,0.3), transparent, rgba(0,180,255,0.2), transparent);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.login-card:hover::before {
  opacity: 1;
}

/* ---------- 3D Button Enhancement ---------- */
.btn-login {
  transform-style: preserve-3d;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #0090ff 0%, #00d4ff 100%);
  transform: translateZ(-4px);
  opacity: 0.6;
  transition: all 0.3s ease;
}

.btn-login:hover {
  transform: translateY(-3px) translateZ(4px);
}

.btn-login:hover::before {
  transform: translateZ(-8px);
  opacity: 0.8;
}

/* ---------- Login Logo with Jarvis Rings ---------- */
.login-brand-content {
  position: relative;
  z-index: 2;
}

.login-logo-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-pidsus {
  width: 70px;
  height: 70px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 15px rgba(0,212,255,0.6))
          drop-shadow(0 0 30px rgba(0,212,255,0.3));
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(0,212,255,0.6)) drop-shadow(0 0 30px rgba(0,212,255,0.3)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(0,212,255,0.8)) drop-shadow(0 0 40px rgba(0,212,255,0.4)); }
}

/* Login Jarvis Rings */
.login-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}

/* Ring 1 — Terluar, putus-putus, CW */
.login-ring-1 {
  width: 160px;
  height: 160px;
  border-top: 2px solid rgba(0,212,255,0.8);
  border-right: 2px solid rgba(0,212,255,0.3);
  border-bottom: 2px solid transparent;
  border-left: 2px solid rgba(0,212,255,0.15);
  animation: loginSpin 3s linear infinite;
  box-shadow: 0 0 15px rgba(0,212,255,0.2), inset 0 0 15px rgba(0,212,255,0.05);
}

/* Ring 2 — CCW */
.login-ring-2 {
  width: 130px;
  height: 130px;
  border-top: 2px solid rgba(0,180,255,0.15);
  border-right: 2px solid rgba(0,180,255,0.6);
  border-bottom: 2px solid rgba(0,180,255,0.3);
  border-left: 2px solid transparent;
  animation: loginSpinReverse 2.2s linear infinite;
  box-shadow: 0 0 12px rgba(0,180,255,0.15), inset 0 0 12px rgba(0,180,255,0.04);
}

/* Ring 3 — CW lambat */
.login-ring-3 {
  width: 100px;
  height: 100px;
  border-top: 2px solid rgba(0,200,255,0.5);
  border-right: 2px solid rgba(0,200,255,0.15);
  border-bottom: 2px solid rgba(0,200,255,0.08);
  border-left: 2px solid rgba(0,200,255,0.3);
  animation: loginSpin 4s linear infinite;
  box-shadow: 0 0 10px rgba(0,200,255,0.12), inset 0 0 8px rgba(0,200,255,0.03);
}

/* Ring 4 — Terdalam, CCW cepat */
.login-ring-4 {
  width: 75px;
  height: 75px;
  border-top: 1px solid transparent;
  border-right: 1px solid rgba(0,220,255,0.4);
  border-bottom: 1px solid rgba(0,220,255,0.2);
  border-left: 1px solid rgba(0,220,255,0.6);
  animation: loginSpinReverse 1.5s linear infinite;
  box-shadow: 0 0 8px rgba(0,220,255,0.1);
}

/* Dot accents on rings */
.login-ring-1::before,
.login-ring-1::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: #00d4ff;
  border-radius: 50%;
  box-shadow: 0 0 6px #00d4ff, 0 0 12px rgba(0,212,255,0.5);
}

.login-ring-1::before {
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
}

.login-ring-1::after {
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
}

.login-ring-2::before,
.login-ring-2::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  background: #00b4ff;
  border-radius: 50%;
  box-shadow: 0 0 5px #00b4ff, 0 0 10px rgba(0,180,255,0.4);
}

.login-ring-2::before {
  left: -2.5px;
  top: 50%;
  transform: translateY(-50%);
}

.login-ring-2::after {
  right: -2.5px;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes loginSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes loginSpinReverse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

/* ---------- Login Badge ---------- */
.login-badge {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: 20px;
  color: rgba(0,212,255,0.8);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { border-color: rgba(0,212,255,0.3); box-shadow: 0 0 0 0 rgba(0,212,255,0); }
  50% { border-color: rgba(0,212,255,0.5); box-shadow: 0 0 15px rgba(0,212,255,0.1); }
}

/* ---------- Connection Lines (generated by JS) ---------- */
.connection-line {
  position: fixed;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.15), transparent);
  pointer-events: none;
  z-index: 1;
  transform-origin: 0 0;
}

/* ---------- Jarvis Loader (shared with dashboard) ---------- */
@keyframes loaderDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ---------- Card Wrapper & Centering Fix ---------- */
body.main-body.leftmenu {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.login-wrapper {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .login-card .left-panel {
    display: none;
  }

  .login-card .right-panel {
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
  }

  .login-wrapper {
    padding: 1rem;
  }

  .cube-container,
  .sphere-3d,
  .ring-3d {
    display: none;
  }
}

@media (max-width: 576px) {
  .login-card .right-panel {
    padding: 2rem 1.25rem;
    min-height: auto;
  }
}
