/* Modern Gen Z Style */
:root {
  --primary: #6c5ce7;
  --secondary: #a29bfe;
  --accent: #fd79a8;
  --text: #2d3436;
  --bg: #f5f6fa;
  --card-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dark-mode {
  --primary: #a29bfe;
  --secondary: #6c5ce7;
  --accent: #ff7675;
  --text: #f5f6fa;
  --bg: #1e272e;
  --card-bg: rgba(30, 39, 46, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  transition: background 0.3s, color 0.3s;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Enhanced Bubble Background Animation */
.bubble-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.bubble {
  position: absolute;
  bottom: -100px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  filter: blur(5px);
  animation: float linear infinite;
  opacity: 0;
}

/* ========= FLOATING ICONS FIX ========= */
.floating-icon {
  position: absolute;
  font-size: 1.5rem;
  color: var(--primary);
  animation: float 6s ease-in-out infinite;
  animation-delay: var(--delay);
  filter: drop-shadow(0 0 10px rgba(108, 92, 231, 0.3));
  z-index: 0;
  /* Posisi awal berdasarkan custom properties */
  left: var(--x);
  top: var(--y);
  /* Efek 3D */
  transform-style: preserve-3d;
  will-change: transform;
}

@keyframes float {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Efek hover */
.floating-icon:hover {
  animation-play-state: paused;
  transform: scale(1.2) translateY(-10px);
  filter: drop-shadow(0 0 15px var(--accent));
}

/* Generate 15 bubbles with different sizes and speeds */
.bubble:nth-child(1) {
  width: 40px;
  height: 40px;
  left: 10%;
  animation-duration: 25s;
  animation-delay: 0s;
}

.bubble:nth-child(2) {
  width: 20px;
  height: 20px;
  left: 20%;
  animation-duration: 20s;
  animation-delay: 2s;
}

.bubble:nth-child(3) {
  width: 50px;
  height: 50px;
  left: 35%;
  animation-duration: 28s;
  animation-delay: 4s;
}

.bubble:nth-child(4) {
  width: 80px;
  height: 80px;
  left: 50%;
  animation-duration: 22s;
  animation-delay: 0s;
  background: rgba(253, 121, 168, 0.2);
}

.bubble:nth-child(5) {
  width: 35px;
  height: 35px;
  left: 65%;
  animation-duration: 30s;
  animation-delay: 5s;
}

.bubble:nth-child(6) {
  width: 45px;
  height: 45px;
  left: 75%;
  animation-duration: 26s;
  animation-delay: 8s;
}

.bubble:nth-child(7) {
  width: 90px;
  height: 90px;
  left: 85%;
  animation-duration: 32s;
  animation-delay: 3s;
  background: rgba(108, 92, 231, 0.2);
}

.bubble:nth-child(8) {
  width: 25px;
  height: 25px;
  left: 25%;
  animation-duration: 19s;
  animation-delay: 6s;
}

.bubble:nth-child(9) {
  width: 15px;
  height: 15px;
  left: 90%;
  animation-duration: 24s;
  animation-delay: 2s;
}

.bubble:nth-child(10) {
  width: 70px;
  height: 70px;
  left: 5%;
  animation-duration: 35s;
  animation-delay: 7s;
}

.bubble:nth-child(11) {
  width: 60px;
  height: 60px;
  left: 40%;
  animation-duration: 29s;
  animation-delay: 1s;
  background: rgba(255, 118, 117, 0.2);
}

.bubble:nth-child(12) {
  width: 30px;
  height: 30px;
  left: 60%;
  animation-duration: 23s;
  animation-delay: 4s;
}

.bubble:nth-child(13) {
  width: 55px;
  height: 55px;
  left: 15%;
  animation-duration: 27s;
  animation-delay: 9s;
}

.bubble:nth-child(14) {
  width: 65px;
  height: 65px;
  left: 70%;
  animation-duration: 31s;
  animation-delay: 5s;
}

.bubble:nth-child(15) {
  width: 25px;
  height: 25px;
  left: 30%;
  animation-duration: 18s;
  animation-delay: 3s;
}

/* Login Container */
.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  position: relative;
}

/* Glassmorphism Card */
.login-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.login-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(to bottom right, rgba(108, 92, 231, 0.1), rgba(253, 121, 168, 0.05), rgba(108, 92, 231, 0.1));
  z-index: -1;
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, #6c5ce7, #fd79a8);
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Logo */
.logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  color: white;
  font-size: 1.5rem;
  box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.logo h1 span {
  color: var(--primary);
}

.logo p {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ========= PERBAIKAN INPUT GROUP ========= */
.input-group {
  position: relative;
  margin-bottom: 25px;
}

.input-group input {
  width: 100%;
  padding: 15px 45px 15px 45px; /* Padding simetris */
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: all 0.3s;
  border: 1px solid rgba(108, 92, 231, 0.2);
}

/* Label yang lebih presisi */
.input-group label {
  position: absolute;
  left: 45px;
  top: 15px;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 0.7;
  font-size: 0.9rem;

  padding: 0 5px;
  border-radius: 4px;
}

/* Animasi label saat aktif */
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  transform: translateY(-32px) translateX(-15px);
  font-size: 0.75rem;
  opacity: 1;
  color: var(--primary);
}

/* Ikon kiri (user & lock) */
.input-group i:first-of-type {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  opacity: 0.7;
}

/* ========= PERBAIKAN TOGGLE PASSWORD ========= */
/* Hapus duplikasi ikon mata */
.input-group .toggle-password {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text);
  opacity: 0.5;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2; /* Pastikan di atas input */
}

/* Hover state */
.input-group .toggle-password:hover {
  opacity: 1;
  color: var(--primary);
}

/* Sembunyikan ikon mata default browser */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

/* Login Button */
.login-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  transition: all 0.3s;
  box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
  overflow: hidden;
  position: relative;
}

.login-btn i {
  transition: all 0.3s;
}

.login-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
}

.login-btn:hover i {
  transform: translateX(5px);
}

/* Forgot Password */
.forgot-password {
  text-align: center;
  margin-top: 20px;
}

.forgot-password a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.7;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.forgot-password a:hover {
  opacity: 1;
  color: var(--primary);
}

.forgot-password a i {
  font-size: 0.7rem;
  transition: transform 0.3s;
}

.forgot-password a:hover i {
  transform: translateX(3px);
}

/* Responsive */
@media (max-width: 480px) {
  .login-card {
    padding: 25px;
  }

  .logo-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .logo h1 {
    font-size: 1.5rem;
  }
} /* Style untuk pesan error */
.error-message {
  background-color: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.5);
  color: #f44336;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
}

/* Penyesuaian untuk dark mode */
.dark-mode .error-message {
  color: #ffcdd2;
}
/* --- Styling untuk Tombol Lihat Password --- */

.input-group .toggle-password {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dark); /* Menggunakan variabel tema dari login.css */
  opacity: 0.5;
  cursor: pointer;
  z-index: 2; /* Memastikan tombol di atas input */
  padding: 0;
  font-size: 1rem;
}

.input-group .toggle-password:hover {
  opacity: 1;
  color: var(--primary);
}
