/* === Qualitali Multistep Form v2 === */

.qmf-multistep-form {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  font-family: inherit;
}

/* Step Indicator */
.qmf-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  gap: 0;
}

.qmf-step-indicator .qmf-step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #999;
  background: #fff;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.qmf-step-indicator .qmf-step.active {
  background: #c8102e;
  border-color: #c8102e;
  color: #fff;
}

.qmf-step-indicator .qmf-step.completed {
  background: #c8102e;
  border-color: #c8102e;
  color: #fff;
}

.qmf-step-line {
  height: 2px;
  width: 40px;
  background: #ddd;
  flex-shrink: 0;
}

/* Title */
.qmf-form-title {
  text-align: center;
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 700;
  color: #222;
}

/* Step Content */
.qmf-step-content {
  display: none;
  animation: qmfFadeIn 0.35s ease;
}

.qmf-step-content.active {
  display: block;
}

@keyframes qmfFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.qmf-step-label {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

/* Type Selector (Privato / Azienda) */
.qmf-type-selector {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 20px;
}

.qmf-type-option {
  flex: 1;
  max-width: 220px;
  padding: 24px 16px;
  border: 2px solid #ddd;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: #fafafa;
}

.qmf-type-option:hover {
  border-color: #999;
  background: #f5f5f5;
}

.qmf-type-option.selected {
  border-color: #c8102e;
  background: #fff5f5;
}

.qmf-type-icon {
  display: block;
  margin-bottom: 8px;
  color: #888;
  transition: color 0.25s ease;
}

.qmf-type-option.selected .qmf-type-icon {
  color: #c8102e;
}

.qmf-type-icon svg {
  width: 40px;
  height: 40px;
}

.qmf-type-text {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

/* Fields */
.qmf-field-row {
  display: flex;
  gap: 16px;
  margin-bottom: 4px;
}

.qmf-field-row .qmf-field {
  flex: 1;
}

.qmf-field {
  margin-bottom: 16px;
}

.qmf-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.qmf-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  color: #333;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  background: #fafafa;
}

.qmf-input:focus {
  outline: none;
  border-color: #c8102e;
  background: #fff;
}

/* Textarea */
.qmf-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

/* Select */
select.qmf-input {
  appearance: auto;
}

/* Errors */
.qmf-error {
  display: none;
  color: #d32f2f;
  font-size: 12px;
  margin-top: 4px;
}

/* Navigation */
.qmf-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.qmf-btn {
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.qmf-btn-primary {
  background: #c8102e;
  color: #fff;
}

.qmf-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.qmf-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.qmf-btn-secondary {
  background: transparent;
  color: #666;
  border: 1px solid #ddd;
}

.qmf-btn-secondary:hover {
  background: #f5f5f5;
}

/* Registration Selector (Sì / No) */
.qmf-register-selector {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 20px;
}

.qmf-register-option {
  flex: 1;
  max-width: 220px;
  cursor: pointer;
}

.qmf-register-option input[type="radio"] {
  display: none;
}

.qmf-register-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  border: 2px solid #ddd;
  border-radius: 12px;
  background: #fafafa;
  transition: all 0.25s ease;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.qmf-register-box:hover {
  border-color: #999;
  background: #f5f5f5;
}

.qmf-register-option input:checked + .qmf-register-box {
  border-color: #c8102e;
  background: #fff5f5;
}

.qmf-register-icon {
  font-size: 24px;
  line-height: 1;
}

.qmf-register-option input[value="si"]:checked + .qmf-register-box .qmf-register-icon {
  color: #4caf50;
}

.qmf-register-option input[value="no"]:checked + .qmf-register-box .qmf-register-icon {
  color: #999;
}

.qmf-register-note {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Checkbox */
.qmf-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
}

.qmf-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #c8102e;
}

.qmf-checkbox-label a {
  color: #c8102e;
  text-decoration: underline;
}

/* Success */
.qmf-success-message {
  text-align: center;
  padding: 40px 20px;
}

.qmf-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #4caf50;
  color: #fff;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.qmf-success-text {
  font-size: 18px;
  color: #333;
  font-weight: 600;
}

/* Loader / Spinner */
.qmf-loader {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.qmf-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #eee;
  border-top-color: #c8102e;
  border-radius: 50%;
  animation: qmfSpin 0.7s linear infinite;
}

@keyframes qmfSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 600px) {
  .qmf-multistep-form {
    padding: 20px 16px;
  }

  .qmf-field-row {
    flex-direction: column;
    gap: 0;
  }

  .qmf-type-selector,
  .qmf-register-selector {
    flex-direction: column;
    align-items: center;
  }

  .qmf-type-option,
  .qmf-register-option {
    max-width: 100%;
    width: 100%;
  }

  .qmf-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}
