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

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: url("back.jpg") no-repeat center/cover;
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  padding: 20px;
}

/* Container with glass effect */
.container {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 2;
  animation: fadeIn 0.8s ease;
  overflow: hidden;
}

/* Gradient Border Animation */
.container::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 3px;
  border-radius: 20px;
  background: linear-gradient(45deg, red, yellow, blue, white, red);
  background-size: 300% 300%;
  animation: gradientAnimation 8s ease infinite;

  /* Compatibility fix */
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

@keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

.form-intro {
  text-align: center;
  margin-bottom: 15px;
}

.form-intro h1 {
  font-size: 26px;
  margin-bottom: 8px;
  color: #000; /* Force black */
}

.form-intro p {
  font-size: 15px;
  line-height: 1.4;
  opacity: 0.9;
  color: #000; /* Force black */
}

/* Social login */
.social-login {
  display: flex;
  justify-content: space-between;
  margin: 15px 0;
}

.social-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 5px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.3s, background 0.3s;
  font-size: 14px;
}

.social-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.4);
}

.social-icon {
  width: 18px;
}

/* Form Section */
.form-container {
  margin-top: 10px;
}

.form-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
}

.toggle-btn {
  background: transparent;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  color: var(--text-color);
  cursor: pointer;
  transition: 0.3s;
}

.toggle-btn.active {
  font-weight: bold;
  border-bottom: 2px solid #3498db;
}

.separator {
  width: 1px;
  height: 20px;
  background: var(--text-color);
  margin: 0 10px;
}

/* Forms Wrapper with animation */
.forms-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.form-content {
  display: none;
  flex-direction: column;
  animation: fadeForm 0.4s ease;
}

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

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

/* Inputs */
.input-wrapper {
  position: relative;
  margin-bottom: 15px;
}

.input-wrapper i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
}

.input-field {
  width: 100%;
  padding: 12px 40px 12px 15px;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: 0.3s;
  background: rgba(255, 255, 255, 0.3);
  color: #000; /* Input text black */
}

.input-field::placeholder {
  color: #000; /* Placeholder black */
}

.input-field:focus {
  border-color: #6e8efb;
  box-shadow: 0px 0px 8px rgba(110, 142, 251, 0.5);
}

/* Buttons */
.submit-btn {
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  color: white;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.3s;
}

.submit-btn:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

#forgotPassword {
  margin-bottom: 15px;
  font-size: 14px;
  color: #3498db;
  text-align: right;
  text-decoration: none;
  display: block;
}

#forgotPassword:hover {
  text-decoration: underline;
}

/* Theme Button */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
}

#themeButton {
  background: red;
  opacity: 0.7;
  color: white;
  padding: 8px 18px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

#themeButton:hover {
  background: #2980b9;
}

/* Light Mode */
:root {
  --text-color: #333;
}

/* Dark Mode */
body.dark-mode {
  --text-color: #f5f5f5;
}

.container.dark-container {
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(20px);
}

.container.dark-container h1,
.container.dark-container p {
  color: #000; /* Always black, even in dark mode */
}

/* Responsive Design */
@media (max-width: 480px) {
  .container { padding: 18px; max-width: 95%; }
  .form-intro h1 { font-size: 20px; }
  .form-intro p { font-size: 13px; }
  .input-field { font-size: 14px; }
  .submit-btn { font-size: 14px; padding: 10px; }
  .social-button { font-size: 12px; padding: 8px; }
}

@media (min-width: 481px) and (max-width: 768px) {
  .container { max-width: 500px; padding: 25px; }
  .form-intro h1 { font-size: 24px; }
  .form-intro p { font-size: 14px; }
  .submit-btn { font-size: 15px; }
}

@media (min-width: 769px) and (max-width: 1199px) {
  .container { max-width: 480px; }
}

@media (min-width: 1200px) {
  .container { max-width: 420px; }
}