/* Reset & base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #74ebd5, #9face6);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* Form Container */
.form-container {
  background-color: white;
  padding: 45px 50px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 480px;
  animation: fadeIn 0.8s ease;
}

/* Form Title */
h2 {
  text-align: center;
  margin-bottom: 35px;
  color: #333;
  font-size: 28px;
}

/* Form group wrapper */
.form-group {
  position: relative;
  margin-bottom: 25px;
}

/* Input */
input {
  width: 100%;
  padding: 18px 14px 12px;
  font-size: 18px;
  border: 2px solid #ccc;
  border-radius: 10px;
  outline: none;
  transition: all 0.3s ease;
}

/* Floating label */
label {
  position: absolute;
  top: 16px;
  left: 15px;
  color: #888;
  font-size: 16px;
  transition: 0.3s;
  pointer-events: none;
}

/* Label moves on focus or input */
input:focus + label,
input:not(:placeholder-shown) + label {
  top: -10px;
  left: 12px;
  font-size: 13px;
  background: white;
  padding: 0 6px;
  color: #6c63ff;
}

/* Focus effect */
input:focus {
  border-color: #6c63ff;
  box-shadow: 0 0 10px rgba(108, 99, 255, 0.3);
}

/* Error and success borders */
input.error {
  border-color: #e74c3c;
}

input.success {
  border-color: #2ecc71;
}

/* Error message */
.error-message {
  display: none;
  color: #e74c3c;
  font-size: 13px;
  margin-top: 6px;
  padding-left: 4px;
}

/* Button */
button {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s;
}

button:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Optional: add icons inside inputs for success/error */
.form-group input.success::after {
  content: "✔";
  color: #2ecc71;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.form-group input.error::after {
  content: "✖";
  color: #e74c3c;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}
