* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: linear-gradient(
    135deg,
    #1e40af 0%,
    #3b82f6 25%,
    #60a5fa 75%,
    #dbeafe 100%
  );
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Animated background elements */
.bg-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.floating-shape {
  position: absolute;
  opacity: 0.1;
  animation: float 6s ease-in-out infinite;
}

.floating-shape:nth-child(1) {
  top: 10%;
  left: 10%;
  width: 80px;
  height: 80px;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 50%;
  animation-delay: 0s;
}

.floating-shape:nth-child(2) {
  top: 60%;
  right: 15%;
  width: 120px;
  height: 120px;
  background: rgba(96, 165, 250, 0.15);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation-delay: 2s;
}

.floating-shape:nth-child(3) {
  bottom: 20%;
  left: 20%;
  width: 60px;
  height: 60px;
  background: rgba(30, 64, 175, 0.25);
  border-radius: 50%;
  animation-delay: 4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 50px 40px;
  border-radius: 24px;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.05);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    #1e40af,
    #3b82f6,
    #60a5fa,
    #3b82f6,
    #1e40af
  );
  background-size: 300% 100%;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin-bottom: 35px;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 30px;
}

.logo {
  width: auto;
  max-width: 180px;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.greeting {
  font-size: 1.8rem;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #1e40af, #3b82f6, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  width: 100%;
  position: relative;
}

.subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0;
  font-weight: 400;
  text-align: center;
  width: 100%;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  position: relative;
  text-align: left;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  z-index: 2;
  transition: color 0.3s ease;
  width: 18px;
  height: 18px;
}

.input-field {
  width: 100%;
  padding: 16px 20px 16px 50px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 400;
  background: #fafafa;
  transition: all 0.3s ease;
  outline: none;
}

.input-field:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.input-field:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: #3b82f6;
}

.password-wrapper {
  position: relative;
}

.password-field {
  padding-right: 60px;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #64748b;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.toggle-password:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.login-button {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-top: 10px;
}

.login-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.login-button:hover::before {
  left: 100%;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(30, 64, 175, 0.4);
}

.login-button:active {
  transform: translateY(0);
}

.error-message {
  color: #dc2626;
  background: rgba(254, 226, 226, 0.9);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  border: 1px solid rgba(254, 202, 202, 0.8);
  animation: shake 0.5s ease-in-out;
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-message.show {
  display: flex;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.forgot-password {
  text-align: center;
  margin-top: 20px;
}

.forgot-password a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.forgot-password a:hover {
  color: #1e40af;
  text-decoration: underline;
}

.contact-admin {
  margin-top: 15px;
  font-size: 0.9rem;
  color: #64748b;
}

.contact-admin a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.contact-admin a:hover {
  color: #1e40af;
  text-decoration: underline;
}

/* Loading spinner */
#loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Responsive design */
@media (max-width: 480px) {
  .login-container {
    padding: 15px;
  }

  .login-box {
    padding: 35px 25px;
    border-radius: 20px;
  }

  .greeting {
    font-size: 1.5rem;
  }

  .logo {
    max-width: 140px;
  }

  .input-field,
  .login-button {
    font-size: 0.95rem;
    padding: 14px 18px 14px 48px;
  }

  .input-icon {
    left: 18px;
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 360px) {
  .login-box {
    padding: 30px 20px;
  }

  .greeting {
    font-size: 1.3rem;
  }

  .logo {
    max-width: 120px;
  }
}
