/* Login Page Styles */

body {
  font-family: "Roboto Slab", serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #2a4d72; /* Fallback color */
  
  /* Basic background image fallback */
  background-image: url('../../images/index/login-bg.png');
  
  /* Modern browsers with WebP support */
  background-image: url('../../images/index/login-bg.webp');
  
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  display: flex;
  flex-direction: column;
}

/* Main login container */
.login-container {
  background-color: #1a2c3f;
  color: white;
  padding: 2em;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: min(100%, 480px); /* Slightly reduced from 600px for better proportions */
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease-in-out;
  max-height: fit-content; /* Limit height to fit content on non-mobile */
}

/* Responsive behavior */
@media (max-width: 600px) {
  .login-container {
    width: 100%;
    height: 100%;
    max-height: 100%; /* Override fit-content for mobile */
    border-radius: 0;
    box-shadow: none;
  }
  
  body {
    padding: 0;
  }
}

/* Logo styling */
.login-container .logo-container {
  height: fit-content;
  z-index: 5;
  transition: transform 0.3s ease;
  margin-bottom: 1.5em;
}

.login-container .logo-container .large-logo {
  display: block;
  width: 60%;
  margin: 0 auto;
  transition: all 0.3s ease;
}

/* Tenant container */
.login-container .tenant-container {
  width: 60%;
  margin: 0 auto;
  padding: 1em;
  object-fit: contain;
}

.login-container .tenant-container h1 {
  font-family: "Roboto Slab", serif;
  margin-bottom: 1em;
  text-align: center;
  font-size: 2.5em;
}

.login-container .tenant-container .logo {
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

/* Form styling */
.form {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: opacity 0.3s ease-out;
}

.form.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.input_container {
  width: 100%;
  margin-top: auto;
  text-align: left;
  z-index: 1;
  position: relative;
}

.input_container h1 {
  text-align: center;
  margin-bottom: 1em;
}

/* Labels and text */
.label, 
.input_container h1,
.title h2,
.reset-notice p,
.login-container .tenant-container h1 {
  color: white;
}

.label[hidden],
.label.hidden {
  display: none;
  height: 0;
  margin: 0;
  padding: 0;
  visibility: hidden;
}

.password-label {
  margin-top: 1em;
  background: none;
  text-align: left;
  border: none;
}

/* Title styling */
.title {
  text-align: center;
  margin-bottom: 1.5em;
}

.title h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

/* Input fields and grid system */
.input-wrapper {
  max-height: fit-content;
  margin-top: 0.15em;
  display: grid;
  grid-template-columns: 1fr auto;
  width: 100%;
  margin-bottom: 1.5em;
}

.input-wrapper .no_b_margin {
  margin: 0 !important;
  margin-top: 0 !important;
  grid-column: 1/3;
  grid-row: 1/2;
  z-index: 2;
  width: 100%;
}

/* Toggle password visibility button */
.input-wrapper .toggle-password {
  position: relative;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: auto 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  grid-column: 2/3;
  grid-row: 1/2;
  z-index: 99;
  padding: 0 0.5em;
}

.input-wrapper .eye {
  height: 1.5em;
  width: 1.5em;
  z-index: 99;
}

/* Input styling */
.login-container input {
  width: 100%;
  height: 40px;
  border: 1px solid #3a4b5c;
  border-radius: 4px;
  background-color: #273748;
  padding: 1ch;
  font-size: .9em;
  color: white;
  margin-bottom: 1em;
}

.login-container input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* Button styling */
.login-container .button {
  width: 100%;
  border-radius: 4px;
  text-align: center;
  padding: 0.5em 1em;
  height: 35px;
  font-size: .9em;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.login-container .button:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.login-container .cta-button {
  background-color: #4cc9f0;
  color: #0a2540;
  font-weight: 700;
  width: 100%;
  height: 40px;
}

.login-container .cta-button:hover {
  background-color: #5bd3fa;
}

/* Error notifications */
.login-container .notification-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.login-container .notification-container .error-popup {
  position: relative;
  background-color: #ffebee;
  color: #c62828;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-top: 2em;
  animation: fadeInOut 4s forwards;
  pointer-events: none;
}

.error {
  background-color: #ffebee;
  color: #c62828;
  padding: 0.5em 1em;
  margin: 0.5em 0;
  border: 1px solid #ef5350;
  border-radius: 4px;
  text-align: center;
  font-weight: 500;
  width: 100%;
  animation: fadeIn 0.5s ease-in;
}

/* Password requirements */
.password-requirements {
  padding-left: 1em;
  border-radius: 30px;
  width: 100%;
  z-index: 99;
  margin: 0 0 1.5em;
}

/* Active state */
.input-wrapper .active {
  background: #ECFBFE;
  color: #000000;
  padding: 0.5em 1em;
  border-radius: 4px;
  margin-bottom: 2em;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
}

/* Reset password notice */
.reset-notice p {
  margin-bottom: 1.5em;
  line-height: 1;
  font-size: 0.8rem;
}

/* Animations */
@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
    visibility: hidden;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}




/* Hide tenant logo when needed */
.hide-tenant-logo {
  display: none;
}