:root {
  --bg-main: #07090e;
  --bg-card: rgba(17, 24, 39, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #ffffff;
  --text-muted: #9ca3af;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --success: #10b981;
  --danger: #ef4444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background:
    linear-gradient(135deg, rgba(7, 9, 14, 0.9) 0%, rgba(7, 9, 14, 0.7) 100%),
    url('https://images.unsplash.com/photo-1503951914875-452162b0f3f1?auto=format&fit=crop&w=1920&q=80') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* ==========================================================
   EFEK GARIS WARNA-WARNI BERPUTAR DI KELILING KOTAK LOGIN
   ========================================================== */
.auth-container {
  position: relative;
  width: 100%;
  max-width: 450px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  z-index: 1;
  overflow: hidden; /* Mengunci animasi agar tidak keluar dari sudut border-radius */
}

/* Membuat elemen garis putar menggunakan pseudo-class ::before */
.auth-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, #ff4545, #ff8400, #ffea00, #00ff66, #00ffff, #0066ff, #cc00ff, #ff4545);
  animation: rotateBorder 4s linear infinite;
  z-index: -2;
}

/* Lapisan kedua di dalam untuk menutupi bagian tengah agar warna card tetap gelap */
.auth-container::after {
  content: '';
  position: absolute;
  inset: 2px; /* Ketebalan garis warna-warni yang tampil di luar (2px) */
  background: #111827; /* Warna latar dalam card */
  border-radius: 22px;
  z-index: -1;
}

@keyframes rotateBorder {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Logo Gambar (IMG) & Header */
.auth-logo {
  text-align: center;
  margin-bottom: 25px;
}

.logo-img {
  width: 65px;
  height: 65px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 8px;
  margin: 0 auto 12px auto;
  display: block;
}

.auth-logo h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.auth-logo h2 span {
  color: var(--accent);
}

.auth-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Alert */
.alert {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

/* Form Controls & Input with Icons */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Ikon di dalam input sebelah kiri */
.input-icon {
  position: absolute;
  left: 15px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.form-control {
  width: 100%;
  background-color: rgba(7, 9, 14, 0.8);
  border: 1px solid var(--border-color);
  padding: 13px 16px 13px 42px;
  border-radius: 12px;
  color: var(--text-main);
  font-size: 14px;
  transition: all 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* Tombol Ikon Mata Password di sebelah kanan */
.toggle-password {
  position: absolute;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
}

.toggle-password:hover {
  color: var(--text-main);
}

.btn-auth {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0b0f19;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition:
    opacity 0.2s,
    transform 0.2s;
  margin-top: 10px;
}

.btn-auth:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.auth-footer {
  text-align: center;
  margin-top: 25px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.btn-login-redirect {
  display: block;
  width: 100%;
  background-color: var(--success);
  color: #ffffff;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 15px;
  transition: opacity 0.2s;
}

.btn-login-redirect:hover {
  opacity: 0.9;
}

/* ==========================================================
   RESPONSIF AMAN UNTUK LAYAR HP (MOBILE)
   ========================================================== */
@media screen and (max-width: 480px) {
  body {
    padding: 15px; /* Mengurangi padding layar agar box tidak mentok */
  }

  .auth-container {
    padding: 25px 20px; /* Menyesuaikan padding dalam box agar pas di HP */
    border-radius: 18px;
  }

  .auth-container::after {
    border-radius: 16px;
  }

  .auth-logo h2 {
    font-size: 20px;
  }

  .form-control {
    padding: 12px 14px 12px 38px;
    font-size: 13px;
  }
}

/* Custom Styling untuk SweetAlert2 Pop-up */
.swal2-popup-custom {
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  padding: 30px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
}

.swal2-title-custom {
  color: #ffffff !important;
  font-size: 22px !important;
  font-weight: 700 !important;
}

.swal2-html-custom {
  color: #9ca3af !important;
  font-size: 14px !important;
}

.swal2-btn-confirm {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  padding: 10px 24px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.swal2-btn-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  padding: 10px 24px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

/* Styling Pop-up Tengah yang Lebih Kecil & Rapi (Compact) */
.swal2-popup.swal2-popup-compact {
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7) !important;
}

.swal2-title.swal2-title-compact {
  font-size: 18px !important;
  font-weight: 700 !important;
  margin-top: 10px !important;
}

.swal2-html-container.swal2-html-compact {
  font-size: 13px !important;
  color: #9ca3af !important;
}

.swal2-styled.swal2-btn-compact {
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 8px 20px !important;
  margin-top: 15px !important;
}
