/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Prevent horizontal scroll */
  width: 100%; /* Ensure page width matches viewport */
  background-color: #eef6fc; /* Matches background to avoid white gaps */
}

/* Body Style: Center Form in the Middle */
body {
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh; /* Full-screen centering */
}

/* Align the back button text to the left */
.back-btn {
  margin-top: 2rem;
  width: 100%;
  text-align: left;
  max-width: 500px;
}

.back-btn a {
  text-decoration: none; /* Remove underline */
  color: #004d66; /* Choose a color for the back button */
  font-size: 16px; /* Set the font size */
  display: inline-flex; /* To align the icon and text properly */
  align-items: center;
}

.back-btn a::before {
  content: "<"; /* Add the "<" symbol before the text */
  font-size: 20px; /* Size of the symbol */
  margin-right: 8px; /* Add some space between the "<" and the text */
}

.form-title {
  text-align: center;
  color: #044c4e;
  margin: 30px 0 30px;
}

/* Form Container */
.form-container {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 4px 4px 100px 10px #00000026;
  width: 100%;
  max-width: 500px; /* Limit max width for larger screens */
  padding: 30px;
  position: relative;
  overflow: hidden; /* Prevent overflow issues */
  min-height: 600px; /* Ensure consistent height for both forms */
  margin-top: 10px;
  margin-bottom: 40px;
}

/* Form Content */
.form-content {
  display: none; /* Hide forms by default */
  width: 100%; /* Consistent width */
}

.form-content.active-form {
  display: block; /* Show the active form */
}

/* Forgot Password Link */
.forgot-password {
  display: block;
  text-align: center;
  margin: 20px 0 20px;
  font-size: 0.9em;
  color: #004d66;
  text-decoration: none;
  transition: color 0.3s ease-in-out;
}

.forgot-password:hover {
  color: #00384d;
}

/* Toggle Buttons: Sign Up / Log In */
.tab-group {
  list-style: none;
  padding: 0;
  margin: 15px auto;
  display: flex; /* Flexbox for equal spacing */
  justify-content: space-evenly;
  width: 70%;
  border-radius: 10px; /* Rounded corners for the container */
  overflow: hidden; /* Ensures buttons stay within the rounded container */
}

.tab-group li {
  flex: 1; /* Equal width for tabs */
  text-align: center;
}

.tab-group li a {
  display: block;
  text-decoration: none;
  padding: 10px 20px;
  background: rgba(160, 179, 176, 0.25);
  color: #a0b3b0;
  font-size: 18px;
  transition: background 0.3s ease, color 0.3s ease;
  border-radius: 0; /* No border-radius on individual buttons */
}

.tab-group li a:hover {
  background: #3daaa5;
  color: #ffffff;
}

.tab-group .active a {
  background: #166d70;
  color: #ffffff;
}

/* Form Group Styling */
.form-group {
  position: relative;
  width: 100%;
  margin-bottom: 15px;
}

.form-group input {
  border: 2px solid #ccc;
  width: 100%;
  font-size: 1rem;
  padding: 1rem 0.5rem;
  outline: none;
  background: transparent;
  border-radius: 5px;
  transition: border 0.3s ease-in-out;
}

.form-group input:focus {
  border-color: #004d66;
}

.form-group label {
  position: absolute;
  top: 50%;
  left: 2.15rem;
  padding: 0 4px;
  font-size: 1em;
  pointer-events: none;
  transform: translateY(-50%);
  transition: all 0.3s ease-in-out;
  background: #fff;
}

.form-group input:is(:focus, :valid) + label {
  top: 0;
  font-size: 0.85em;
  color: #004d66;
  padding: 0 4px;
}

/* Icon Styling */
.form-group .icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
  opacity: 0.7;
}

/* Adjust Input Padding to Make Space for Icon */
.form-group input {
  padding-left: 2.5rem;
}

/* Submit Button */
.get-started {
  display: flex;
  justify-content: center;
  width: 65%;
  padding: 12px;
  background-color: #004d66;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  font-size: 1.1em;
  cursor: pointer;
  margin: 0 auto;
  transition: background-color 0.3s;
}

.get-started:hover {
  background-color: #00384d;
}

.log-in-btn {
  display: flex;
  justify-content: center;
  width: 65%;
  padding: 12px;
  background-color: #004d66;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  font-size: 1.1em;
  cursor: pointer;
  margin: 0 auto;
  transition: background-color 0.3s;
}

.log-in-btn:hover {
  background-color: #00384d;
}

.state-autocomplete-wrapper {
  position: relative;
  margin-bottom: 15px;
}

.state-autocomplete-wrapper .form-group {
  margin-bottom: 0;
}

#state-suggestions-container {
  margin-top: 5px;
  border-radius: 5px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  border: 1px solid #1a629e;
  position: relative;
  z-index: 10;
  padding: 10px;
  background: #f6fbff;
  box-shadow: 0px 4px 4px 0px #00000040;
}

.suggestion-item {
  color: #152850;
  font-size: 16px;
  font-weight: 600;
  line-height: 18px;
  margin-bottom: 5px;
  cursor: pointer;
}

.suggestion-item:last-child {
  margin-bottom: none;
}

.suggestion-item:hover {
  background-color: #eef6fc;
}

/* Error css */
.form-group.has-error input {
  border-color: #dc3545;
}

.form-group.has-error label {
  color: #dc3545;
}

.error-message-container {
  margin-top: 5px;
  padding-left: 2.15rem;
}

.error-message {
  color: #dc3545;
  font-size: 0.85em;
  display: none;
  margin-bottom: 3px;
}

.error-message::before {
  content: "•";
  margin-right: 5px;
}

/* For form-wide errors */
#login-form-error-container {
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 4px;
}

#login-form-error-container .error-message {
  padding-left: 0;
  text-align: center;
}

#login-form-error-container .error-message::before {
  content: none;
}

/* Footer Styling */
.row-fluid {
  width: 100%;
}

.footer {
  position: relative; /* Keeps footer aligned to the form container */
  text-align: center;
  margin-top: 20px; /* Adds spacing from the form */
}

.footer-separator {
  border: 0;
  height: 1px;
  background-image: linear-gradient(
    to right,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.75),
    rgba(255, 255, 255, 0)
  );
}

#footer-text {
  color: #067577;
  margin: 10px;
}

.modal-dialog {
  max-width: 600px;
}

/* Modal content styling */
.modal-content {
  border-radius: 0px;
  background-color: #ffffff;
  overflow: hidden;
  box-shadow: 0px 4px 4px 0px #00000040;
}

/* Header styling */
.modal-header {
  border-bottom: none;
  padding: 1.5rem 2rem;
}

/* Modal title styling (bold and larger) */
.modal-title {
  font-weight: 700;
  font-size: 1.8rem;
  color: #0f395c;
}

/* Close button styling */
.btn-close {
  font-size: 1rem;
  padding: 1.5rem;
  opacity: 1;
}

/* Modal body styling */
.modal-body {
  padding: 2rem;
  line-height: 1.6;
  font-size: 1rem;
  background-color: #eef6fc;
  color: #212529;
}

/* Styling for the "Last Revised" text */
.modal-body .text-muted {
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 1.5rem;
  display: block;
}

/* Scrollbar styling for the modal body */

.modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Footer styling */
.modal-footer {
  border-top: none;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: flex-end; /* Align buttons to the right */
  gap: 1rem;
}

/* Disagree button styling */
.btn-disagree {
  background-color: transparent;
  color: #6c757d;
  font-weight: 600;
  padding: 0.75rem 2rem;
  transition: all 0.3s ease;
}

.btn-disagree:hover {
  color: red;
  font-weight: 600;
  padding: 0.75rem 2rem;
}

/* Agree button styling */
.btn-agree {
  background: linear-gradient(270deg, #1d9097 0%, rgba(9, 47, 49, 0.8) 100%);
  color: white;
  font-weight: 600;
  padding: 0.75rem 2rem;
  transition: all 0.3s ease;
}

.btn-agree:hover {
  background-color: #2e9b4d;
  border-color: #2e9b4d;
}

.otp-modal-content h1 {
  font-size: 24px;
  color: #1a629e;
  margin-top: 0;
  margin-bottom: 15px;
  font-weight: bold;
  line-height: 1.3;
}

.otp-modal-content p {
  margin: 10px;
}

.otp-username-display {
  margin-bottom: 16px;
}

.otp-username-display span {
  font-weight: 600;
  color: #00695c;
}

.otp-instruction-text {
  color: #067577;
  font-weight: bold;
}

/* OTP input fields container */
.otp-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

/* Individual OTP input field */
.otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #4db6ac;
  color: #00796b;
  transition: all 0.2s ease;
}

.otp-input:focus {
  outline: none;
  border: 3px solid #1a629e;
  box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.2);
}

/* Disable the default number input spinners */
.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.otp-input[type="number"] {
  -moz-appearance: textfield;
}

/* Helper texts */
.otp-validity-note {
  font-size: 14px;
  color: #e53935; /* Red */
  margin-bottom: 24px;
}

.otp-resend-code {
  font-size: 14px;
  color: #067577;
}

.otp-resend-code a {
  font-weight: 600;
  transition: color 0.2s;
}

.otp-resend-code a:hover {
  color: #004d40;
}

/* Action buttons container */
.otp-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

/* Shared button styles */
.otp-modal-btn {
  width: 30%;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Specific button styles */
.otp-btn-verify {
  color: white;
  background-image: linear-gradient(to right, #26a69a, #00897b);
}
.otp-btn-verify:hover {
  opacity: 0.9;
}

.otp-btn-close {
  color: #37474f;
  background-color: white;
  border: 1px solid #b0bec5; /* Light Grey */
}
.otp-btn-close:hover {
  background-color: #f5f5f5;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
}

.loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  display: none;
}

.overlay-text {
  color: white;
}

.loader-icon {
  font-size: 2em;
  vertical-align: middle;
  margin-right: 0.5em;
}

@media (min-width: 500px) {
  .otp-modal-actions {
    flex-direction: row;
    justify-content: center;
  }
}

/* Responsive for Smaller Screens */
@media (max-width: 768px) {
  .form-container {
    width: 90%; /* Adjust form width for smaller screens */
    padding: 20px;
  }
}
