/* ----- GLOBAL STYLES ----- */
:root {
  --main-padding: clamp(1rem, 2vw, 2.5rem);
  --heading-size: clamp(2rem, 5vw, 4.75rem);
  --subtext-size: clamp(1rem, 2vw, 1.75rem);
  --form-width: clamp(300px, 90%, 600px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  background-color: #002856;  /* UC Merced Blue */
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- HEADER ----- */
.header {
  position: fixed;
  top: clamp(20px, 4vh, 30px);
  left: clamp(20px, 15vw, 300px);
  z-index: 10;
  width: clamp(150px, 20vw, 300px);
}

.logo img {
  width: 100%;
  height: auto;
  max-width: 300px;
  transition: transform 0.2s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

/* ----- MAIN CONTAINER ----- */
.main-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  padding: var(--main-padding);
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  position: relative; /* Added to contain the absolute watermark */
}

/* ----- LEFT SECTION ----- */
.left-section {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
  padding: var(--main-padding);
  margin: 1rem;
}

.left-heading-container {
  margin-bottom: 1rem;
  margin-top: 1rem;
}

.left-heading {
  font-size: var(--heading-size);
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: #ffffff;
  letter-spacing: -1px;
}

.left-subtext {
  font-size: var(--subtext-size);
  font-weight: 400;
  margin-bottom: 2.5rem;
  color: #d1d1d1;
}

/* ----- LEFT CONTENT ----- */
.left-main-content {
  margin-top: 0;
}

.left-main-content h2.inline-text {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 1rem;
  max-width: 600px;
  line-height: 1.5;
  text-align: left;
  display: block;
}

.learn-more-btn {
  text-decoration: none;
  background-color: #F2A341;
  color: #ffffff;
  padding: 1rem 2rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: fit-content;
  font-size: 1.1rem;
  margin-top: 2rem;
}

.learn-more-btn:hover {
  background-color: #d68936;
}

/* ----- WATERMARK ----- */
.watermark {
  position: absolute; /* Changed from fixed to absolute */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(80vh, 80vw);
  height: min(80vh, 80vw);
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  background: none;
}

.watermark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.25;
  mix-blend-mode: screen;
}

/* ----- RIGHT SECTION ----- */
.right-section {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
  padding: var(--main-padding);
  margin: 1rem;
}

/* ----- FORM CONTAINER ----- */
.form-container {
  width: var(--form-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
}

/* ----- LOGIN/SIGNUP BOX ----- */
.input-row {
  background-color: rgba(217, 217, 217, 0.3);
  padding: var(--main-padding);
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 0 20px rgba(0,0, 0, 0.2);
}

.input-row h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.5px;
  color: #ffffff;
}

/* Two-line heading for forgot/reset password pages */
.input-row .two-line-heading {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 0.9;
}

.input-row .two-line-heading span {
  display: block;
}

/* Timer text for forgot password */
.timer-text {
  font-size: 0.85rem;
  color: #aaa;
  text-align: center;
  margin-top: 0.5rem;
}

/* ----- FORM ELEMENTS ----- */
.form-control {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(217, 217, 217, 0.5);
  border-radius: 4px;
  font-size: 1rem;
  color: #ffffff;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: #F2A341;
  box-shadow: 0 0 5px rgba(242, 163, 65, 0.5);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #ffffff;
  font-size: 0.9rem;
}

/* ----- BUTTONS ----- */
.submit-container {
  margin-top: 1rem;
  width: 100%;
}

input[type="submit"], .btn {
  width: 100%;
  padding: 1rem;
  background-color: #F2A341;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 1rem;
}

input[type="submit"]:hover, .btn:hover {
  background-color: #d68936;
}

/* ----- ALERTS & ERRORS ----- */
.error {
  color: #ff4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

.alert {
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease-in-out;
}

.alert-danger {
  background-color: rgba(255, 68, 68, 0.1);
  color: #ff4444;
  border: 1px solid #ff4444;
}

.alert-success {
  background-color: rgba(0, 200, 81, 0.1);
  color: #00c851;
  border: 1px solid #00c851;
}

/* ----- LINKS ----- */
.signup-link, .login-link {
  text-align: center;
  margin-top: 1rem;
}

.signup-link a, .login-link a {
  color: #F2A341;
  text-decoration: underline;
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.3s ease;
}

.signup-link a:hover, .login-link a:hover {
  color: #d68936;
}

.back-to-login {
    text-align: center;
    margin-top: 1rem;
  }
  
  .back-to-login a {
    color: #F2A341;
    text-decoration: underline;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.3s ease;
  }
  
  .back-to-login a:hover {
    color: #d68936;
  }

/* Forgot password link styling */
.forgot-password-link {
  text-align: right;
  margin-top: -1rem;
  margin-bottom: 1rem;
}

.forgot-password-link a {
  color: #F2A341;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  transition: color 0.3s ease;
}

.forgot-password-link a:hover {
  color: #d68936;
  text-decoration: underline;
}

/* ----- SECTION DIVIDER ----- */
.section-divider {
  width: 200px;
  height: 3px;
  background-color: #ffffff;
  margin: 15rem 0 5rem 0;
  border: none;
  display: block;
}

/* ----- RESPONSIVE STYLES ----- */
@media screen and (max-width: 1400px) {
  .left-section {
    left: calc(50% - 300px);
    width: 500px;
  }
  
  .right-section {
    left: calc(50% + 30px);
    width: 500px;
  }
  
  .header {
    left: calc(50% - 300px);
  }
}

@media screen and (max-width: 1200px) {
  .main-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    position: relative;
    overflow-y: visible;
  }
  
  .left-section, 
  .right-section {
    position: relative;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    margin: 2rem 0;
    width: 90%;
    max-width: 600px;
  }
  
  .left-section {
    margin-top: 150px;
  }
  
  .header {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    display: flex;
    justify-content: center;
  }
}

@media screen and (max-width: 768px) {
  .main-container {
    flex-direction: column;
    padding: 1rem;
  }

  .left-section,
  .right-section {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    margin: 0.5rem;
  }

  .form-container {
    width: 100%;
  }

  .header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(150px, 50vw, 250px);
  }
  
  .logo img {
    height: 100px;
  }
  
  .left-heading {
    font-size: 3rem;
  }
  
  .left-subtext {
    font-size: 1.25rem;
  }
  
  .input-row h1 {
    font-size: 2.5rem;
  }
  
  .input-row {
    padding: 1.5rem;
  }
}

@media screen and (max-width: 480px) {
  .left-heading {
    font-size: 2.5rem;
  }
  
  .left-subtext {
    font-size: 1rem;
  }
  
  .input-row h1 {
    font-size: 2rem;
  }
  
  .form-control {
    padding: 0.7rem;
    margin-bottom: 1rem;
  }
  
  input[type="submit"] {
    padding: 0.9rem;
  }
  
  .logo img {
    max-height: 140px;
  }
}

@media screen and (max-height: 700px) {
  .left-heading-container {
    margin-bottom: 2rem;
  }
  
  .right-section {
    margin-top: 0;
  }
  
  .input-row {
    aspect-ratio: auto;
    padding: 1.5rem;
  }
}

@media screen and (max-width: 350px) {
  .left-heading {
    font-size: 2rem;
  }
  
  .input-row {
    padding: 1rem;
  }
  
  .form-control {
    margin-bottom: 0.8rem;
  }
}

@media screen and (max-height: 800px) and (min-width: 1200px) {
  .input-row {
    aspect-ratio: auto;
    padding: 2rem;
  }
  
  .left-heading-container {
    margin-bottom: 5rem;
  }
}

/* Animation for alerts */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}