:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --accent-color: #198754;
  --light-color: #f8f9fa;
  --dark-color: #212529;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url("../../images/laposa.jfif");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.login-container {
  max-width: 400px; /* narrower max width */
  width: 100%; /* take full width up to max */
  margin: auto; /* center horizontally */
  padding: 20px;
  position: relative;
  z-index: 1;
}

.system-title {
  text-align: center;
  margin-bottom: 30px;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.system-title h1 {
  font-size: 3em;
  font-weight: 700;
  color: white;
  margin-bottom: 0.2rem;
}

.system-title p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
}

.card {
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  background-color: rgba(255, 255, 255, 0.95);
  margin: 0 auto; /* ensure card stays centered */
}

.card-body {
  padding: 30px;
}

.form-control {
  border-radius: 8px;
  padding: 12px 15px;
  border: 1px solid #ced4da;
  background-color: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
}

.form-control:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  border-color: var(--primary-color);
}

.form-label {
  font-weight: 600;
  color: var(--dark-color);
}

.btn-primary {
  padding: 12px;
  font-weight: 600;
  border-radius: 8px;
  background-color: var(--primary-color);
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(13, 110, 253, 0.5);
}

.alert-danger {
  border-radius: 8px;
  background-color: rgba(220, 53, 69, 0.9);
  color: white;
  border: none;
}

.input-group {
  position: relative;
}

.input-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary-color);
  cursor: pointer;
  z-index: 10;
}

.back-to-home {
  text-align: center;
  margin-top: 20px;
}

.back-to-home a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.back-to-home a:hover {
  color: var(--primary-color);
}

.water-drop {
  position: absolute;
  width: 15px;
  height: 15px;
  background-color: rgba(13, 110, 253, 0.7);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  animation: fall linear infinite;
  z-index: 0;
  will-change: transform, opacity;
}

@keyframes fall {
  0% {
    transform: translateY(-100vh) rotate(-45deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(-45deg);
    opacity: 0;
  }
}

/* Smooth fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Card entrance animation */
@keyframes cardEntrance {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Form field animation */
@keyframes fieldEntrance {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Apply animations */
.system-title {
  animation: fadeIn 0.8s ease-out forwards;
}

.card {
  animation: cardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0; /* Start invisible */
  transform-origin: center;
}

.form-control,
.btn {
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Staggered animation for form fields */
.mb-4 {
  opacity: 0;
  animation: fieldEntrance 0.5s ease-out forwards;
}

.mb-4:nth-child(1) {
  animation-delay: 0.3s;
}
.mb-4:nth-child(2) {
  animation-delay: 0.4s;
}
.mb-4:nth-child(3) {
  animation-delay: 0.5s;
}
