/* Modern Form Animations and Styles */

/* Fade in animation for forms */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.5s ease-out;
}

/* Input focus animations */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

/* Radio button custom styling for priority selection */
input[type="radio"]:checked + div {
  font-weight: 600;
}

/* Smooth transitions for all interactive elements */
input,
textarea,
select,
button,
a {
  transition: all 0.2s ease-in-out;
}

/* Enhanced hover states for buttons */
button:hover,
a.inline-flex:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

button:active,
a.inline-flex:active {
  transform: translateY(0);
}

/* Form section dividers */
form > div > div:not(:last-child) {
  position: relative;
}

/* Placeholder styling */
::placeholder {
  color: #9CA3AF;
  opacity: 0.7;
}

/* Focus within styling for form groups */
.space-y-2:focus-within label {
  color: #4F46E5;
}

/* Gradient text for section headers */
.text-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mobile-optimized touch targets */
@media (max-width: 640px) {
  input,
  textarea,
  select,
  button {
    min-height: 48px;
  }

  /* Larger tap targets for radio buttons */
  input[type="radio"] + div {
    padding: 16px;
  }
}

/* Desktop enhancements */
@media (min-width: 640px) {
  /* Stagger animation for form sections */
  form > div > div:nth-child(1) {
    animation-delay: 0.1s;
  }

  form > div > div:nth-child(2) {
    animation-delay: 0.2s;
  }

  form > div > div:nth-child(3) {
    animation-delay: 0.3s;
  }
}

/* Error state styling */
input.error,
textarea.error,
select.error {
  border-color: #EF4444;
  background-color: #FEF2F2;
}

/* Success state styling */
input.success,
textarea.success,
select.success {
  border-color: #10B981;
  background-color: #F0FDF4;
}

/* Loading state for submit buttons */
button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Section icon backgrounds */
.section-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 8px;
}

/* Textarea auto-resize enhancement */
textarea {
  transition: height 0.2s ease;
}

/* Custom scrollbar for textareas */
textarea::-webkit-scrollbar {
  width: 8px;
}

textarea::-webkit-scrollbar-track {
  background: #F3F4F6;
  border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

/* Priority radio button active states */
label:has(input[type="radio"]:checked) {
  background-color: var(--selected-bg);
  border-color: var(--selected-border);
  box-shadow: 0 0 0 3px var(--selected-shadow);
}

/* Ripple effect on form submission */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

button[type="submit"]:active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  border-radius: inherit;
  animation: ripple 0.6s ease-out;
}

/* Form validation feedback */
.field-error {
  color: #EF4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.field-success {
  color: #10B981;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

