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;
}

.logo-img {
  position: fixed;
  top: 15px;
  left: 25px;
  height: 45px;
  width: auto;
  z-index: 3000;
}

.signup-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) {
  .signup-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;
  }
}

.signup-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;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

input[type="date"] {
  padding-right: 2.5rem;
  color-scheme: dark;
  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;
  padding-right: 2.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;
  font-family: 'OpenAI Sans', sans-serif;
  font-size: inherit;
  cursor: pointer;
  position: relative;
}

input[type="date"]: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;
}

/* Hide the default date format text */
input[type="date"]::-webkit-datetime-edit-text {
  color: transparent;
}

input[type="date"]::-webkit-datetime-edit-month-field {
  color: transparent;
}

input[type="date"]::-webkit-datetime-edit-day-field {
  color: transparent;
}

input[type="date"]::-webkit-datetime-edit-year-field {
  color: transparent;
}

/* Show actual date when selected */
input[type="date"]:valid::-webkit-datetime-edit-text {
  color: white;
}

input[type="date"]:valid::-webkit-datetime-edit-month-field {
  color: white;
}

input[type="date"]:valid::-webkit-datetime-edit-day-field {
  color: white;
}

input[type="date"]:valid::-webkit-datetime-edit-year-field {
  color: white;
}

/* Special handling for date input labels */
input[type="date"]:not([value=""]) ~ .custom-label,
input[type="date"]:valid ~ .custom-label {
  opacity: 0;
}

input[type="date"]:invalid ~ .custom-label,
input[type="date"][value=""] ~ .custom-label {
  opacity: 1;
  top: 50%;
  left: 1.5rem;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #ffffff;
}

#gender {
  padding-left: 1.4rem;
  padding-right: 1rem;
  text-indent: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  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;
  padding-left: 1.4rem;
  padding-right: 2.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;
  font-family: 'OpenAI Sans', sans-serif;
  font-size: inherit;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
}

#gender: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;
}

#gender option {
  background-color: #2a2a2a;
  color: white;
}

#gender-container .custom-label {
  top: 50%;
  font-size: 1rem;
  color: #ffffff;
  transform: translateY(-50%);
}

#gender:valid ~ .custom-label {
  opacity: 0;
}

/* Show label when no option is selected */
#gender:invalid ~ .custom-label,
#gender[value=""] ~ .custom-label {
  opacity: 1;
  top: 50%;
  left: 1.5rem;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #ffffff;
}

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

.terms-note {
  font-size: 0.7rem !important;
  line-height: 1.4;
  text-align: center !important;
  color: #ccc;
}

.terms-note a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  margin: 0 2px;
}

.terms-note a:hover {
  color: #00ffff;
}

/* Mobile Responsive Styles */
@media (max-width: 991px) {
  .signup-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) {
  .logo-img {
    height: 35px;
    top: 10px;
    left: 15px;
  }

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

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

  /* Stack form fields vertically on mobile */
  .flex.flex-wrap.-mx-2 {
    flex-direction: column;
    margin: 0;
  }

  .flex.flex-wrap.-mx-2 > div {
    width: 100%;
    padding: 0;
    margin-bottom: 0.75rem;
  }

  .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;
  }

  .terms-note {
    font-size: 0.75rem !important;
    padding: 0 10px;
  }
}

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

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

  .signup-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;
  }

  /* Mobile label positioning for date and gender on small screens */
  input[type="date"]:invalid ~ .custom-label,
  input[type="date"][value=""] ~ .custom-label {
    opacity: 1;
    top: 50%;
    left: 0.8rem;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #ffffff;
  }

  #gender:invalid ~ .custom-label,
  #gender[value=""] ~ .custom-label {
    opacity: 1;
    top: 50%;
    left: 0.8rem;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #ffffff;
  }

  /* Adjust dropdown arrow for small screens */
  #gender {
    background-position: right 0.6rem center;
    background-size: 12px;
    padding-right: 2rem;
  }

  /* Adjust spacing for very small screens */
  .flex.flex-wrap.-mx-2 > div {
    margin-bottom: 0.5rem;
  }

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

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

  .terms-note {
    font-size: 0.7rem !important;
    line-height: 1.3;
  }

  /* 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) {
  .logo-img {
    height: 40px;
    top: 12px;
    left: 20px;
  }

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

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

  /* Two columns for tablets */
  .flex.flex-wrap.-mx-2 {
    flex-direction: row;
    margin: 0 -8px;
  }

  .flex.flex-wrap.-mx-2 > div {
    width: 50%;
    padding: 0 8px;
    margin-bottom: 1rem;
  }

  .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) {
  .signup-form {
    right: 150px;
    width: 520px;
  }
}

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

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

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

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

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

  .custom-input {
    padding: 1rem 0.9rem;
    padding-top: 1.5rem;
    padding-bottom: 0.3rem;
  }

  .flex.flex-wrap.-mx-2 > div {
    margin-bottom: 0.5rem;
  }
}

/* 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 select dropdown for mobile */
@media (max-width: 768px) {
  #gender {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Better date picker on mobile */
  input[type="date"] {
    font-size: 16px;
    padding: 1.2rem 1rem;
    padding-right: 2.5rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
  }

  input[type="date"]::-webkit-calendar-picker-indicator {
    width: 100%;
    height: 100%;
    right: 0;
    top: 0;
    z-index: 5;
  }

  #gender {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 1.2rem 1rem;
    padding-left: 1.2rem;
    padding-right: 2.5rem;
    display: flex;
    align-items: center;
    background-position: right 0.8rem center;
    background-size: 14px;
  }

  /* Mobile label positioning for date and gender */
  input[type="date"]:invalid ~ .custom-label,
  input[type="date"][value=""] ~ .custom-label {
    opacity: 1;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: #ffffff;
  }

  #gender:invalid ~ .custom-label,
  #gender[value=""] ~ .custom-label {
    opacity: 1;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: #ffffff;
  }
}