body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background-color: #f3f5f9;
  padding-top: 100px;
}

/* From Uiverse.io by JohnnyCSilva */ 
.form {
  margin: auto;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  bottom: 20px;
  padding: 30px;
  width: 600px;
  border-radius: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.311);
}

::placeholder {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.form button {
  align-self: flex-end;
}

.flex-column > label {
  color: #151717;
  font-weight: 600;
}

.inputForm {
  background-color: #f9fafb;
  border: 1px solid #0062ff;
  border-radius: 12px;
  height: 55px;
  display: flex;
  align-items: center; /* This property handles the vertical centering. */
  padding-inline: 15px; /* Use symmetrical padding for better alignment. */
  gap: 10px; /* Add space between the icon, input, and toggle. */
  transition: all 0.3s ease;
}

.inputForm:hover {
  border-color: #2879fc;
  background-color: #fff;
}

.input {
  background-color: transparent;
  /* margin-left is replaced by the 'gap' property on the parent .inputForm */
  border: none;
  flex: 1;
  height: 100%;
  font-size: 15px;
  color: #181b23;
  font-weight: 500;
}

.input:focus {
  outline: none;
}

.inputForm:focus-within {
  background-color: #ffffff;
  border-color: #2d79f3;
  box-shadow: 0 0 0 4px rgba(45, 121, 243, 0.1);
}

.inputForm svg {
  fill: #232222;
  transition: fill 0.3s ease;
}

.inputForm:focus-within svg {
  fill: #0062ff;
}

.flex-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.terms-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 5px;
  gap: 8px;
}

.flex-row > div > label {
  font-size: 14px;
  color: black;
  font-weight: 400;
}

.span {
  font-size: 14px;
  margin-left: 5px;
  color: #2d79f3;
  font-weight: 500;
  cursor: pointer;
}

.button-submit {
  margin: 20px 0 10px 0;
  background-color: #151517;
  border: none;
  color: white;
  font-size: 15px;
  font-weight: 500;
  border-radius: 10px;
  height: 50px;
  width: 100%;
  cursor: pointer;
}

.p {
  text-align: center;
  color: black;
  font-size: 14px;
  margin: 2px 0;
}

.btn {
  margin-top: 10px;
  width: 100%;
  height: 50px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 500;
  gap: 10px;
  border: 1px solid #ededef;
  background-color: white;
  cursor: pointer;
  transition: 0.2s ease-in-out;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.311);
}

.btn:hover {
  background: #fcfef3;
}

.password-toggle {
  /* margin-right is no longer needed due to the parent's padding. */
  cursor: pointer;
  font-size: 20px;
  color: #333333;
  transition: color 0.3s ease, transform 0.2s ease;
  background: transparent;
  border: none;
  padding: 5;
  display: inline-flex;
  padding-bottom: 13px;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #2d79f3;
  transform: scale(1.1);
}

.password-toggle:active {
  transform: scale(0.95);
}

.strength-meter {
  height: 4px;
  background-color: #e2e8f0;
  border-radius: 2px;
  margin: 4px 0;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.requirements-list {
  margin-top: 4px;
  display: none; /* This will be toggled by JS on focus */
  flex-direction: column;
  gap: 5px;
}

.req-item {
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.req-item.valid {
  color: #00C851;
}

.req-item.invalid {
  color: #ff4444;
}

.site-footer {
  width: 100%;
}

/* Dark Mode Styles */
body.dark-mode .form {
  background: var(--color-gray-200);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .flex-column > label,
body.dark-mode .flex-row > div > label,
body.dark-mode label[for="terms"] {
  color: var(--color-dark-200);
}

body.dark-mode .inputForm {
  background-color: var(--color-gray-300);
  border-color: var(--color-gray-400);
}

body.dark-mode .inputForm:hover {
  border-color: var(--color-blue-300);
}

body.dark-mode .input {
  color: var(--color-dark-100);
}

body.dark-mode .input::placeholder {
  color: var(--color-gray-500);
}

body.dark-mode .inputForm:focus-within {
  background-color: var(--color-gray-300);
  border-color: var(--color-blue-300);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}

body.dark-mode .inputForm svg {
  fill: var(--color-dark-300);
}

body.dark-mode .p {
  color: var(--color-dark-300);
}

body.dark-mode .button-submit {
  background-color: var(--color-blue-400);
  color: var(--color-dark-100);
}

body.dark-mode .password-toggle {
  color: var(--color-dark-300);
}

body.dark-mode .btn.google {
  background-color: var(--color-gray-300);
  color: var(--color-dark-100);
  border-color: var(--color-gray-400);
}

body.dark-mode .btn.google:hover {
  background-color: var(--color-gray-400);
}

.error-message {
  color: #D8000C;
  font-size: 0.875rem;
  margin-top: 5px;
  min-height: 1em;
  font-weight: 500;
}

body.dark-mode .error-message {
  color: #ff5252;
}


/* Responsive Styles */
@media (max-width: 640px) {
  body {
    padding-top: 80px;
  }
  .form {
    width: 95%;
    padding: 20px;
  }

  .flex-row {
    flex-direction: column;
    align-items: stretch;
  }
}
/* Signin/Signup Dark Mode */
body.dark-mode .form .flex-column > label,
body.dark-mode .form .p,
body.dark-mode .form .flex-row > div > label,
body.dark-mode .form .terms-row > label {
    color: var(--color-dark-200);
}

body.dark-mode .form .span {
    color: var(--color-blue-300);
}

body.dark-mode .form .inputForm {
    background-color: var(--color-gray-300);
    border-color: var(--color-gray-400);
}

body.dark-mode .form .inputForm:hover {
    border-color: var(--color-blue-300);
    background-color: var(--color-gray-300);
}

body.dark-mode .form .input {
    color: var(--color-dark-100);
}

body.dark-mode .form .inputForm:focus-within {
    background-color: var(--color-gray-300);
    border-color: var(--color-blue-300);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}

body.dark-mode .form .inputForm svg {
    fill: var(--color-dark-300);
}

body.dark-mode .form .inputForm:focus-within svg {
    fill: var(--color-blue-300);
}

body.dark-mode .form .button-submit {
    background-color: var(--color-blue-400);
}

body.dark-mode .form .button-submit:hover {
    background-color: var(--color-blue-300);
}

body.dark-mode .form .btn.google {
    background-color: var(--color-gray-300);
    border-color: var(--color-gray-400);
    color: var(--color-dark-100);
}

body.dark-mode .form .btn.google:hover {
    background: var(--color-gray-400);
}

body.dark-mode .form .password-toggle {
    color: var(--color-dark-300);
}

body.dark-mode .form .strength-meter {
    background-color: var(--color-gray-400);
}

body.dark-mode .form input[type="checkbox"] {
    accent-color: var(--color-blue-400);
}
