body {
  background: linear-gradient(to bottom right, #dbeafe, #bfdbfe);
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden; /* ✅ chặn scroll ngang */
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}


.register-container {
  width: 100%;             /* ✅ form full màn hình ngang */
  max-width: 500px;
  margin: 0 auto;          /* ✅ căn giữa dọc */
  padding: 30px 20px;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}


form h2 {
  text-align: center;
  margin-bottom: 25px;
  color: #1d4ed8;
}

label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
input[type="tel"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-top: 5px;
  font-size: 16px;
  box-sizing: border-box;
}

.password-field {
  position: relative;
  margin-top: 5px;
}

.password-field input[type="password"],
.password-field input[type="text"] {
  padding-right: 42px; /* chừa chỗ cho con mắt */
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  color: #666;
  user-select: none;
  z-index: 2;
}

.gender {
  margin-top: 5px;
}

.gender label {
  margin-right: 15px;
  font-weight: normal;
}

button {
  width: 100%;
  padding: 12px;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  margin-top: 20px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #1d4ed8;
}

.login-link {
  text-align: center;
  margin-top: 15px;
}

.login-link a {
  color: #1d4ed8;
  text-decoration: none;
}

.login-link a:hover {
  text-decoration: underline;
}

input.invalid {
  border: 1.5px solid red;
  background-color: #ffe6e6;
}

input.error, select.error {
  border: 2px solid red;
  background-color: #fff0f0;
}

.error-message {
  color: red;
  font-size: 14px;
  display: none;
  margin-bottom: 8px;
}

@media only screen and (max-width: 600px) {
  .register-container {
    width: 100%;
    margin: 0 0 20px 0;       /* có khoảng cách dưới một chút */
    padding: 25px 16px;
    border-radius: 12px;
  }

  form h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }

  label {
    font-size: 15px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="file"],
  input[type="tel"],
  select {
    font-size: 15px;
    padding: 10px;
  }

  .toggle-password {
    font-size: 16px;
  }

  button {
    padding: 10px;
    font-size: 15px;
    border-radius: 6px;
  }

  .login-link {
    font-size: 14px;
  }

  .error-message {
    font-size: 13px;
  }
}

