/* CSS Variables for easy theme customization */
:root {
  --primary-color: #6c5ce7;
  --secondary-color: #8c7ae6;
  --background-gradient: linear-gradient(135deg, #a29bfe, #6c5ce7);
  --text-color-dark: #333;
  --text-color-light: #777;
  --input-border-color: #e0e0e0;
  --input-focus-color: #6c5ce7;
  --box-shadow-light: 0 10px 30px rgba(0, 0, 0, 0.08);
  --box-shadow-medium: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* --- Global Reset and Body Styling --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--background-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  /* penting: cegah kontainer melebar ke samping */
  padding: 20px;
}

/* --- Main Login Container --- */
.login-container {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1000px;
  /* batasi supaya tidak melebar */
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--box-shadow-medium);
  min-height: 500px;
  max-height: 95vh;
  /* penting: batasi tinggi maksimum */
  overflow-y: auto;
  /* scroll kalau konten terlalu panjang */
  margin: auto;
  /* center di halaman */
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
    width: 100%;
    border-radius: 10px;
    min-height: auto;
    max-height: none;
    height: auto;
  }

  .login-form-section {
    width: 100%;
    padding: 30px 20px;
  }

  .login-illustration-section {
    display: none;
    /* sembunyikan gambar di layar kecil */
  }

  body {
    align-items: flex-start;
    padding: 20px;
  }
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- Left Section: Login Form --- */
.login-form-section {
  /* === PERUBAHAN DI SINI === */
  /* Berikan lebar tetap pada kontainer form */
  flex: 0 0 500px;
  /* flex-grow: 0, flex-shrink: 0, flex-basis: 500px */
  padding: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.login-header h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-color-dark);
  margin-bottom: 5px;
}

.login-header p {
  font-size: 1rem;
  color: var(--text-color-light);
  margin-bottom: 40px;
}

/* Form Options (Remember Me & Forgot Password) */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
  border-radius: 4px;
}

.form-options label,
.form-options a {
  color: var(--text-color-light);
}

.forgot-password {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* Login Button */
.login-button {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: var(--background-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.3);
}

.login-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(108, 92, 231, 0.4);
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 5px 15px rgba(108, 92, 231, 0.2);
}

/* Social Login Section */
.social-login {
  margin-top: 40px;
  text-align: center;
  position: relative;
}

/* 'or' separator line */
.social-login p {
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 25px;
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 10px;
  background-color: #fff;
}

.social-login::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--input-border-color);
  z-index: 0;
}

.social-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 25px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid var(--input-border-color);
  color: var(--text-color-dark);
  background: #fff;
  transition: all 0.3s ease;
  box-shadow: var(--box-shadow-light);
}

.social-button i {
  font-size: 1.3rem;
}

.social-button.google i {
  color: #db4437;
}

.social-button.facebook i {
  color: #1877f2;
}

.social-button:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  background-color: #fafaff;
}

/* Signup Link */
.signup-link {
  margin-top: 35px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-color-light);
}

.signup-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.3s ease;
}

.signup-link a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* --- Right Section: Illustration (PERUBAHAN UTAMA) --- */
.login-illustration-section {
  /* Flexbox akan mengambil sisa ruang */
  flex: 1;
  background: rgb(150, 156, 240);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  /* Pastikan tidak ada padding */
  position: relative;
  overflow: hidden;
}

.login-illustration-section img {
  /* === PERUBAHAN DI SINI === */
  /* Tampilkan gambar secara utuh, sesuaikan ukurannya */
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Ini kuncinya: tampilkan seluruh gambar tanpa dipotong */
  object-position: center;
  animation: floatImage 4s ease-in-out infinite alternate;
}

/* Animasi untuk ilustrasi */
@keyframes floatImage {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-5px);
  }
}

/* Responsive Design (juga disesuaikan) */
@media (max-width: 992px) {
  .login-container {
    max-width: 90%;
    /* Kembali ke flex: 1; untuk kedua sisi saat di tablet */
    flex-direction: row;
  }

  .login-form-section {
    flex: 1;
    /* Kembalikan ke 50/50 */
    padding: 40px;
  }

  .login-illustration-section {
    flex: 1;
    /* Kembalikan ke 50/50 */
    padding: 20px;
    display: flex;
    /* Pastikan tetap terlihat di tablet */
  }
}

@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
    transform: none;
    animation: none;
  }

  .login-form-section {
    padding: 30px 25px;
  }

  .login-illustration-section {
    display: none;
    /* Sembunyikan ilustrasi di layar kecil */
  }

  body {
    align-items: flex-start;
    padding-top: 50px;
  }
}

.overlay-text {
  position: absolute;
  top: 30px;
  /* Jarak dari atas */
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 3px 15px rgba(0, 0, 0, 0.5);
  z-index: 3;
  text-align: center;
  white-space: nowrap;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  /* ruang kiri untuk icon */
  border: 2px solid var(--input-border-color);
  border-radius: 10px;
  font-size: 1rem;
  background-color: #f9f9f9;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-wrapper input:focus {
  border-color: var(--input-focus-color);
  background-color: #fff;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.15);
  outline: none;
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #bbb;
  pointer-events: none;
  transition: color 0.3s ease;
}

.input-wrapper input:focus ~ .input-icon {
  color: var(--input-focus-color);
}

input[type="password"] {
  padding-right: 40px;
  /* Beri ruang untuk ikon mata */
}

/* Tambahkan sedikit CSS untuk ikon mata agar lebih rapi */
.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #ccc;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #ccc;
}

input[type="password"] {
  padding-right: 40px;
  /* Beri ruang untuk ikon mata */
}
