/* Global Body Styles */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #ffd6e0, #d4f8e8, #e6e0ff);
  background-size: 200% 200%;
  animation: gradientShift 12s ease infinite;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  overflow: hidden; /* needed for confetti */
}

/* Gradient Animation */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Form and Welcome Box Styles */
form, .welcome-box {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem 3rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  text-align: center;
  width: 320px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

/* Hover Effect for Boxes */
form:hover, .welcome-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

/* Headings */
h2 {
  color: #b48efc;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

/* Paragraphs */
p {
  margin-bottom: 1rem;
  color: #555;
}

/* Inputs */
input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus {
  border-color: #b48efc;
  box-shadow: 0 0 5px rgba(180, 142, 252, 0.5);
  outline: none;
}

/* Submit Button */
input[type="submit"], .button {
  display: inline-block;
  background-color: #b48efc;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

input[type="submit"]:hover, .button:hover {
  background-color: #a47aec;
  transform: scale(1.05);
}

/* Links inside welcome box */
a.button {
  margin-top: 1rem;
  display: inline-block;
}

/* Fade-in animation for welcome box */
.welcome-box {
  opacity: 0;
  animation: fadeIn 1s forwards;
  position: relative;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    top: -15px;

    left: calc(var(--x, 0) * 1%);
    animation-name: fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-duration: var(--duration, 4s);
    animation-delay: var(--delay, 0s);

    transform: rotate(0deg);
}

/* Brighter confetti colors for more visibility */
.confetti:nth-child(odd)  { background-color: #ff6b6b; }
.confetti:nth-child(even) { background-color: #fbc531; }
.confetti:nth-child(3n)   { background-color: #1dd1a1; }
.confetti:nth-child(4n)   { background-color: #5f27cd; }
.confetti:nth-child(5n)   { background-color: #54a0ff; }

/* Falling + rotation + horizontal drift */
@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
        opacity: 1;
    }
    25% {
        transform: translateY(25vh) rotate(90deg) translateX(10px);
    }
    50% {
        transform: translateY(50vh) rotate(180deg) translateX(-10px);
    }
    75% {
        transform: translateY(75vh) rotate(270deg) translateX(10px);
    }
    100% {
        transform: translateY(110vh) rotate(360deg) translateX(0);
        opacity: 0;
    }
}
