:root {
  --bg-dark: #0f172a;
  --glass-bg: rgba(30, 41, 59, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --accent-blue: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.5);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --danger: #ef4444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* --- GLOBAL FIXED LAYOUT (DESKTOP ONLY) --- */
html,
body {
  width: 100%;
  /* Paksa lebar minimal 1200px agar HP melakukan zoom out */
  min-width: 1200px;

  min-height: 100vh;
  margin: 0;
  padding: 0;

  background-color: var(--bg-dark);
  color: var(--text-primary);

  /* Center Content Vertically & Horizontally */
  display: grid;
  place-items: center;

  overflow-x: auto; /* Munculkan scrollbar bawah jika layar terlalu kecil (safety) */
  position: relative;
}

/* --- BACKGROUND FX --- */
.bg-glow {
  position: absolute;
  width: 800px;
  height: 800px; /* Diperbesar untuk desktop view */
  border-radius: 50%;
  filter: blur(120px);
  z-index: -2;
  opacity: 0.3;
  animation: breathe 10s infinite ease-in-out;
}
.top-right {
  top: -20%;
  right: -10%;
  background: var(--accent-blue);
}
.bottom-left {
  bottom: -20%;
  left: -10%;
  background: #10b981;
  animation-delay: 5s;
}

/* Grid Pattern Halus */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
  mask-image: radial-gradient(circle, black 40%, transparent 80%);

  /* Pastikan grid menutupi area yang luas */
  min-width: 1200px;
  min-height: 100vh;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.4;
  }
}

/* --- CARD CONTAINER (FIXED CENTER) --- */
.login-container {
  width: 100%;
  min-width: 1200px; /* Ikuti lebar body */
  padding: 0; /* Reset padding agar benar-benar tengah */
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
  position: relative;
  z-index: 10;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;

  /* Ukuran Kartu Diperbesar Sedikit untuk Desktop View */
  width: 480px;
  padding: 50px 45px;

  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  margin: 0; /* Hapus margin auto */
}

/* --- HEADER ANIMATION --- */
.login-header {
  text-align: center;
  margin-bottom: 35px;
}

.icon-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 15px;
}
.icon-circle {
  width: 90px;
  height: 90px;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.2),
    rgba(37, 99, 235, 0.1)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #60a5fa;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.icon-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: var(--accent-blue);
  border-radius: 50%;
  z-index: 1;
  opacity: 0.3;
  animation: pulseWave 2s infinite;
}
@keyframes pulseWave {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.5;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
  }
}

.login-header h2 {
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 5px;
  font-size: 1.8rem;
}
.login-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* --- INPUT FIELDS (Modern) --- */
.input-group {
  margin-bottom: 10px; /* Dikurangi dari 25px agar lebih rapat */
  position: relative;
}
.input-wrapper {
  position: relative;
}

input {
  width: 100%;
  height: 60px; /* Lebih tinggi dikit */
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 0 50px; /* Padding kiri ikon */
  color: white;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

/* Floating Label Logic */
label {
  position: absolute;
  left: 50px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  transition: 0.3s ease;
  font-size: 1rem;
  background: transparent;
  padding: 0 5px;
}

input:focus,
input:not(:placeholder-shown) {
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

input:focus ~ label,
input:not(:placeholder-shown) ~ label {
  top: 0;
  left: 25px;
  font-size: 0.85rem;
  color: var(--accent-blue);
  background: #0f172a;
  font-weight: 600;
  z-index: 10;
}

/* Icons */
.input-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: 0.3s;
}
input:focus ~ .input-icon {
  color: var(--accent-blue);
}

.toggle-password {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  cursor: pointer;
  transition: 0.3s;
  padding: 5px;
  font-size: 1.1rem;
}
.toggle-password:hover {
  color: white;
}

/* --- CAPTCHA GRID SYSTEM --- */
.captcha-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 10px;
  /* Margin atas bawah dikurangi dari 30px menjadi 20px */
  margin-top: 5px;
  margin-bottom: 20px;
}

.captcha-display {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed var(--glass-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px; /* Samakan tinggi input */
  position: relative;
}

.captcha-code {
  font-family: "Courier New", monospace;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--accent-blue);
  letter-spacing: 0px;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
  white-space: nowrap;
  overflow: hidden;
}

.refresh-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 3px;
  transition: 0.3s;
  display: flex;
  align-items: center;

  /* TAMBAHKAN BARIS INI: */
  margin-left: 15px; /* Memberi jarak dari teks kode di kirinya */
}
.refresh-btn:hover {
  color: white;
  transform: rotate(180deg);
}

.captcha-input-wrapper {
  position: relative;
  height: 60px;
}
.captcha-input-wrapper input {
  width: 100%;
  height: 100%;
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 0 10px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 12px;
  font-size: 1rem;
}
.captcha-input-wrapper input::placeholder {
  font-size: 0.8rem;
  letter-spacing: 0;
  opacity: 0.5;
}

/* --- BUTTONS --- */
.btn-login-gradient {
  width: 100%;
  height: 60px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  color: white;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
  transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-login-gradient:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(37, 99, 235, 0.6);
}
.btn-login-gradient:active {
  transform: scale(0.98);
}

.btn-text {
  font-size: 1.1rem;
  font-weight: 600;
}
.btn-icon {
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* Back Home Button */
.back-home-wrapper {
  margin-top: 25px;
  text-align: center;
  border-top: 1px solid rgb(72, 72, 72);
  padding-top: 10px;
}

.btn-back-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 25px;
  border-radius: 50px;
  transition: all 0.3s ease;
  background: transparent;
}
.btn-back-home:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(-5px);
}
.btn-back-home i {
  font-size: 0.9rem;
  transition: transform 0.3s;
}
.btn-back-home:hover i {
  transform: translateX(-3px);
}

/* --- ERROR ALERT --- */
.alert-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 15px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
  font-size: 0.95rem;
  animation: shake 0.4s ease;
}
.alert-box.hidden {
  display: none;
}
.alert-icon {
  color: #ef4444;
  font-size: 1.2rem;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

/* --- ENTRANCE ANIMATIONS --- */
.animate-card {
  animation: cardEnter 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
  transform: translateY(30px);
}
.animate-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}
.delay-1 {
  animation-delay: 0.1s;
}
.delay-2 {
  animation-delay: 0.2s;
}
.delay-3 {
  animation-delay: 0.3s;
}

@keyframes cardEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* HIDE UNUSED */
.checkbox-container,
.custom-checkbox,
.forgot-link,
.form-options {
  display: none !important;
}
