/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* BODY */
body {
  background: #fdfaf6;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* CONTAINER */
.container {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #f3e7ce;
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 40px 50px;
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.15);
  width: 100%;
  max-width: 450px;
  animation: fadeIn 0.8s ease-in-out;
}

/* LOGO */
.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid #d4af37;
  background: white;
  padding: 5px;
}

/* HEADER */
header {
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 25px;
  color: #3a3a3a;
}

/* FIELD (floating label style) */
.field {
  position: relative;
  margin-bottom: 25px;
}

/* INPUT FIELD */
.input {
  width: 100%;
  padding: 14px 45px 14px 40px;
  border: 1px solid #e6d8b3;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #3a3a3a;
  outline: none;
  font-size: 15px;
  transition: 0.3s ease;
}

.input:focus {
  border-color: #d4af37;
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.3);
}

/* FLOATING LABEL */
.field label {
  position: absolute;
  top: 50%;
  left: 40px;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 15px;
  pointer-events: none;
  transition: 0.3s ease all;
}

/* Bila input aktif atau ada isi */
.input:focus+label,
.input:not(:placeholder-shown)+label {
  top: 0;
  left: 38px;
  font-size: 13px;
  color: #b59b3d;
  background: #fff;
  padding: 0 5px;
}


/* ICON DALAM INPUT */
.icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 20px;
  color: #c1a75b;
}

/* EYE ICON */
.eye-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 20px;
  color: #b59b3d;
  transition: 0.3s;
}

.eye-icon:hover {
  color: #d4af37;
}

/* FORGOT PASSWORD */
.form-link {
  text-align: right;
  margin-bottom: 20px;
}

.form-link a {
  color: #997f23;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.form-link a:hover {
  text-decoration: underline;
  color: #c9a72d;
}

/* BUTTON */
.button-field button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #d4af37, #f5deb3, #e6be8a);
  background-size: 200% 200%;
  /* penting untuk animation */
  color: #3a3a3a;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
  animation: gradientMove 4s ease infinite;
  /* animation aktif */
}

/* Hover effect: laju sikit + zoom in */
.button-field button:hover {
  transform: scale(1.05);
  animation: gradientMove 2s ease infinite;
  /* laju bila hover */
}

/* Keyframes untuk gradient bergerak */
@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}


/* SIGNUP LINK */
.form-link span {
  display: block;
  text-align: center;
  color: #6b6b6b;
  font-size: 17px;
}

.form-link .link {
  color: #b59b3d;
  text-decoration: none;
  font-weight: 500;
  font-size: 17px;
}

.form-link .link:hover {
  text-decoration: underline;
  color: #d4af37;
}
/* ===================== ERROR STATES ===================== */

/* Global error (contoh: account inactive) */
.global-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 77, 77, 0.12);
  color: #d90429;
  padding: 12px 15px;
  border: 1px solid #ff4d4d;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 20px;
  animation: fadeIn 0.4s ease;
}

.global-error i {
  font-size: 20px;
  color: #d90429;
}

/* Input field error */
.field.error .input {
  border: 1.8px solid #ff4d4d;
  box-shadow: 0 0 6px rgba(255, 77, 77, 0.25);
}

/* 🌟 Error Icon Inside Input */
.field.error .icon {
  color: #ff4d4d;
  position: relative;
  top: 45px; /* 🔥 naikkan sikit icon kiri */
}

.field.error .eye-icon {
  color: #ff4d4d;
  position: relative;
  top: 45px; /* 🔥 naikkan sikit icon mata juga */
}

.field.error label {
  color: #ff4d4d;
}

/* 🌟 Error Text Under Field */
.error-text {
  font-size: 14px;
  color: #ff4d4d;
  margin-top: 2px; /* 🔥 rapatkan sikit ke bawah input */
  margin-left: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeIn 0.4s ease;
  line-height: 1.2; /* ✨ bagi spacing vertikal kecil */
}

.error-text i {
  font-size: 17px;
  color: #ff4d4d;
  position: relative;
  top: -2px; /* ✅ naikkan icon sikit */
}


/* Tambahan: transition smooth bila error muncul */
.input,
.label,
.error-text {
  transition: 0.3s ease all;
}


/* ANIMATION */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .container {
    padding: 30px 25px;
  }

  header {
    font-size: 24px;
  }
}