* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: url('bg2_new.jpg') no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
}

.container {
  display: flex;
  width: 1000px;
  max-width: 95%;
  background: #fff;
  border-radius: 20px;
  overflow: hidden; /* RESTORED: Needed for container structure */
  box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.15);
  height: 700px;
  position: relative;
}

/* Left Carousel */
.left {
  flex: 1;
  background: radial-gradient(ellipse at center, #32689c 0%, #1e5a96 50%, #0d3f6b 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel {
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform 0.6s ease-in-out;
}

.carousel-item {
  min-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  text-align: center;
}

.carousel-item h2 {
  font-size: 2rem;
  margin-bottom: 15px;
}

.carousel-item p {
  font-size: 1rem;
  line-height: 1.5;
}

.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.carousel-indicators span {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.carousel-indicators .active {
  background: #fff;
}

/* Right Panel */
.right {
  flex: 1;
  background: #fff;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden; /* RESTORED: Needed for form sliding */
  z-index: 1;
}

.logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo h2 {
  color: #0f4c81;
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.logo p {
  color: #666;
  font-size: 0.9rem;
}

.logo-img {
  width: 120px;
  height: 120px;
  display: block;
  margin: 0 auto 15px auto;
}

.form-container {
  position: relative;
  height: 350px;
  width: 100%;
  overflow: hidden; /* CRITICAL: Restored for form sliding mechanism */
  z-index: 10;
}

.form-wrapper {
  position: relative;
  width: 200%;
  height: 100%;
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden; /* CRITICAL: Restored for form sliding */
}

.form-wrapper.show-login {
  transform: translateX(0);
}

.form-wrapper.show-register {
  transform: translateX(-50%);
}

.form-section {
  width: 50%;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden; /* CRITICAL: Restored for form sliding */
}

form {
  width: 100%;
  position: relative;
  overflow: visible; /* DROPDOWN FIX: Only forms need visible overflow */
}

form h2 {
  margin-bottom: 25px;
  font-size: 1.5rem;
  font-weight: bold;
  color: #0f4c81;
}

.input-box {
  position: relative;
  margin-bottom: 20px;
  overflow: visible; /* DROPDOWN FIX: Input boxes need visible overflow */
}

.input-box input {
  width: 100%;
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
}

.input-box input:focus {
  border-color: #0f4c81;
}

.input-box i {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #666;
  transition: color 0.3s ease;
}

.input-box i:hover {
  color: #0f4c81;
}

button {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  margin-top: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(0);
}

.btn-login, .btn-register {
  background: linear-gradient(135deg, #0f4c81, #1e5a96, #2d6bb1);
  color: #fff;
}

.toggle-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #666;
}

.toggle-link a {
  background: linear-gradient(135deg, #0f4c81, #1e5a96, #2d6bb1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.toggle-link a:hover {
  color: #083a63;
  text-decoration: underline;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.socials a {
  width: 40px;
  height: 40px;
  border: 1px solid #0f4c81;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f4c81;
  text-decoration: none;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.socials a:hover {
  background: #0f4c81;
  color: #fff;
  transform: translateY(-3px);
}

/* DROPDOWN STYLES - FIXED FOR SLIDING FORMS */
.email-input-container {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: visible; /* Needed for dropdown */
  z-index: 100;
}

.email-input-container input {
  flex: 1;
  padding: 12px 15px;
  border: none;
  outline: none;
  font-size: 0.95rem;
  background: transparent;
}

.email-input-container:focus-within {
  border-color: #0f4c81;
}

.domain-selector {
  position: relative;
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: #f8f9fa;
  border-left: 1px solid #e0e0e0;
  cursor: pointer;
  user-select: none;
  z-index: 101;
}

.domain-text {
  font-size: 0.95rem;
  color: #0f4c81;
  font-weight: 500;
  margin-right: 8px;
}

.dropdown-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #0f4c81;
  transition: transform 0.3s ease;
}

.dropdown-arrow.open {
  transform: rotate(180deg);
}

/* CHANGED: Position dropdown relative to domain selector */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #0f4c81;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  min-width: 200px;
  z-index: 99999;
  max-height: 200px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

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

.dropdown-item {
  padding: 12px 20px;
  cursor: pointer;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: #f8f9fa;
  color: #0f4c81;
}

.dropdown-item:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {
  .container {
    flex-direction: column-reverse;
    height: auto;
    min-height: 650px;
    overflow: hidden; /* Maintain structure on mobile */
  }

  .left {
    height: 250px;
  }

  .right {
    padding: 30px;
    overflow: hidden; /* Maintain structure on mobile */
  }

  .form-container {
    height: 400px;
    overflow: hidden; /* Maintain structure on mobile */
  }
}
