/* General Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: url('background.jpg') no-repeat center center/cover;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Loader Overlay */
.loader-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.45));
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  opacity: 1;
  visibility: visible;
}
.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-inner {
  /* removed card-style so logo sits directly on overlay */
  background: transparent;
  padding: 8px 12px;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none; /* don't intercept clicks */
}
.loader-logo {
  width: 200px;
  height: auto;
  display: block;
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  /* make the rise animation last the full intro duration */
  animation: riseLogo 5s cubic-bezier(.16,.85,.24,1) forwards;
}
.loader-text {
  font-weight: 900;
  color: #ffffff; /* strong white */
  font-size: 1.45rem;
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 5s ease forwards; /* matches intro length */
  animation-delay: 0.12s;
}
.loader-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  pointer-events: none;
  opacity: 1; /* visible immediately */
  animation: gradientIn 5s ease forwards; /* subtle change over time */
}
.dot-loader {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.dot {
  width: 12px;
  height: 12px;
  background: #ff9d00;
  border-radius: 50%;
  opacity: 0.95;
  transform: translateY(0);
  animation: dotBounce 1s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: 0.12s; }
.dot:nth-child(3) { animation-delay: 0.24s; }

@keyframes dotBounce {
  0% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-10px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.6; }
}

@keyframes riseLogo {
  0% { transform: translateY(48px) scale(0.88); opacity: 0; }
  40% { transform: translateY(-12px) scale(1.06); opacity: 0.95; }
  75% { transform: translateY(4px) scale(0.995); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes gradientIn {
  0% { opacity: 0; transform: translateY(18px); }
  60% { opacity: 0.4; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* logo swap animations */
.loader-logo.swap-out {
  animation: logoSwapOut 240ms ease forwards;
}
.loader-logo.swap-in {
  animation: logoSwapIn 300ms cubic-bezier(.2,.9,.2,1) forwards;
}
@keyframes logoSwapOut {
  0% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0.86) translateY(-8px); }
}
@keyframes logoSwapIn {
  0% { opacity: 0; transform: scale(0.86) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Pop-in animation for login card when showing */
.login-card {
  transform-origin: center;
  transition: transform 260ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease;
}
.login-card.pop-in {
  animation: popIn 260ms cubic-bezier(.2,.9,.2,1) forwards;
}
@keyframes popIn {
  0% { transform: scale(0.96) translateY(6px); opacity: 0; }
  60% { transform: scale(1.03) translateY(-6px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}


/* Hide main content while loader is active */
.main-content.hidden { visibility: hidden; }


/* Header */
.site-header {
  display: flex;
  align-items: center;
  background: #004225;
  color: white;
  padding: 10px 20px;
}

.site-logo {
  width: 40px;
  height: auto;
  object-fit: contain;
  margin-right: 10px;
}

.site-name {
  font-size: 1.5rem;
  font-weight: bold;
}

/* Main Login Card */
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.login-card {
  background: #00512e;
  color: white;
  max-width: 400px;
  width: 100%;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
}

.school-logo {
  width: 80px;
  margin-bottom: 15px;
}

.login-card h2 {
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.login-card p {
  margin-bottom: 20px;
  color: #dcdcdc;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.login-form label {
  font-size: 0.95rem;
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
  background-color: #fff;
  color: #000;
}

.password-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

/* Checkbox and links */
.form-options {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: #fff;
}

.form-options a {
  color: #b2ffb2;
  text-decoration: none;
  margin-left: 10px;
}

/* Button */
button[type="submit"] {
  background: #8fd19e;
  color: #003d1c;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

button[type="submit"]:hover {
  background: #76c789;
}

/* Footer */
.site-footer {
  background: #004225;
  color: white;
  text-align: center;
  padding: 15px;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 500px) {
  .login-card {
    padding: 20px;
  }

  .form-options {
    flex-direction: column;
    gap: 10px;
  }

  .form-options div {
    display: flex;
    gap: 10px;
  }
}
