/**
 * Smartlink Vendor Pre-Qualification Form Styles
 *
 * Color scheme matches Smartlink branding:
 * - Primary: #0066CC (Smartlink blue)
 * - Secondary: #004499 (darker blue)
 * - Accent: #00AA55 (green for success)
 * - Error: #CC3333 (red for errors)
 */

/* Container */
#sml-vendor-form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
}

/* Progress Bar */
.sml-progress {
  background: #e9ecef;
  border-radius: 8px;
  height: 8px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.sml-progress-bar {
  background: linear-gradient(90deg, #0066CC, #004499);
  height: 100%;
  width: 7.7%;
  transition: width 0.3s ease;
  border-radius: 8px;
}

.sml-progress-text {
  display: block;
  text-align: center;
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

/* Form Sections */
.sml-section {
  display: none;
  border: none;
  padding: 0;
  margin: 0;
}

.sml-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.sml-section legend {
  font-size: 24px;
  font-weight: 700;
  color: #0066CC;
  margin-bottom: 5px;
  padding: 0;
  width: 100%;
  border-bottom: 2px solid #0066CC;
  padding-bottom: 10px;
}

.sml-section-desc {
  color: #666;
  margin-bottom: 25px;
  font-size: 15px;
}

/* Form Fields */
.sml-field {
  margin-bottom: 20px;
}

.sml-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.sml-field .required-star {
  color: #CC3333;
}

.sml-field input[type="text"],
.sml-field input[type="email"],
.sml-field input[type="tel"],
.sml-field input[type="number"],
.sml-field select,
.sml-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.sml-field input:focus,
.sml-field select:focus,
.sml-field textarea:focus {
  outline: none;
  border-color: #0066CC;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.sml-field input.error,
.sml-field select.error,
.sml-field textarea.error {
  border-color: #CC3333;
}

.sml-field input.error:focus,
.sml-field select.error:focus,
.sml-field textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(204, 51, 51, 0.15);
}

.sml-field textarea {
  resize: vertical;
  min-height: 80px;
}

.sml-error {
  display: block;
  color: #CC3333;
  font-size: 13px;
  margin-top: 4px;
  min-height: 18px;
}

/* Checkbox and Radio Groups */
.sml-checkbox-group,
.sml-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sml-checkbox-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  .sml-checkbox-columns {
    grid-template-columns: 1fr;
  }
}

.sml-checkbox,
.sml-radio {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  transition: all 0.2s;
  flex: 0 0 auto;
}

.sml-checkbox:hover,
.sml-radio:hover {
  background: #e9ecef;
  border-color: #0066CC;
}

.sml-checkbox input,
.sml-radio input {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  accent-color: #0066CC;
}

.sml-checkbox span,
.sml-radio span {
  font-size: 14px;
}

/* Privacy consent checkbox */
.sml-consent-field {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #dee2e6;
}

.sml-consent-checkbox {
  background: #fff8e6 !important;
  border-color: #ffc107 !important;
  align-items: flex-start;
}

.sml-consent-checkbox:hover {
  background: #fff3cd !important;
  border-color: #e0a800 !important;
}

.sml-consent-checkbox span {
  line-height: 1.5;
}

#sml-vendor-form-container .sml-consent-checkbox a,
.sml-consent-checkbox a,
.sml-consent-checkbox span a {
  color: #0066CC !important;
  text-decoration: underline !important;
  font-size: 14px !important;
  font-weight: normal !important;
  display: inline !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  border: none !important;
  line-height: inherit !important;
  vertical-align: baseline !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

#sml-vendor-form-container .sml-consent-checkbox a:hover,
.sml-consent-checkbox a:hover,
.sml-consent-checkbox span a:hover {
  color: #004999 !important;
  background: none !important;
}

.sml-consent-checkbox.error {
  background: #fff5f5 !important;
  border-color: #dc3545 !important;
}

/* Radio groups - inline */
.sml-radio-group {
  gap: 15px;
}

.sml-radio {
  min-width: 80px;
}

/* Navigation Buttons */
.sml-nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.sml-btn {
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.sml-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sml-btn-prev {
  background: #e9ecef;
  color: #333;
}

.sml-btn-prev:hover:not(:disabled) {
  background: #dee2e6;
}

.sml-btn-next {
  background: #0066CC;
  color: white;
}

.sml-btn-next:hover:not(:disabled) {
  background: #004499;
}

.sml-btn-submit {
  background: linear-gradient(135deg, #00AA55, #008844);
  color: white;
  min-width: 200px;
}

.sml-btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #008844, #006633);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 170, 85, 0.3);
}

.sml-btn-submit:disabled {
  background: linear-gradient(135deg, #88DDAA, #77CC99);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Form Status Messages */
.sml-form-status {
  padding: 15px 20px;
  border-radius: 6px;
  margin-top: 20px;
  text-align: center;
}

.sml-form-status.loading {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

.sml-form-status.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.sml-form-status.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

/* Loading Spinner */
.sml-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #90caf9;
  border-top-color: #1565c0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success Message */
.sml-success-message {
  text-align: center;
  padding: 40px 20px;
}

.sml-success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #00AA55, #008844);
  color: white;
  font-size: 48px;
  line-height: 80px;
  border-radius: 50%;
  margin: 0 auto 20px;
}

.sml-success-message h2 {
  color: #00AA55;
  margin-bottom: 15px;
}

.sml-success-message p {
  color: #666;
  margin-bottom: 10px;
}

.sml-reference {
  background: #f8f9fa;
  padding: 10px 20px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 15px;
  font-family: monospace;
}

/* Responsive */
@media (max-width: 600px) {
  #sml-vendor-form-container {
    padding: 15px;
  }

  .sml-section legend {
    font-size: 20px;
  }

  .sml-checkbox-group {
    flex-direction: column;
  }

  .sml-checkbox {
    width: 100%;
  }

  .sml-nav-buttons {
    flex-wrap: wrap;
    gap: 10px;
  }

  .sml-btn {
    flex: 1 1 100%;
    text-align: center;
  }

  .sml-btn-next,
  .sml-btn-submit {
    order: -1;
  }
}

/* Accessibility */
.sml-field input:focus-visible,
.sml-field select:focus-visible,
.sml-field textarea:focus-visible,
.sml-btn:focus-visible {
  outline: 2px solid #0066CC;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .sml-nav-buttons,
  .sml-progress {
    display: none;
  }

  .sml-section {
    display: block !important;
    page-break-inside: avoid;
  }
}
