@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap");
@import url("variables.css");

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: "Poppins", sans-serif;
  background: linear-gradient(45deg, #111e88, #7380ec, #00d2ff, #3a7bd5);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto; /* Allow scroll for long form */
  position: relative;
}

/* Dark Mode Background Override */
body.dark-theme-variables {
  background: linear-gradient(45deg, #0f172a, #1e293b, #334155, #0f172a);
  background-size: 400% 400%;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Floating Shapes */
body::before,
body::after {
  content: "";
  position: fixed; /* Fixed so they stay during scroll */
  width: 300px;
  height: 300px;
  border-radius: 50%;
  z-index: -1;
  filter: blur(80px);
  opacity: 0.6;
}

body::before {
  background: var(--color-primary);
  top: -50px;
  left: -50px;
  animation: float1 8s ease-in-out infinite alternate;
}

body::after {
  background: var(--color-success);
  bottom: -50px;
  right: -50px;
  animation: float2 10s ease-in-out infinite alternate;
}

@keyframes float1 {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(50px, 50px);
  }
}

@keyframes float2 {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-50px, -50px);
  }
}

/* Theme Toggler */
.theme-toggler {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 100;
}

/* Glassmorphism Card */
.centered-form {
  width: 450px;
  max-width: 90%;
  margin: 4rem auto;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--card-border-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: var(--color-white);
}

body.dark-theme-variables .centered-form {
  background: rgba(87, 86, 86, 0.3);
  border: 1px solid rgba(56, 54, 54, 0.05);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.centered-form label {
  align-self: flex-start;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-white);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.centered-form input[type="text"],
.centered-form input[type="password"],
.centered-form input[type="email"],
.centered-form input[type="tel"],
.centered-form input[type="number"] {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.8rem;
  font-family: inherit;
  color: var(--color-white);
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.centered-form input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.centered-form input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--color-white);
  outline: none;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
}

.centered-form input[type="submit"] {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(
    to right,
    var(--color-primary),
    var(--color-primary-variant)
  );
  color: var(--color-white);
  border: none;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1rem;
}

.centered-form input[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  filter: brightness(1.1);
}

.centered-form input[type="submit"]:active {
  transform: translateY(-1px);
}

.back-link {
  position: absolute;
  top: 2rem;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: transform 0.3s ease;
  z-index: 10;
}

.back-link i {
  font-size: 2rem;
  color: var(--color-white);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.back-link span {
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--color-white);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.back-link:hover {
  transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .centered-form {
    width: 85%;
    padding: 2rem;
    margin: 6rem auto 2rem;
  }

  .back-link span {
    display: none;
  }

  .theme-toggler {
    top: 1rem;
    right: 1rem;
  }
}
