/* Layout principale */
.form-wrapper {
  max-width: 640px;
  margin: 2rem auto;
  padding: 2rem 1.5rem;
  padding-bottom: 11rem;
}

/* Step (box campi) */
.step {
  background: #fff;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 0;
}

.step-header {
  margin-bottom: 1.25rem;
}

.step-header .step-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #212529;
}

.step-header .step-description {
  font-size: 0.9375rem;
  color: #6c757d;
  margin-bottom: 0;
  line-height: 1.5;
}

/* Campi (griglia Bootstrap) */
.step .row {
  margin-left: 0;
  margin-right: 0;
}

.field {
  margin-bottom: 0;
  margin-top: 2rem;
}

.field .form-label {
  margin-bottom: 0.35rem;
}

.field label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.35rem;
}

.field input.form-control {
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
}

.field input.form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.field input.form-control.is-invalid,
.field select.form-select.is-invalid {
  border-color: #dc3545;
}

.field select.form-select {
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
}

/* Image */
.image-component {
  width: 100%;
  background-color: #f8f9fa;
}

.image-field {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -2rem;
  margin-bottom: 1rem;
}

/* Select Card */
.select-card-field.is-invalid .select-card-grid {
  border-color: #dc3545;
  border-radius: 0.375rem;
}

.select-card-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(var(--cards-per-row-mobile, 1), 1fr);
}

@media (min-width: 768px) {
  .select-card-grid {
    grid-template-columns: repeat(var(--cards-per-row-desktop, 5), 1fr);
  }
}

.select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 80px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 2px solid #dee2e6;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.select-card:hover {
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.05);
}

.select-card.selected {
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.12);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.select-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #6c757d;
}

.select-card.selected .select-card-icon {
  color: #0d6efd;
}

.select-card-label {
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  color: #212529;
}

/* Select List */
.select-list-field.is-invalid .select-list {
  border-color: #dc3545;
}

.select-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.select-list-item {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #dee2e6;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #212529;
  text-align: left;
}

.select-list-item:hover {
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.05);
}

.select-list-item.selected {
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.12);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.progress-wrapper {
  margin: 0 2rem 1rem;
}

.progress-label {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.progress-wrapper .progress {
  height: 6px;
  background-color: #e9ecef;
  border-radius: 0.375rem;
  overflow: hidden;
}

.progress-wrapper .progress-bar {
  height: 100%;
  background-color: #0d6efd;
  border-radius: 0.375rem;
  transition: width 0.3s ease;
}

/* Pulsante Indietro (sopra, piccolo) */
.nav-back {
  margin-bottom: 1rem;
}

.nav-back-btn {
  padding: 0.25rem 0;
  font-size: 0.875rem;
  text-decoration: none;
  color: #6c757d;
}

.nav-back-btn:hover {
  color: #212529;
  text-decoration: underline;
}

/* Pulsante Submit (sotto il box) */
.nav-submit {
  margin-top: 0;
}

.nav-submit .btn-submit {
  width: 100%;
  padding: 0.625rem 1rem;
  font-weight: 500;
}

.powered-by {
  margin-top: 0.35rem;
  text-align: center;
  font-size: 0.75rem;
}

.powered-by a {
  color: #6c757d;
  text-decoration: none;
}

.powered-by a:hover {
  color: #495057;
  text-decoration: underline;
}

.form-bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 1.5rem));
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem 0.625rem;
  z-index: 1000;
}
.form-alert {
  margin-top: 1rem;
  margin-bottom: 0;
}
.result-message {
  padding: 2rem;
  text-align: center;
  font-weight: 500;
}
.field .form-label {
  font-size: 26px;
  line-height: 1.2;
}
.field .form-label {
  margin-bottom: 1.5rem;
}
.nav-back {
  margin-bottom: 0rem;
  color: #fff;
}
.nav-back button{
  color: #fff;
}
.image-field{
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.image-field.heading-image{
  margin-top: -2rem;
}
.select-card-image{
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.5rem auto;
  filter: brightness(0) invert(1);
}
.selected .select-card-image{
  filter: none;
}
.highlight-step .select-card-image{
  filter: none;
}
.highlight-step .selected .select-card-image{
  filter: brightness(0) invert(1);
}
.select-card-label {
  line-height: 1.5rem;
}