/* Background & Layout */
body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  background: url('chatbg.jpg') no-repeat center center / cover;

  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-layout {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 40px;
  gap: 40px;
}

.left-panel {
  flex: 1;
  color: white;
  padding: 60px 40px;
  animation: slideInLeft 1s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.welcome-text {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 10px;
  text-shadow: 1px 1px 5px rgba(0,0,0,0.4);
}

.subtext {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: #cfdfff;
}

.icon-row i {
  font-size: 2rem;
  margin-right: 15px;
  animation: bounce 2s infinite ease-in-out alternate;
}

.auth-container {
  flex: 1;
  max-width: 400px;
  max-height: 400px;
  background: white;
  padding: 40px 30px;
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 1s ease-in-out;
  margin-top: 80px; /* Adjust this value as needed */
  margin: 20px auto; /* centers on mobile */
}

/* Form Styling */
.form-box {
  display: none;
  flex-direction: column;
  gap: 15px;
}

.form-box.active {
  display: flex;
}

input {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  outline: none;
}

.auth-btn {
  background-color: #007bff;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
}

.auth-btn:hover {
  background-color: #0056b3;
}

.switch-text {
  text-align: center;
  font-size: 0.95rem;
}

.switch-text span {
  color: #007bff;
  cursor: pointer;
  font-weight: bold;
}

/* Password visibility */
.password-wrap {
  position: relative;
}
.password-wrap input {
  width: 90%;
  padding-right: 40px;
}
.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.1rem;
}

/* Animations */
@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

/* Responsive */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    height: auto;
    margin: 0;
    padding: 0;
  }

  .split-layout {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px 15px;
    height: auto;
    gap: 20px;
  }

  .left-panel {
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0;
  }

  .welcome-text {
    font-size: 2rem;
    font-weight: bold;
    margin: 10px 0 5px;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.4);
  }

  .subtext {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #cfdfff;
    padding: 0 10px;
  }

  .icon-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 10px;
  }

  .icon-row i {
    font-size: 1.5rem;
  }

  .auth-container {
    width: 100%;
    max-width: 90%;
    margin: 0 auto 20px;
    padding: 20px 15px;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  }

  .auth-container h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }

  .auth-container input {
    width: 90%;
    padding: 12px 10px;
    margin-bottom: 15px;
    font-size: 1rem;
  }

  .password-wrap {
    position: relative;
  }

  .password-wrap input {
    width: 80%;
    padding-right: 40px;
  }

  .toggle-password {
    position: absolute;
    right: 10px;
    top: 12px;
    cursor: pointer;
  }

  .auth-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    background: #007bff;
    border: none;
    color: white;
    border-radius: 5px;
  }

  .switch-text {
    margin-top: 10px;
    font-size: 0.9rem;
    text-align: center;
  }

  .switch-text span {
    color: #00aaff;
    cursor: pointer;
  }
}

/* === Spinner Animation === */
.tech-spinner {
  width: 80px;
  height: 80px;
  border: 6px solid rgba(255,255,255,0.2);
  border-top: 6px solid #00bfff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

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

/* === Floating Dots Animation === */
.floating-dots {
  position: absolute;
  bottom: 10px;
  left: 40px;
  display: flex;
  gap: 10px;
}
.floating-dots div {
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}
.floating-dots div:nth-child(2) { animation-delay: 0.2s; }
.floating-dots div:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* === Fade in animation === */
.welcome-text, .subtext, .icon-row {
  opacity: 0;
  animation: fadeInUp 1.2s ease forwards;
}
.welcome-text { animation-delay: 0.2s; }
.subtext { animation-delay: 0.4s; }
.icon-row { animation-delay: 0.6s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#particles-js {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1; /* Behind everything */
}



.custom-alert {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background: #e0f8e9;
  color: #155724;
  border-left: 5px solid #28a745;
  padding: 15px 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  z-index: 2000;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: 90%;
  width: fit-content;
  opacity: 1;
}

.custom-alert.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.85);
}

.custom-alert .alert-icon {
  font-size: 1.4rem;
}

body.dark .custom-alert {
  background: #1f2d3d;
  color: #aaf0c5;
  border-left-color: #28a745;
}

@media (max-width: 600px) {
  .custom-alert {
    bottom: 20px;
    padding: 12px 15px;
    font-size: 0.95rem;
    gap: 10px;
  }
}
