body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  box-sizing: border-box;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../photo/bg.jpg") no-repeat center center/cover;
  opacity: 0.5;
  z-index: -1;
}

.firstpage {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 8px;
  max-width: 100%;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #eee;
  /* enhancement */
  align-items: center;
  box-sizing: border-box;
  max-width: 900px;
  margin: 0 auto;
  overflow: hidden;
  margin-top: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #555555bd;
}

p {
  text-align: center;
  color: #555555bd;
}

.form-two {
  display: flex;
  flex-wrap: wrap;
  gap: 7rem;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.form-one {
  display: flex;
  flex-wrap: wrap;
  /* gap: 7rem; */
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.leftbox,
.rightbox,
.onebox {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

/* Centering right box content like teacher image */
.rightbox,
.onebox {
  align-items: center;
}

.upload img {
  width: 350px;
  height: 310px;
  object-fit: cover;
  border: 2px solid #ccc;
  border-radius: 8px;
  display: block;
  margin-bottom: 10px;
}

input[type="text"],
input[type="date"],
input[type="tel"],
input[type="email"],
input[type="password"],
select {
  padding: 0.8rem;
  font-size: 1rem;
  margin-bottom: 0.8rem;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

label {
  font-size: 0.8rem;
  margin-top: 0.8rem;
  margin-bottom: 0.5rem;
  padding: 5px;
}

.gender {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
}

.gender label {
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.gender input[type="radio"] {
  margin-right: 10px;
  transform: scale(1.5);
  accent-color: #007bff;
  cursor: pointer;
}

.button {
  margin-top: 1.5rem;
  padding: 0.8rem;
  font-size: 1rem;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.button:hover {
  background-color: #45a049;
}

.teacher-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
  border: 2px solid #ccc;
  background-color: #eee;
  transition: opacity 0.3s ease-in-out;
}

.teacher-img.loaded {
  opacity: 1;
}

/* Label below or above teacher image */
.teacher-img-label {
  text-align: center;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.upload-img .image-holder {
  margin-top: 15px;
  width: 350px;
  height: 440px;
  border: 2px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f5f5f5;
}

.upload-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
  body {
    display: block;
    padding: 1rem;
  }

  .firstpage {
    margin: 1rem auto;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
  }

  form {
    flex-direction: column;
    gap: 1.5rem;
    /* adjusted gap */
    justify-content: flex-start;
  }

  .leftbox,
  .rightbox,
  .onebox {
    width: 100%;
    box-sizing: border-box;
  }

  .rightbox,
  .onebox {
    margin-top: 1rem;
    align-items: center;
  }

  .gender {
    flex-direction: column;
    gap: 1rem;
  }

  .button {
    width: 100%;
  }
}

@media screen and (max-width: 768px) {
  .firstpage {
    padding: 0.8rem;
    width: 100%;
  }

  form {
    gap: 0.8rem;
  }

  .leftbox,
  .rightbox,
  .onebox {
    width: 100%;
    box-sizing: border-box;
  }

  .gender {
    flex-direction: column;
    gap: 0.5rem;
  }

  .button {
    width: 100%;
  }
}

@media screen and (max-width: 480px) {
  .firstpage {
    padding: 0.5rem;
    width: 100%;
  }

  .button {
    width: 100%;
    font-size: 0.9rem;
  }
}

.error-message {
  color: #ff3b3b;
  background-color: #ffe6e6;
  padding: 10px 15px;
  border: 1px solid #ffaaaa;
  border-radius: 8px;
  margin: 15px 0;
  font-weight: 500;
  text-align: center;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
