/* General Styles */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #0f172a;
  --accent-color: #3b82f6;
  --light-color: #f8fafc;
  --dark-color: #1e293b;
  --error-color: #ef4444;
  --success-color: #10b981;
  --border-color: #e2e8f0;
  --shadow-color: rgba(15, 23, 42, 0.1);
  --overlay-gradient: linear-gradient(135deg, #2563eb, #1e40af);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #f1f5f9;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
}

h1 {
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--light-color);
}

h2 {
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--secondary-color);
}

p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 25px;
  color: var(--light-color);
  opacity: 0.9;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

a:hover {
  color: var(--primary-hover);
}

/* Container Styles */
.container {
  background: white;
  border-radius: 15px;
  box-shadow: 0 15px 30px var(--shadow-color);
  position: relative;
  overflow: hidden;
  width: 900px;
  max-width: 100%;
  min-height: 600px;
  display: flex;
}

.form-container {
  position: absolute;
  top: 0;
  height: 100%;
  transition: all 0.6s ease-in-out;
}

.sign-in-container {
  left: 0;
  width: 50%;
  z-index: 2;
}

.sign-up-container {
  left: 0;
  width: 50%;
  opacity: 0;
  z-index: 1;
}

.container.right-panel-active .sign-in-container {
  transform: translateX(100%);
  opacity: 0;
}

.container.right-panel-active .sign-up-container {
  transform: translateX(100%);
  opacity: 1;
  z-index: 5;
}

/* Form Styles */
form {
  background: white;
  display: flex;
  flex-direction: column;
  padding: 40px;
  height: 100%;
  justify-content: center;
  align-items: center;
}

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.logo i {
  font-size: 1.8rem;
  margin-right: 10px;
}

.input-group {
  width: 100%;
  margin-bottom: 15px;
}

.input-container {
  position: relative;
  width: 100%;
}

.input-container i:not(.toggle-password) {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: #94a3b8;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.3s;
}

.toggle-password:hover {
  color: var(--primary-color);
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 15px 15px 15px 45px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  background-color: #f8fafc;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  outline: none;
}

.error-message {
  color: var(--error-color);
  font-size: 0.8rem;
  margin-top: 5px;
  display: none;
}

.user-type-selector {
  display: flex;
  width: 100%;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.user-type-option {
  flex: 1;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #f8fafc;
}

.user-type-option i {
  font-size: 1rem;
}

.user-type-option.active {
  background-color: var(--primary-color);
  color: white;
}

.terms,
.remember-forgot {
  width: 100%;
  margin: 10px 0 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
}

.remember-forgot {
  justify-content: space-between;
}

.terms label,
.remember-forgot label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.primary-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background-color: var(--primary-color);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.primary-button:hover {
  background-color: var(--primary-hover);
}

.primary-button:active {
  transform: scale(0.98);
}

.primary-button .button-text {
  display: inline-block;
}

.primary-button .button-loader {
  border: 4px solid #f3f3f3;
  border-radius: 50%;
  border-top: 4px solid white;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

/* Overlay Styles */
.overlay-container {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  transition: transform 0.6s ease-in-out;
  z-index: 100;
}

.container.right-panel-active .overlay-container {
  transform: translateX(-100%);
}

.overlay {
  background: var(--overlay-gradient);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 0 0;
  color: white;
  position: relative;
  left: -100%;
  height: 100%;
  width: 200%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
}

.container.right-panel-active .overlay {
  transform: translateX(50%);
}

.overlay-panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
  text-align: center;
  top: 0;
  height: 100%;
  width: 50%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
}

.overlay-left {
  transform: translateX(-20%);
}

.container.right-panel-active .overlay-left {
  transform: translateX(0);
}

.overlay-right {
  right: 0;
  transform: translateX(0);
}

.container.right-panel-active .overlay-right {
  transform: translateX(20%);
}

.ghost-button {
  background-color: transparent;
  border: 2px solid white;
  color: white;
  font-weight: 600;
  padding: 12px 30px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.ghost-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .container {
    min-height: 800px;
    flex-direction: column;
  }

  .sign-in-container,
  .sign-up-container {
    width: 100%;
    height: 50%;
  }

  .overlay-container {
    left: 0;
    top: 50%;
    width: 100%;
    height: 50%;
  }

  .overlay {
    left: 0;
    top: -100%;
    height: 200%;
    width: 100%;
  }

  .overlay-panel {
    width: 100%;
    height: 50%;
  }

  .overlay-left {
    top: 0;
    transform: translateY(-20%);
  }

  .overlay-right {
    bottom: 0;
    top: auto;
    transform: translateY(0);
  }

  .container.right-panel-active .overlay-left {
    transform: translateY(0);
  }

  .container.right-panel-active .overlay-right {
    transform: translateY(20%);
  }

  .container.right-panel-active .overlay-container {
    transform: translateY(-100%);
  }

  .container.right-panel-active .sign-in-container {
    transform: translateY(100%);
  }

  .container.right-panel-active .sign-up-container {
    transform: translateY(100%);
  }
}

@media (max-width: 480px) {
  form {
    padding: 20px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  p {
    font-size: 0.9rem;
  }
}
/* Responsive Improvements */
@media (max-width: 768px) {
  .container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
  }

  .form-container {
    width: 90%;
    max-width: 400px;
    height: auto;
    position: absolute;
    transition: transform 0.6s ease-in-out;
  }

  .sign-in-container,
  .sign-up-container {
    width: 100%;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
  }

  .container.right-panel-active .sign-in-container {
    transform: translate(-50%, -50%) translateX(-100%);
    opacity: 0;
  }

  .container.right-panel-active .sign-up-container {
    transform: translate(-50%, -50%) translateX(0);
    opacity: 1;
    z-index: 2;
  }

  .overlay-container {
    position: absolute;
    width: 100%;
    height: 30%;
    top: 0;
    left: 0;
    display: flex;
    /* align-items: center; */
    justify-content: center;
    transition: transform 0.6s ease-in-out;
  }

  .container.right-panel-active .overlay-container {
    transform: translateX(-100%);
  }

  .overlay {
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
  }

  .container.right-panel-active .overlay {
    transform: translateX(50%);
  }

  form {
    padding: 20px;
    width: 100%;
  }

  .user-type-selector {
    flex-direction: row;
    justify-content: space-between;
  }

  .primary-button {
    width: 100%;
    padding: 14px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  p {
    font-size: 0.9rem;
  }

  .container {
    padding: 10px;
  }
}

/* Loader Styles */
.loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 16px solid #f3f3f3;
  border-radius: 50%;
  border-top: 16px solid var(--primary-color);
  width: 120px;
  height: 120px;
  animation: spin 2s linear infinite;
  z-index: 1000;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
