/* Eagle Wizard — usa i token del tema eagleitalia (custom.scss :root). */
.eaglewizard {
  margin-bottom: 3rem;
}

/* Barra dei passi: resta in cima mentre si scorre (es. le 26 opzioni del passo allergeni). */
.eaglewizard__bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.5rem;
  margin-bottom: 1.5rem;
  padding: .75rem 0;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}

.eaglewizard__steps {
  display: flex;
  flex: 1 1 auto;
  gap: .5rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eaglewizard__step {
  flex: 1 1 0;
  min-width: 0;
}

.eaglewizard__step-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .25rem;
  border: 0;
  background: none;
  color: var(--text2-color, #a2a2a2);
  font: inherit;
  text-align: left;
}

button.eaglewizard__step-btn {
  cursor: pointer;
}

button.eaglewizard__step-btn:hover .eaglewizard__step-label {
  text-decoration: underline;
}

button.eaglewizard__step-btn:focus-visible {
  outline: 2px solid var(--primary-color, #f1913d);
  outline-offset: 2px;
  border-radius: 8px;
}

.eaglewizard__step-num {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 700;
}

.eaglewizard__step-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.eaglewizard__step-label {
  font-size: .875rem;
  font-weight: 700;
}

.eaglewizard__step-value {
  overflow: hidden;
  font-size: .8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eaglewizard__step.is-done .eaglewizard__step-btn,
.eaglewizard__step.is-reached .eaglewizard__step-btn {
  color: var(--text-color, #403d39);
}

.eaglewizard__step.is-done .eaglewizard__step-num {
  border-color: var(--primary-color, #f1913d);
  background: var(--primary-color, #f1913d);
  color: #fff;
}

.eaglewizard__step.is-current .eaglewizard__step-btn {
  color: var(--primary-color, #f1913d);
}

/* Solo su mobile, al posto dei nomi dei passi. */
.eaglewizard__steps-current {
  display: none;
  margin: 0;
  color: var(--primary-color, #f1913d);
  font-weight: 700;
}

.eaglewizard__count {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
}

.eaglewizard__panel {
  background: var(--bg1, #f5f5f5);
  border-radius: 15px;
  padding: 2rem;
  outline: none;
}

.eaglewizard__panel:focus-visible {
  outline: 2px solid var(--primary-color, #f1913d);
  outline-offset: 2px;
}

.eaglewizard__question {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

.eaglewizard__info-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--primary-color, #f1913d);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.eaglewizard__info-btn:hover {
  color: var(--primary-hover, #f1aa52);
}

.eaglewizard__info-btn:focus-visible {
  outline: 2px solid var(--primary-color, #f1913d);
  outline-offset: 2px;
}

.eaglewizard__text {
  color: var(--text-color, #403d39);
  margin-bottom: 1rem;
}

.eaglewizard__options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
  margin-top: 1.5rem;
}

.eaglewizard__option {
  border: 2px solid #fff;
  background: #fff;
  color: var(--text-color, #403d39);
  border-radius: 15px;
  padding: .875rem 1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.eaglewizard__option:hover,
.eaglewizard__option:focus-visible {
  border-color: var(--primary-color, #f1913d);
}

.eaglewizard__option.is-selected {
  background: var(--primary-color, #f1913d);
  border-color: var(--primary-color, #f1913d);
  color: #fff;
}

/* Indietro a sinistra, Continua a destra (anche quando Indietro e' nascosto). */
.eaglewizard__footer {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1.5rem;
}

.eaglewizard__footer .btn,
.eaglewizard__results .btn {
  border-radius: 15px;
}

.eaglewizard__footer [data-ew-next] {
  margin-left: auto;
}

/* Pulsante dei risultati, centrato nel pannello della schermata finale. */
.eaglewizard__results {
  margin-top: 1.5rem;
  text-align: center;
}

/* Approfondimento in finestra modale (<dialog> nativo, nello strato superiore). */
.eaglewizard__dialog {
  width: min(640px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
  color: var(--text-color, #403d39);
}

.eaglewizard__dialog::backdrop {
  background: rgba(0, 0, 0, .5);
}

.eaglewizard__dialog-inner {
  position: relative;
  padding: 2rem;
}

.eaglewizard__dialog-dismiss {
  position: absolute;
  top: .75rem;
  right: .75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-color, #403d39);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.eaglewizard__dialog-dismiss:hover {
  color: var(--primary-color, #f1913d);
}

.eaglewizard__dialog-dismiss:focus-visible {
  outline: 2px solid var(--primary-color, #f1913d);
  outline-offset: 2px;
}

.eaglewizard__dialog-title {
  margin-bottom: 1rem;
  padding-right: 2.5rem;
}

/* I paragrafi possono contenere a capo semplici (\n), come i <br> del sito originale. */
.eaglewizard__dialog-body p {
  margin-bottom: .75rem;
  white-space: pre-line;
}

.eaglewizard__dialog [data-ew-dialog-close] {
  margin-top: .5rem;
  border-radius: 15px;
}

@media (max-width: 767px) {
  .eaglewizard__steps {
    flex-basis: 100%;
    justify-content: space-between;
  }

  .eaglewizard__step {
    flex: 0 0 auto;
  }

  .eaglewizard__step-text {
    display: none;
  }

  .eaglewizard__steps-current {
    display: block;
  }
}

@media (max-width: 575px) {
  .eaglewizard__panel,
  .eaglewizard__dialog-inner {
    padding: 1.25rem;
  }

  .eaglewizard__options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
