/* ==== Base Styles ==== */
body {
  position: relative;
  background-color: #127658;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden; /* prevent horizontal scroll */
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url(../img/login_images/bgpattern.png) center/cover repeat;
  opacity: 0.15;
  z-index: -1;
}

/* ==== Container ==== */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  gap: 60px; /* spacing between panels */
  padding: 40px 60px;
  box-sizing: border-box;
  flex-wrap: nowrap; /* NEVER stack panels */
}

/* ==== Left Panel ==== */
.welcome-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  padding: 30px;
  max-width: 600px;
  min-width: 300px; /* ensure it doesn't shrink too small */
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.app-logo img {
  width: 130px;
  height: auto;
  border-radius: 20px;
  max-width: 100%;
}

.brand-text h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.brand-text .subtitle {
  font-size: 1rem;
  font-style: italic;
  margin: 0;
}

.welcome-panel .tagline {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 30px;
  font-style: italic;
}

.welcome-panel .feature {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 5px 0;
  font-size: 1.1rem;
}

.welcome-panel .feature img {
  width: 35px;
  height: 35px;
}

/* ==== Right Panel ==== */
.login-panel {
  flex: 1;
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  color: #333;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.15);
  max-width: 450px;
  min-width: 300px; /* maintain proportion */
  transform: translateX(-30px); /* slightly right visually */
}

.login-panel h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 10px;
  color: #127658;
}

/* ==== Role Buttons + Slider ==== */
.btn-role {
  display: flex;
  position: relative;
  gap: 10px;
  margin-bottom: 10px;
}

.btn-role button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 20px;
  background: #b1d8cc;
  cursor: pointer;
  font-weight: 600;
  color: #127658;
  transition: 0.3s;
  position: relative;
  z-index: 1;
}

.btn-role button.active {
  background-color: #127658;
  color: white;
}

.slider {
  position: absolute;
  bottom: -10px;
  left: 0;
  height: 3px;
  background: #127658;
  width: 50%;
  border-radius: 2px;
  z-index: 0;
  transition: transform 0.3s ease;
}

/* ==== Forms ==== */
.form {
  display: flex;
  flex-direction: column;
}

.form label {
  font-size: 0.9rem;
  margin: 10px 0 5px;
  color: #127658;
}

.form input {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 0.95rem;
}

.form input:focus {
  outline: none;
  border: 1px solid #127658;
  box-shadow: 0 0 5px rgba(26, 122, 77, 0.4);
}

.forgot {
  text-align: end;
  margin: 10px 0 25px;
}

.forgot a {
  color: #127658;
  text-decoration: none;
  font-size: 0.9rem;
}

.forgot a:hover {
  text-decoration: underline;
}

.form button.btn {
  background: #127658;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 10px;
  padding: 12px;
  border: none;
  cursor: pointer;
  transition: 0.3s;
}

.form button.btn:hover {
  background: #0f5e46;
}

/* ==== Logos ==== */
.login-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.login-logos img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.login-logos img:hover {
  transform: scale(1.1);
}

/* ==== Form Box Toggle ==== */
.form-box {
  display: none;
}

.form-box.active {
  display: block;
}

/* ==== Tablets and PCs (Landscape or Portrait) ==== */
@media (max-width: 1280px) {
  .container {
    gap: 40px;
    padding: 30px 40px;
  }

  .welcome-panel,
  .login-panel {
    max-width: 50%;
  }

  .brand-text h1 {
    font-size: 1.8rem;
  }

  .welcome-panel .tagline {
    font-size: 1.2rem;
  }

  .login-panel h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 1024px) {
  .container {
    gap: 30px;
    padding: 20px 30px;
  }

  .welcome-panel,
  .login-panel {
    max-width: 48%;
  }

  .brand-text h1 {
    font-size: 1.6rem;
  }

  .welcome-panel .tagline {
    font-size: 1.1rem;
  }

  .login-panel h2 {
    font-size: 1.6rem;
  }
}

/* ==== Phones are not modified; horizontal scroll applied ==== */
@media (max-width: 767px) {
  .container {
    flex-wrap: nowrap; /* force side by side */
    overflow-x: auto;
  }

  .welcome-panel,
  .login-panel {
    min-width: 360px;
  }
}
