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

body,
.container,
.form-container,
.overlay,
.overlay-panel,
input,
button,
.options,
.social-icons a {
  transition: all 2s ease;
}


body {
  background: #f6f5f7;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.container {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 14px 28px rgba(0,0,0,0.25), 
              0 10px 10px rgba(0,0,0,0.22);
  position: relative;
  width: 900px;
  max-width: 100%;
  min-height: 550px;
  overflow: hidden;
  display: flex;
}

.form-container {
  position: absolute;
  top: 0;
  height: 100%;
  transition: all 0.6s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50%;
  padding: 0 50px;
  text-align: center;
  background: #ffffff;
}

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

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

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

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

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

.overlay {
  background: url('https://images.unsplash.com/photo-1557683316-973673baf926?auto=format&fit=crop&w=900&q=60');
  background-size: cover;
  background-position: center;
  color: white;
  position: relative;
  left: -100%;
  height: 100%;
  width: 200%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
  display: flex;
}

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

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

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

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

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

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

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

form {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
  width: 100%;
}

.input-group {
  position: relative;
  margin: 16px 0;
}

.input-group input {
  width: 100%;
  padding: 12px 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
  background: transparent;
}

.input-group label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background-color: white;
  padding: 0 5px;
  color: #aaa;
  pointer-events: none;
  transition: 0.2s ease all;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown):valid + label {
  top: -10px;
  left: 10px;
  font-size: 12px;
  color: #333;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  color: #888;
  user-select: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

button {
  border: none;
  padding: 12px 45px;
  margin-top: 15px;
  border-radius: 20px;
  background-color: #1dd1a1;
  color: white;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 80ms ease-in;
}

button:hover {
  background-color: #10ac84;
}

.ghost {
  background-color: transparent;
  border: 2px solid white;
}

.options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-top: 10px;
}
.options label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap; 
}

.social-icons {
  margin-top: 10px;
}

.social-icons a {
  margin: 0 5px;
  display: inline-block;
}

body.dark-mode {
  background: #121212;
  color: #e0e0e0;
}

body.dark-mode .container {
  background: #1e1e1e;
  box-shadow: 0 14px 28px rgba(0,0,0,0.5), 
              0 10px 10px rgba(0,0,0,0.35);
}

body.dark-mode .form-container {
  background: #1e1e1e;
}

body.dark-mode form {
  background: #1e1e1e;
}

body.dark-mode h1,
body.dark-mode p,
body.dark-mode span,
body.dark-mode label,
body.dark-mode a {
  color: #f1f1f1;
}

body.dark-mode input {
  background: #2c2c2c;
  color: #f1f1f1;
  border: 1px solid #444;
}

body.dark-mode input::placeholder {
  color: #aaa;
}

body.dark-mode button {
  background-color: #00cec9;
  color: #1e1e1e;
}

body.dark-mode button:hover {
  background-color: #00b894;
}

body.dark-mode .ghost {
  border: 2px solid #f1f1f1;
  color: #f1f1f1;
}

body.dark-mode .options a {
  color: #81ecec;
}

body.dark-mode .overlay {
  background: linear-gradient(rgba(18, 18, 18, 0.85), rgba(18, 18, 18, 0.85)), 
              url('https://images.unsplash.com/photo-1607083206963-9bd99ef0cf9e?auto=format&fit=crop&w=900&q=60');
  background-size: cover;
  background-position: center;
  color: #fff;
}

body.dark-mode .overlay-panel {
  color: #f5f5f5;
}

body.dark-mode .input-group input {
  background: #2c2c2c;
  color: #f1f1f1;
  border: 1px solid #444;
}

body.dark-mode .input-group label {
  background-color: #2c2c2c;
  color: #aaa;
}

body.dark-mode .input-group input:focus + label,
body.dark-mode .input-group input:not(:placeholder-shown):valid + label {
  color: #00cec9;
}


.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 999;
}

.theme-toggle input {
  display: none;
}

.switch {
  width: 60px;
  height: 30px;
  background: #fff;
  border-radius: 30px;
  position: relative;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 5px;
  transition: background 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}

.switch::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  transition: transform 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
  z-index: 2;
}

.switch .icon {
  width: 20px;
  height: 20px;
  position: absolute;
  top: 5px;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 3;
}

.switch .sun {
  left: 8px;
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.switch .moon {
  right: 5px;
  opacity: 0;
  transform: rotate(180deg) scale(0.8);
}

#theme-switch:checked + .switch {
  background: linear-gradient(145deg, #00cec9, #1dd1a1);
  box-shadow: 0 0 15px rgba(29, 209, 161, 0.6);
}

#theme-switch:checked + .switch::before {
  transform: translateX(30px) scale(1.1);
  box-shadow: 0 0 8px #00cec9;
}

#theme-switch:checked + .switch .sun {
  opacity: 0;
  transform: rotate(180deg) scale(0.8);
}

#theme-switch:checked + .switch .moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.switch:active::before {
  transform: scale(0.9);
}

#theme-switch:disabled + .switch {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.switch::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.2) 0%, transparent 70%);
  transform: scale(0);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

#theme-switch:checked + .switch::after {
  transform: scale(1);
  opacity: 1;
}

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

.rotate {
  animation: rotate 0.5s ease;
}
