body {
  font-family: 'OpenAI Sans', sans-serif;
  margin: 0;
  padding: 0;
  background-image: url('../images/background2.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

.brand-logo {
  position: fixed;
  top: 15px;
  left: 25px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  z-index: 3000;
}

.logo-img {
  height: 52px;
  width: auto;
  transform: none;
}

.login-form {
  width: 90%;
  max-width: 500px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  margin: 0 auto;
  margin-top: 100px;
}

@media (min-width: 992px) {
  .login-form {
    position: absolute;
    top: 50%;
    right: 100px;
    transform: translateY(-50%);
    width: 500px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0;
  }
}

.login-form h2 {
  font-weight: 500;
  margin-bottom: 30px;
  color: #fff;
  font-size: 2.5rem;
  text-align: center;
}

.fancy-fullstop {
  font-weight: 900;
  background: linear-gradient(45deg, #ff4dff, #00ffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.small-note {
  text-align: center;
  font-size: 0.95rem;
  color: #ccc;
  margin-bottom: 30px;
}

.custom-form-floating {
  position: relative;
  margin-bottom: 1rem;
}

.custom-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 8px;
  padding: 1.5rem 1.5rem;
  width: 100%;
  height: auto;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.custom-input:focus {
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
  background: rgba(40, 44, 52, 0.9);
  outline: none;
}

.custom-input::placeholder {
  color: transparent;
}

.custom-label {
  position: absolute;
  top: 50%;
  left: 1.5rem;
  transform: translateY(-50%);
  color: #fff;
  font-weight: 500;
  pointer-events: none;
  transition: all 0.3s ease;
  background: transparent;
  padding: 0 4px;
}

.custom-input:focus ~ .custom-label,
.custom-input:not(:placeholder-shown) ~ .custom-label,
.custom-input:valid ~ .custom-label,
.custom-input.has-value ~ .custom-label {
  top: 0.5rem;
  left: 1.5rem;
  font-size: 0.75rem;
  color: #ccc;
  transform: none;
  opacity: 0;
}

/* Show labels only when input is empty and not focused */
.custom-input:placeholder-shown:not(:focus) ~ .custom-label {
  opacity: 1;
}

/* Hide labels when input has content */
.custom-input:not(:placeholder-shown) ~ .custom-label,
.custom-input.has-value ~ .custom-label {
  opacity: 0;
}

#togglePassword {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.2rem;
  user-select: none;
  z-index: 10;
}

/* Mobile Responsive Styles */
@media (max-width: 991px) {
  .login-form {
    position: relative;
    width: 90%;
    max-width: 500px;
    margin: 0 auto;
    margin-top: 20px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
  }
}

@media (max-width: 768px) {
  .brand-logo {
    top: 10px;
    left: 15px;
  }

  .logo-img {
    height: 40px;
  }

  .login-form {
    width: 95%;
    padding: 20px;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.5);
  }

  .login-form h2 {
    font-size: 2rem;
    margin-bottom: 20px;
  }

  .custom-input {
    padding: 1.2rem 1rem;
    font-size: 16px; /* Prevents zoom on iOS */
    display: flex;
    align-items: center;
  }

  .custom-label {
    left: 1rem;
    font-size: 0.9rem;
  }

  .custom-input:focus ~ .custom-label,
  .custom-input:not(:placeholder-shown) ~ .custom-label,
  .custom-input:valid ~ .custom-label,
  .custom-input.has-value ~ .custom-label {
    opacity: 0;
  }

  .custom-input:placeholder-shown:not(:focus) ~ .custom-label {
    opacity: 1;
  }

  #togglePassword {
    right: 1rem;
    font-size: 1.1rem;
  }

  /* Better touch targets for mobile */
  button {
    min-height: 48px;
  }
}

@media (max-width: 480px) {
  .brand-logo {
    top: 8px;
    left: 10px;
  }

  .logo-img {
    height: 34px;
  }

  .login-form {
    width: 90%;
    padding: 25px;
    margin-top: 10px;
    margin-bottom: 20px;
  }

  .login-form h2 {
    font-size: 1.75rem;
    margin-bottom: 15px;
  }

  .custom-input {
    padding: 1rem 0.8rem;
    font-size: 16px;
    display: flex;
    align-items: center;
  }

  .custom-label {
    left: 0.8rem;
    font-size: 0.85rem;
  }

  .custom-input:focus ~ .custom-label,
  .custom-input:not(:placeholder-shown) ~ .custom-label,
  .custom-input:valid ~ .custom-label,
  .custom-input.has-value ~ .custom-label {
    opacity: 0;
  }

  .custom-input:placeholder-shown:not(:focus) ~ .custom-label {
    opacity: 1;
  }

  #togglePassword {
    right: 0.8rem;
    font-size: 1rem;
  }

  .mt-8 {
    margin-top: 1.5rem !important;
  }

  .mt-6 {
    margin-top: 1rem !important;
  }

  /* Mobile tagline adjustments */
  .text-3xl {
    font-size: 1.75rem !important;
  }

  .pt-20 {
    padding-top: 4rem !important;
  }

  .pb-6 {
    padding-bottom: 1rem !important;
  }
}

/* Tablet Responsive Styles */
@media (min-width: 769px) and (max-width: 991px) {
  .brand-logo {
    top: 12px;
    left: 20px;
  }

  .logo-img {
    height: 44px;
  }

  .login-form {
    width: 85%;
    max-width: 450px;
    padding: 25px;
    margin-top: 30px;
  }

  .login-form h2 {
    font-size: 2.25rem;
  }

  .custom-input {
    padding: 1.3rem 1.2rem;
    display: flex;
    align-items: center;
  }

  /* Mobile tagline for tablets */
  .text-3xl {
    font-size: 2.5rem !important;
  }
}

/* Large screen adjustments */
@media (min-width: 1200px) {
  .login-form {
    right: 150px;
    width: 520px;
  }
}

@media (min-width: 1400px) {
  .login-form {
    right: 200px;
  }
}

/* Ultra-wide screen adjustments */
@media (min-width: 1600px) {
  .login-form {
    right: 250px;
    width: 540px;
  }

  .login-form h2 {
    font-size: 2.75rem;
  }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
  .login-form {
    margin-top: 40px;
    margin-bottom: 40px;
    padding: 15px;
  }

  .login-form h2 {
    font-size: 1.75rem;
    margin-bottom: 15px;
  }

  .custom-input {
    padding: 1rem 0.9rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  body {
    background-attachment: scroll; /* Better performance on high DPI */
  }
}

/* Focus and accessibility improvements */
.custom-input:focus {
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
  background: rgba(40, 44, 52, 0.9);
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* Better error states for accessibility */
.custom-input.error {
  border-color: #ff4444 !important;
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.5) !important;
}

.field-error {
  color: #ff4444;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: block;
}

/* Loading state for form submission */
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* Improved responsive design for mobile */
@media (max-width: 768px) {
  .custom-input {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 1.2rem 1rem;
    display: flex;
    align-items: center;
  }
}