/* Modern Form Styles - Matching Quantum Spark Experience Form */

/* Form Container */
.modern-form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: #ffffff;
}

/* Step Indicator */
.form-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
}

.form-step-indicator .step-number {
  color: #6576ff;
  font-weight: 600;
}

/* Section Header */
.form-section-header {
  margin-bottom: 2rem;
}

.form-section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.form-section-header p {
  font-size: 1rem;
  color: #6c757d;
  margin: 0;
}

/* Form Group */
.modern-form-group {
  margin-bottom: 1.5rem;
}

.modern-form-group:last-child {
  margin-bottom: 0;
}

/* Form Label */
.modern-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.modern-form-label .required {
  color: #e85347;
  margin-left: 2px;
}

.modern-form-label .optional {
  color: #6c757d;
  font-weight: 400;
  font-size: 0.8125rem;
  margin-left: 0.5rem;
}

/* Form Control */
.modern-form-control,
.modern-form-container .form-control,
.modern-form-container input[type="text"],
.modern-form-container input[type="email"],
.modern-form-container input[type="password"],
.modern-form-container input[type="tel"],
.modern-form-container input[type="date"],
.modern-form-container textarea,
.modern-form-container select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #1a1a1a;
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modern-form-control:focus,
.modern-form-container .form-control:focus,
.modern-form-container input:focus,
.modern-form-container textarea:focus,
.modern-form-container select:focus {
  outline: none;
  border-color: #6576ff;
  box-shadow: 0 0 0 3px rgba(101, 118, 255, 0.1);
}

.modern-form-control::placeholder,
.modern-form-container .form-control::placeholder,
.modern-form-container input::placeholder,
.modern-form-container textarea::placeholder {
  color: #adb5bd;
  opacity: 1;
}

.modern-form-control:disabled,
.modern-form-container .form-control:disabled,
.modern-form-container input:disabled,
.modern-form-container textarea:disabled,
.modern-form-container select:disabled {
  background-color: #f8f9fa;
  opacity: 0.65;
  cursor: not-allowed;
}

/* Select Dropdown */
.modern-form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #1a1a1a;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  appearance: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  padding-right: 2.5rem;
}

.modern-form-select:focus {
  outline: none;
  border-color: #6576ff;
  box-shadow: 0 0 0 3px rgba(101, 118, 255, 0.1);
}

/* Textarea */
.modern-form-control textarea,
textarea.modern-form-control {
  min-height: 120px;
  resize: vertical;
}

/* Checkbox and Radio */
.modern-form-check {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  transition: all 0.15s ease-in-out;
}

.modern-form-check:hover {
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

.modern-form-check input[type="checkbox"],
.modern-form-check input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  margin-right: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
}

.modern-form-check label {
  font-size: 0.9375rem;
  color: #1a1a1a;
  cursor: pointer;
  margin: 0;
  flex: 1;
}

/* Multiple Selection Checkboxes */
.modern-checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Form Help Text */
.modern-form-help {
  font-size: 0.8125rem;
  color: #6c757d;
  margin-top: 0.5rem;
  display: block;
}

/* Form Error */
.modern-form-error {
  font-size: 0.8125rem;
  color: #e85347;
  margin-top: 0.5rem;
  display: block;
}

.modern-form-control.is-invalid {
  border-color: #e85347;
}

.modern-form-control.is-invalid:focus {
  border-color: #e85347;
  box-shadow: 0 0 0 3px rgba(232, 83, 71, 0.1);
}

/* Form Row */
.modern-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Form Actions */
.modern-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #e9ecef;
}

.modern-form-actions .btn-group {
  display: flex;
  gap: 1rem;
}

/* Buttons */
.modern-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  transition: all 0.15s ease-in-out;
}

.modern-btn-primary {
  color: #ffffff;
  background-color: #6576ff;
  border-color: #6576ff;
}

.modern-btn-primary:hover {
  background-color: #5568e6;
  border-color: #5568e6;
  color: #ffffff;
}

.modern-btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(101, 118, 255, 0.25);
}

.modern-btn-primary:disabled,
.modern-btn-primary.disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

.modern-btn-secondary {
  color: #1a1a1a;
  background-color: #ffffff;
  border-color: #dee2e6;
}

.modern-btn-secondary:hover {
  background-color: #f8f9fa;
  border-color: #adb5bd;
  color: #1a1a1a;
}

.modern-btn-link {
  color: #6576ff;
  background-color: transparent;
  border: none;
  text-decoration: none;
  padding: 0.5rem 0;
}

.modern-btn-link:hover {
  color: #5568e6;
  text-decoration: underline;
}

.modern-btn-secondary:disabled,
.modern-btn-secondary.disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

/* Security/Privacy Footer */
.modern-form-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
  text-align: center;
}

.modern-form-footer-text {
  font-size: 0.8125rem;
  color: #6c757d;
  margin: 0;
  line-height: 1.6;
}

.modern-form-footer-text a {
  color: #6576ff;
  text-decoration: none;
}

.modern-form-footer-text a:hover {
  text-decoration: underline;
}

/* Security Badge */
.modern-security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #6c757d;
  margin-top: 1rem;
}

.modern-security-badge::before {
  content: "🔒";
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .modern-form-container {
    padding: 1rem;
  }

  .modern-form-row {
    grid-template-columns: 1fr;
  }

  .modern-checkbox-group {
    grid-template-columns: 1fr;
  }

  .modern-form-actions {
    flex-direction: column;
    gap: 1rem;
  }

  .modern-form-actions .btn-group {
    width: 100%;
  }

  .modern-btn {
    width: 100%;
  }
}

/* Multi-step Form Styles */
.modern-form-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.modern-form-steps::before {
  content: '';
  position: absolute;
  top: 1rem;
  left: 0;
  right: 0;
  height: 2px;
  background: #e9ecef;
  z-index: 0;
}

.modern-form-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.modern-form-step-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.modern-form-step.active .modern-form-step-circle {
  background: #6576ff;
  border-color: #6576ff;
  color: #ffffff;
}

.modern-form-step.completed .modern-form-step-circle {
  background: #28a745;
  border-color: #28a745;
  color: #ffffff;
}

.modern-form-step-label {
  font-size: 0.75rem;
  color: #6c757d;
  text-align: center;
}

.modern-form-step.active .modern-form-step-label {
  color: #6576ff;
  font-weight: 500;
}

/* Form Section */
.modern-form-section {
  display: none;
}

.modern-form-section.active {
  display: block;
}

/* Loading State */
.modern-form-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Success State */
.modern-form-success {
  padding: 1.5rem;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 0.5rem;
  color: #155724;
  margin-bottom: 1.5rem;
}

/* Select2 Modern Styling */
.modern-form-container .select2-container,
.select2-container.modern-select2 {
  width: 100% !important;
}

.modern-form-container .select2-container--default .select2-selection--single,
.select2-container--default.modern-select2 .select2-selection--single {
  height: calc(0.875rem * 2 + 1rem + 2px);
  padding: 0;
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modern-form-container .select2-container--default .select2-selection--single:focus,
.modern-form-container .select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.modern-select2.select2-container--focus .select2-selection--single {
  outline: none;
  border-color: #6576ff;
  box-shadow: 0 0 0 3px rgba(101, 118, 255, 0.1);
}

.modern-form-container .select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default.modern-select2 .select2-selection--single .select2-selection__rendered {
  color: #1a1a1a;
  line-height: 1.5;
  padding: 0.875rem 2.5rem 0.875rem 1rem;
  font-size: 1rem;
}

.modern-form-container .select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-container--default.modern-select2 .select2-selection--single .select2-selection__arrow {
  height: 100%;
  right: 0.75rem;
  top: 0;
  width: 20px;
}

.modern-form-container .select2-container--default .select2-selection--single .select2-selection__arrow b,
.select2-container--default.modern-select2 .select2-selection--single .select2-selection__arrow b {
  border-color: #6c757d transparent transparent transparent;
  border-style: solid;
  border-width: 5px 4px 0 4px;
  height: 0;
  left: 50%;
  margin-left: -4px;
  margin-top: -2px;
  position: absolute;
  top: 50%;
  width: 0;
}

.modern-form-container .select2-container--default .select2-selection--multiple,
.select2-container--default.modern-select2 .select2-selection--multiple {
  min-height: calc(0.875rem * 2 + 1rem + 2px);
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modern-form-container .select2-container--default .select2-selection--multiple:focus,
.modern-form-container .select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.modern-select2.select2-container--focus .select2-selection--multiple {
  outline: none;
  border-color: #6576ff;
  box-shadow: 0 0 0 3px rgba(101, 118, 255, 0.1);
}

.modern-form-container .select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container--default.modern-select2 .select2-selection--multiple .select2-selection__choice {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  color: #1a1a1a;
  padding: 0.25rem 0.5rem;
  margin: 0.125rem;
  font-size: 0.875rem;
}

.modern-form-container .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--default.modern-select2 .select2-selection--multiple .select2-selection__choice__remove {
  color: #6c757d;
  margin-right: 0.375rem;
  cursor: pointer;
}

.modern-form-container .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--default.modern-select2 .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: #e85347;
}

.modern-form-container .select2-dropdown,
.select2-dropdown.modern-select2 {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  margin-top: 0.25rem;
}

.modern-form-container .select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default.modern-select2 .select2-results__option--highlighted[aria-selected] {
  background-color: #6576ff;
  color: #ffffff;
}

.modern-form-container .select2-container--default .select2-results__option[aria-selected=true],
.select2-container--default.modern-select2 .select2-results__option[aria-selected=true] {
  background-color: #f8f9fa;
  color: #1a1a1a;
}

.modern-form-container .select2-search--dropdown .select2-search__field,
.select2-search--dropdown.modern-select2 .select2-search__field {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
}

.modern-form-container .select2-search--dropdown .select2-search__field:focus,
.select2-search--dropdown.modern-select2 .select2-search__field:focus {
  outline: none;
  border-color: #6576ff;
  box-shadow: 0 0 0 3px rgba(101, 118, 255, 0.1);
}
