.form-group {
  margin-bottom: var(--spacing-lg);
  max-width: 400px; /* Limit the width of form fields */
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--color-off-white);
  font-weight: 500;
  transition: all var(--transition-fast);
  transform-origin: left;
}

.form-input {
  width: 100%;
  padding: var(--spacing-md);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 230, 184, 0.2);
  border-radius: var(--radius-md);
  color: var(--color-off-white);
  transition: all var(--transition-fast);
  height: 45px; /* Standardize height for text inputs */
  position: relative;
  z-index: 1;
}

textarea.form-input {
  height: auto; /* Allow textareas to expand vertically */
  min-height: 100px; /* Set minimum height for textareas */
  resize: vertical;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 2px rgba(0, 230, 184, 0.2);
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  transform: translateY(-25px) scale(0.85);
  color: var(--color-teal);
}

.form-input::placeholder {
  color: rgba(248, 249, 250, 0.5);
}

/* Form container styling */
.form-container {
  max-width: 450px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Submit button styling */
button[type="submit"] {
  margin-top: var(--spacing-md);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

button[type="submit"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

button[type="submit"]:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* Form field focus animation */
.form-group::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-teal);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
  z-index: 0;
}

.form-group:focus-within::after {
  transform: scaleX(1);
}
