/* login.css */

/* Vertically center the login card within the viewport. */
body.login-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Wrapper that centers content and applies padding. */
#loginMain {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2em 1em;
  box-sizing: border-box;
}

/* Stack the login and signup prompt cards. */
#loginContent {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}

/* Shared card styling used for login form and signup prompt. */
#loginCard,
#signupPrompt {
  background-color: #fff;
  border-radius: 12px;
  padding: 2em;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  color: #2a2a2a;
}

/* Heading inside the login card. */
#loginCard h2 {
  margin-top: 0;
  color: #2a6a4f;
  font-size: 1.8em;
}

/* Layout for the stacked login fields. */
#loginForm {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
}

/* Label styling above each input. */
#loginForm label {
  font-size: 0.95em;
  color: #444;
}

/* Inputs for email/password fields. */
#loginForm input {
  width: 100%;
  margin-top: 0.35em;
  padding: 0.75em;
  border-radius: 6px;
  border: 1px solid #cfd8d5;
  font-size: 1em;
  box-sizing: border-box;
}

/* Focus outline for login inputs. */
#loginForm input:focus {
  outline: 2px solid #2a6a4f;
  border-color: transparent;
}

/* Primary sign-in button styling. */
#submitLogin {
  background-color: #2a6a4f;
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 0.9em;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

/* Hover state for the login button. */
#submitLogin:hover {
  background-color: #21513c;
}

/* Forgot-password link under the form. */
#forgotPasswordLink {
  display: inline-block;
  margin-top: 0.4em;
  font-size: 0.95em;
  color: #2a6a4f;
  text-decoration: none;
}

/* Underline the forgot link on hover. */
#forgotPasswordLink:hover {
  text-decoration: underline;
}

/* Secondary card inviting the user to sign up. */
#signupPrompt {
  align-self: flex-start;
  background-color: rgba(255, 255, 255, 0.9);
}

/* Heading text inside the signup prompt card. */
.prompt-heading {
  margin: 0;
  font-size: 1.2em;
  color: #2a6a4f;
}

/* Call-to-action link inside the signup prompt. */
#createAccountLink {
  margin-top: 0.6em;
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  color: #1c7c62;
}

/* Underline the signup link on hover. */
#createAccountLink:hover {
  text-decoration: underline;
}

/* Place login form and signup prompt side-by-side on desktops. */
@media (min-width: 700px) {
  #loginContent {
    flex-direction: row;
    align-items: stretch;
  }

  #loginCard {
    flex: 2;
  }

  #signupPrompt {
    flex: 1;
  }
}

/* Password reset modal shell. */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5em;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 2em;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 0.75em;
  right: 0.75em;
  background: transparent;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  line-height: 1;
}

#passwordResetForm {
  display: flex;
  flex-direction: column;
  gap: 0.9em;
  margin-top: 1em;
}

#passwordResetForm input {
  width: 100%;
  padding: 0.75em;
  border-radius: 6px;
  border: 1px solid #cfd8d5;
  box-sizing: border-box;
}

#passwordResetSubmit {
  background: #2a6a4f;
  border: none;
  color: #fff;
  padding: 0.85em;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.modal-feedback {
  min-height: 1.2em;
  margin-top: 0.75em;
  font-size: 0.95em;
  color: #2a6a4f;
}

.modal-feedback.error {
  color: #b91c1c;
}
