.authentication {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 400px;
  height: 440px; /* Increased height to accommodate new fields */
  background: var(--container-color);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.authentication--active-popup {
  transform: translate(-50%, -50%) scale(1);
  visibility: visible;
  opacity: 1;
}

.authentication--active {
  height: 620px;
}

.authentication--forgot-password {
  height: 500px; /* Increased height for forgot password form */
}

.authentication__form-box {
  width: 100%;
  padding: 40px;
}

/* authentication login */
.authentication__form-box--login {
  transition: transform 0.18s ease;
  transform: translateX(0);
}

.authentication--active .authentication__form-box--login {
  transition: none;
  transform: translateX(-400px);
}

/* authentication register */
.authentication__form-box--register {
  position: absolute;
  transition: none;
  transform: translateX(400px);
}

.authentication--active .authentication__form-box--register {
  transition: transform 0.18s ease;
  transform: translateX(0);
}

/* authentication forgot password */
.authentication__form-box--forgot-password {
  position: absolute;
  transition: none;
  transform: translateX(400px);
}

.authentication--forgot-password .authentication__form-box--forgot-password {
  transition: transform 0.18s ease;
  transform: translateX(0);
}

.authentication--forgot-password .authentication__form-box--login {
  transition: none;
  transform: translateX(-400px);
}

.authentication__icon-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 45px;
  height: 45px;
  background: var(--first-color);
  font-size: 2em;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom-left-radius: 20px;
  cursor: pointer;
  z-index: 1;
}

.authentication__title {
  font-size: 2em;
  color: var(--title-color);
  text-align: center;
  margin-bottom: 30px;
}

.authentication__input-box {
  position: relative;
  width: 100%;
  height: 50px;
  margin: 40px 0; /* Increased margin for better spacing */
}

.authentication__input {
  width: 100%;
  height: 100%;
  background: #2b2b2b;
  border: 1px solid #444;
  border-radius: 5px;
  outline: none;
  font-size: 1em;
  color: #fff;
  font-weight: 400;
  padding: 0 35px 0 15px;
  transition: border-color 0.3s ease;
}

.authentication__input:focus {
  border-color: var(--first-color);
}

.authentication__input-label {
  position: absolute;
  top: -25px;
  left: 5px;
  font-size: 0.9em;
  color: #fff;
  font-weight: 400;
  pointer-events: none;
}

.authentication__input-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em;
  color: #777;
}

.authentication__remember-forgot {
  font-size: 0.9em;
  color: var(--text-color);
  font-weight: 500;
  margin: -15px 0 15px;
  display: flex;
  justify-content: space-between;
}

.authentication__remember-forgot label input {
  accent-color: var(--first-color);
  margin-right: 3px;
}

.authentication__forgot-link {
  color: var(--text-color);
  text-decoration: none;
}

.authentication__forgot-link:hover {
  text-decoration: underline;
}

.authentication__submit-btn {
  width: 100%;
  height: 45px;
  background: var(--first-color);
  border: none;
  outline: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  color: #fff;
  font-weight: 600;
  transition: background-color 0.3s ease; /* Add transition for smooth color change */
}

.authentication__submit-btn:hover {
  background-color: rgb(61, 61, 61);
}

.authentication__switch {
  font-size: 0.9em;
  color: var(--text-color);
  text-align: center;
  font-weight: 500;
  margin: 25px 0 10px;
}

.authentication__switch-link {
  color: var(--first-color);
  text-decoration: none;
  font-weight: 600;
}

.authentication__switch-link:hover {
  text-decoration: underline;
}

/* Error message styles */
.error-message {
  color: #ff6b6b;
  font-size: 0.75em;
  margin-top: 5px;
  padding: 5px 0;
  display: none;
  position: absolute;
  bottom: -20px; /* Position the error message below the input */
  left: 0;
}

.authentication__input-box.error {
  margin-bottom: 45px; /* Add extra margin when there's an error */
}

.authentication__input-box.error .authentication__input {
  border-color: #ff6b6b;
}

.authentication__input-box.error .error-message {
  display: block;
}

/* user dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background-color: var(--container-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem 0;
  min-width: 120px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: var(--z-fixed);
}

.user-dropdown__item {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

.user-dropdown__item:hover {
  background-color: var(--first-color);
  color: var(--title-color);
}

.show-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.show-dropdown {
  display: block;
}
