/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  font-family: "Poppins", sans-serif;
  background-color: #f0f2f5;
  background-image: url(./img/ssfo-background.png);
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

.login-container {
  background-color: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  max-width: 350px;
  width: 100%;
  text-align: center;
}

.login-header img {
  width: 70px;
  margin-bottom: 5px;
}

.login-header h1 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #e70022;
}

.login-form h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.login-form p {
  margin-bottom: 20px;
  font-size: 14px;
  color: #555;
}

.register-link {
  text-align: center;
  margin-top: 1.5rem;
}

.register-link a {
  color: #e70022;
  text-decoration: none;
}

.register-link a:hover {
  text-decoration: none;
}

.terms {
  text-align: center;
  font-size: 0.8rem;
  color: #666;
  margin-top: 1rem;
}

.terms a {
  color: #e70022;
  text-decoration: none;
}

.terms a:hover {
  text-decoration: underline;
}

.form-group {
  position: relative;
  margin-bottom: 20px;
}

.form-group input {
  width: 100%;
  padding: 12px 40px; /* Adjust padding to fit icon and text */
  border-radius: 8px;
  border: 1px solid #e70022;
  background: #f9f9f9;
  color: #333;
  font-size: 14px;
  outline: none;
}

.form-group i.icon-left {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: #e70022;
  font-size: 16px;
  pointer-events: none; /* Prevent interaction with icon */
}

.form-group i.icon-right {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  color: #e70022;
  cursor: pointer;
}

.form-group input:focus {
  border-color: #e70022;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.actions label {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.actions a {
  color: #e70022;
  text-decoration: none;
  font-size: 0.9rem;
}

.actions a:hover {
  text-decoration: underline;
}

.error-message {
  font-size: 12px;
  color: #ff4d4d;
  position: absolute;
  bottom: -18px;
  left: 0;
  display: flex;
  align-items: center;
}

.error-message i {
  margin-right: 5px;
}

button[type="submit"] {
  width: 100%;
  padding: 12px;
  background-color: #e70022;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
}

button[type="submit"]:hover {
  background-color: #c7001a;
}

.general-error-message,
.success-message {
  font-size: 14px;
  margin-top: -10px;
  margin-bottom: 2em;
}

.general-error-message {
  color: #ff4d4d;
}

.success-message {
  color: #4caf50;
}

/* Hide error icon initially */
.error-message i {
  display: none;
}

/* Display error icon when error message is shown */
.error-message.show-icon i {
  display: inline;
}

.login-footer {
  margin-top: 20px;
}

.login-footer a {
  color: #e70022;
  text-decoration: none;
  font-size: 14px;
}

/* Responsive Styles */
@media (max-width: 600px) {
  .login-container {
    padding: 20px;
    max-width: 90%;
    margin-top: -4em;
  }

  .form-group input {
    font-size: 12px;
    padding: 10px 35px;
  }

  .login-header img {
    width: 70px;
  }

  .login-header h1 {
    font-size: 25px;
  }

  button[type="submit"] {
    font-size: 14px;
  }
}

/* LOADING OVERLAY */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Darker semi-transparent background */
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000; /* Ensure it appears above other content */
  font-family: "Poppins", sans-serif; /* Ensure font consistency with your application */
}

.loading-spinner {
  border: 8px solid rgb(255, 255, 255);
  border-radius: 50%;
  border-top: 8px solid #e70022;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

.loading-overlay p {
  margin-top: 15px; /* Space between the spinner and text */
  font-size: 18px; /* Larger font size for better visibility */
  font-weight: 500; /* Medium weight for a polished look */
  text-align: center; /* Center the text */
}

/* Spin animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
