/**
 * Form Validation Styles
 * Clean, professional validation feedback
 */

/* Remove default browser validation styling */
input:invalid,
select:invalid,
textarea:invalid {
  box-shadow: none;
  outline: none;
}

/* Base error state for form controls */
.form-control.error {
  border-color: #dc3545;
  background-color: #fff5f5;
  transition: all 0.3s ease;
}

.form-control.error:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Error message styling */
.form-error {
  display: none;
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  padding-left: 0.25rem;
  line-height: 1.4;
  animation: none;
}

.form-error.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Remove any icons from error messages */
.form-error::before,
.form-error i,
.form-error svg {
  display: none !important;
}

/* Success state */
.form-control.success {
  border-color: #28a745;
  background-color: #f8fff9;
}

/* Warning state */
.form-control.warning {
  border-color: #ffc107;
  background-color: #fffef8;
}

/* Form group with error */
.form-group.has-error .form-label {
  color: #dc3545;
}

/* Helper text */
.form-helper-text {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  font-style: italic;
}

/* Budget Slider Improvements */
.budget-selector-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.budget-slider-wrapper {
  position: relative;
  padding: 1rem 0;
}

/* Add a clear label above the slider */
.budget-slider-wrapper::before {
  content: "Drag to select your investment range";
  display: block;
  text-align: center;
  color: white;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.budget-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.budget-slider:hover {
  background: rgba(255, 255, 255, 0.4);
}

.budget-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  border: 3px solid rgba(255, 255, 255, 0.5);
}

.budget-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.budget-slider::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

.budget-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 3px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.budget-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.budget-slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 0 0.25rem;
}

.budget-slider-labels span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-align: center;
  flex: 1;
}

.budget-slider-labels span:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.budget-slider-labels span.active {
  color: white;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.budget-display {
  margin-top: 1.5rem;
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: white;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.budget-amount {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.budget-description {
  display: block;
  font-size: 0.9rem;
  opacity: 0.95;
  font-weight: 400;
}

/* Add visual feedback for budget selection */
.budget-display.animate {
  animation: pulse 0.3s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(-5px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* Form navigation button states */
.form-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
}

.form-navigation button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hide validation icons that might be coming from other scripts */
.form-group .fa-exclamation-triangle,
.form-group .fa-exclamation-circle,
.form-group .fa-warning,
.form-group .fa-times,
.form-group .fa-check,
.form-control + i,
.form-control + svg,
.form-control ~ .fa,
.form-error .fa,
.form-error i,
.field-feedback {
  display: none !important;
}

/* Clean select dropdown styling */
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

select.form-control.error {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23dc3545' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
  .budget-selector-container {
    padding: 1rem;
    margin: 0.5rem -0.5rem;
    border-radius: 8px;
  }
  
  .budget-slider-labels {
    font-size: 0.65rem;
  }
  
  .budget-slider-labels span {
    padding: 0.2rem 0.3rem;
  }
  
  .budget-amount {
    font-size: 1.5rem;
  }
  
  .budget-description {
    font-size: 0.85rem;
  }
  
  .budget-slider-wrapper::before {
    font-size: 0.85rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .form-control.error {
    background-color: rgba(220, 53, 69, 0.1);
  }
  
  .form-control.success {
    background-color: rgba(40, 167, 69, 0.1);
  }
  
  select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  }
}