/* ==========================
   Global Styles (MODIFIED FOR MOBILE)
========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
}

body {
  background: linear-gradient(to bottom, #ffffff 40%, #057ebb 40%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  /* breathing room on small screens */
}

#loginContainer {
  max-width: 70vw;
  min-width: 70vw;
  min-height: 100vh;
  max-height: 100vh;
  padding-top: 3%;
  padding-bottom: 3%;
  align-items: center;
  /* vertical centering */
}

/* LOGIN CARD – REFINED FOR MOBILE */
.login-card {
  max-width: 30vw;
  min-width: 30vw;
  max-height: 75vh;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  z-index: 3;
  transform: translateY(0%);
  display: flex;
  flex-direction: column;
}

.login-content {
  padding: 10% 10% 10% 10%;
  /* reduced vertical padding */
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

/* Logo – responsive scaling */
.login-content .logo {
  display: block;
  width: 100%;
  max-width: 150px;
  /* slightly smaller default */
  height: auto;
  margin: 0 auto 20px;
  /* reduced bottom margin */
  object-fit: contain;
}

/* Alternative fixed size – kept but adaptive */
.login-content .logo {
  width: clamp(120px, 25vw, 150px);
  /* fluid between 120-150px */
  height: auto;
  margin: 0 auto 25px;
  display: block;
}

/* HEADINGS – mobile friendly font sizes */
.login-content h1.fw-bold {
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  /* responsive range */
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.login-content h1.fw-bold:last-of-type {
  font-size: clamp(1rem, 3.8vw, 1.6rem);
  color: #057ebb;
  margin-bottom: 0.5rem;
}

/* FORM GROUP – better touch spacing */
.form-group {
  position: relative;
  width: 100%;
  margin-bottom: 6px;
  /* slightly reduced, better on mobile */
  display: flex;
  align-items: center;
}

/* Input Icons – keep proportional */
.form-group>ion-icon:first-child {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 20px;
  pointer-events: none;
  z-index: 2;
}

/* Input Fields – increased touch friendliness */
.form-group input {
  width: 100%;
  padding: 14px 50px 14px 45px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  /* base, no auto-zoom on iOS */
  outline: none;
  transition: all 0.3s ease;
  background-color: #fff;
  box-sizing: border-box;
  -webkit-appearance: none;
  /* remove iOS inner shadow */
  appearance: none;
}

/* Password input specific */
.form-group input[type="password"],
.form-group input[type="text"] {
  padding-right: 50px;
}

/* Toggle Password – larger hit area */
#togglePassword {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  color: #666;
  transition: color 0.3s ease;
  padding: 8px;
  /* bigger tap target */
}

#togglePassword ion-icon {
  font-size: 22px;
  pointer-events: none;
}

/* Form Options – improved mobile layout */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0 25px;
  /* reduced vertical */
  width: 100%;
  font-size: 15px;
  flex-wrap: wrap;
  /* allow wrap on tiny screens */
  gap: 10px;
}

.form-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #000000;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  /* slightly smaller */
}

.form-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #057ebb;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.form-options a {
  color: #000000;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 2px;
  white-space: nowrap;
  /* keep on one line */
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  /* more vertical padding, touch friendly */
  border: none;
  border-radius: 4px;
  /* slightly more modern */
  font-size: clamp(16px, 4vw, 20px);
  /* responsive text */
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(5, 126, 187, 0.2);
  line-height: 1.2;
}

.button i {
  margin-right: 8px;
  font-size: 0.9em;
}

/* SIGNUP CARD – transformed for mobile stacking */
.signup-card {
  background: url("../../Assets/Images/Login/Sign In Page.jpg") center/cover no-repeat;
  /* min-height: 80vh;
  max-height: 80vh; */
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transform: translateX(-10%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  /* IMPORTANT: column direction */
  overflow-y: auto;
  /* ENABLE VERTICAL SCROLLING */
  max-height: 80vh;
  /* constrain height */
  min-height: 60vh;
  /* minimum height */

  /* Hide scrollbar for cleaner look (optional) */
    scrollbar-width: thin;
    scrollbar-color: #057ebb #f0f0f0;
}

/* Custom scrollbar for Webkit browsers */
.signup-card::-webkit-scrollbar {
  width: 5px;
}

.signup-card::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.signup-card::-webkit-scrollbar-thumb {
  background: #057ebb;
  border-radius: 10px;
}

.signup-card::-webkit-scrollbar-thumb:hover {
  background: #046a9e;
}

.signup-content {
  padding: 15% 15% 15% 15%;
  color: white;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* keep terms at bottom */
}

.signup-content h2 {
  font-weight: 700;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.signup-content p {
  font-size: clamp(0.95rem, 3.5vw, 1.5rem);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* SIGNUP BUTTON – inherit from .button but with specific size */
#btnRegister {
  background-color: #057ebb !important;
  color: white !important;
  border: 2px solid transparent;
  font-size: clamp(16px, 4vw, 22px);
  padding: 12px 24px;
  width: 100%;
  max-width: 280px;
  /* not too wide */
  margin: 0 auto;
  /* center */
  border-radius: 4px;
}

#terms {
  background-color: rgba(214, 214, 214, 0.4);
  /* softer than original hex */
  padding: 12px 15px;
  border-radius: 10px;
  margin-top: 40px !important;
}

#terms ul {
  text-align: left;
  font-size: 0.8rem;
  /* smaller base for mobile */
  margin: 0;
  padding-left: 20px;
}

#terms li {
  margin-bottom: 6px;
  line-height: 1.4;
}

/* =================================================================
   COMPREHENSIVE MOBILE RESPONSIVE OVERRIDES
   - Stack cards vertically on small screens
   - Full width, better font & spacing
   - Preserve original layout above 992px
================================================================= */

/* Tablet and below – keep side by side but scale */
@media (min-width: 1200px){

  .signup-card {
    min-height: 80vh;
    max-height: 80vh;
    min-width: 30vw;
    max-width: 30vw;
  }
}

@media (max-width: 1120px) {

  .signup-content h2 {
    font-size: 1.5rem;
  }

  .signup-content p {
    font-size: 1.1rem;
  }
}

/* ========== MOBILE STACKING (<= 768px) ========== */
@media (max-width: 1120px) {
  body {
    background: linear-gradient(to bottom, #ffffff 30%, #057ebb 30%);
    /* adjust split */
    padding: 10px;
    align-items: flex-start;
    /* top alignment for scroll */
  }

  #loginContainer {
    max-width: 100%;
    min-width: 100%;
    flex-direction: column;
    /* STACK CARDS */
    padding: 15px 0;
    min-height: auto;
    max-height: none;
    gap: 20px;
  }

  /* Cards full width, remove transforms */
  .login-card {
    max-width: 100%;
    min-width: 100%;
    max-height: none;
    transform: none;
    border-radius: 20px;
    margin-bottom: 0;
    order: 1;
    /* login first */
  }

  .signup-card {
    max-width: 100%;
    min-width: 100%;
    transform: none;
    border-radius: 20px;
    order: 2;
    /* signup second */
  }

  .login-content {
    padding: 40px 30px;
    /* more comfortable on mobile */
  }

  .login-content .logo {
    max-width: 130px;
    margin-bottom: 20px;
  }

  .form-group input {
    padding: 16px 50px 16px 45px;
    /* taller touch area */
    font-size: 16px;
    /* prevent zoom */
  }

  .button {
    padding: 16px 20px;
    font-size: 18px;
  }

  .signup-content {
    width: 100%;
    padding: 40px 30px;
  }

  .signup-content h2 {
    font-size: 1.8rem;
  }

  .signup-content p {
    font-size: 1.2rem;
  }

  #btnRegister {
    max-width: 100%;
    padding: 14px 20px;
    font-size: 18px;
  }

  #terms ul {
    font-size: 0.85rem;
  }

  .form-options {
    flex-direction: row;
    /* keep side by side if space */
    justify-content: space-between;
  }

  .form-options a {
    white-space: nowrap;
  }
}

/* ========== SMALL PHONES (<= 480px) ========== */
@media (max-width: 480px) {
  body {
    background: linear-gradient(to bottom, #ffffff 25%, #057ebb 25%);
    padding: 8px;
  }

  .login-content {
    padding: 30px 20px;
  }

  .login-content .logo {
    max-width: 110px;
    margin-bottom: 15px;
  }

  .login-content h1.fw-bold {
    font-size: 1.3rem;
  }

  .login-content h1.fw-bold:last-of-type {
    font-size: 1.1rem;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-group input {
    padding: 14px 45px 14px 40px;
    font-size: 15px;
  }

  .form-group>ion-icon:first-child {
    font-size: 18px;
    left: 12px;
  }

  #togglePassword {
    right: 8px;
    padding: 6px;
  }

  #togglePassword ion-icon {
    font-size: 20px;
  }

  .form-options {
    gap: 12px;
    margin: 15px 0 25px;
  }

  .form-options label {
    font-size: 14px;
  }

  .form-options a {
    font-size: 14px;
    white-space: normal;
    /* allow wrap if needed */
  }

  .button {
    padding: 14px 20px;
    font-size: 17px;
    border-radius: 8px;
  }

  .signup-content {
    padding: 30px 20px;
  }

  .signup-content h2 {
    font-size: 1.5rem;
  }

  .signup-content p {
    font-size: 1rem;
  }

  #btnRegister {
    padding: 14px 20px;
    font-size: 17px;
  }

  #terms {
    padding: 12px;
    margin-top: 20px;
  }

  #terms ul {
    font-size: 0.8rem;
    padding-left: 18px;
  }

  #terms li {
    margin-bottom: 5px;
  }
}

/* Very tiny screens (<= 360px) */
@media (max-width: 360px) {
  .login-content h1.fw-bold {
    font-size: 1.1rem;
  }

  .login-content h1.fw-bold:last-of-type {
    font-size: 1rem;
  }

  .form-group input {
    padding: 12px 40px 12px 35px;
    font-size: 14px;
  }

  .button {
    font-size: 16px;
    padding: 12px 16px;
  }

  .signup-content h2 {
    font-size: 1.3rem;
  }

  .signup-content p {
    font-size: 0.9rem;
  }
}

/* Preserve original layout for large screens */
@media (min-width: 1200px) {
  #loginContainer {
    max-width: 70vw;
    min-width: 70vw;
    transform: translateX(5%);
  }

  .login-card {
    max-width: 30vw;
    min-width: 30vw;
  }

  .signup-card {
    max-width: 35vw;
    min-width: 35vw;
  }
}

/* Keep all hover/focus states, animations intact */
#btnLogin:hover {
  background-color: #046a9e !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(5, 126, 187, 0.3);
}

#btnLogin:active {
  transform: translateY(0);
}

#btnLogin:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(5, 126, 187, 0.3);
}

#btnLogin::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

#btnLogin:hover::after {
  width: 300px;
  height: 300px;
}

/* Loading state (optional) */
#btnLogin.loading {
  opacity: 0.8;
  cursor: wait;
  pointer-events: none;
}

#btnLogin.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Form underline animation – kept */
.form-options .text-decoration-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #057ebb;
  transition: width 0.3s ease;
}

.form-options .text-decoration-underline:hover::after {
  width: 100%;
}

/* Touch-friendly hover removal for mobile */
@media (hover: none) and (pointer: coarse) {
  #btnLogin:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(5, 126, 187, 0.2);
  }

  #btnLogin:hover::after {
    display: none;
  }
}