.hidden {
  display: none;
}

.output {
  margin-top: 10px;
  color: green;
}

.error {
  color: red;
  border: 1px solid red;
  padding: 10px;
  margin-top: 10px;
}

.input {
  padding: 10px;
  border: 2px solid #aaa;
  border-radius: 6px;
  font-size: 16px;
  width: 250px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input:focus {
  border-color: #3366cc;
  box-shadow: 0 0 5px rgba(51, 102, 204, 0.5);
  outline: none;
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup.hidden {
  display: none;
}

.popup-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
}



/* Inizio setup pagina personale */
.contenitore {
  max-width: 500px;
  margin: 1rem auto;
  /* centra orizzontalmente */
  padding: 0.3rem 1.2rem;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.contenitore p {
  line-height: 0.8rem;
}

.contenitore h2 {
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--colore-primario);
  margin: 0.5rem 0;
  text-align: center;
}

/* Bottone apri/chiudi carta cliente */
#toggle-carta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto 0.5rem;
  background-color: var(--colore-secondario);
  color: white;
  border: none;
  padding: 10px 15px 10px 12px;
  border-radius: 6px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 1px;
}

/* Contenitore fisarmonica carta cliente */
#box-carta {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  background-color: #fafafa;
  border-radius: 12px;
}

#box-carta.carta-expanded {
  max-width: 500px;
  max-height: 500px;
  border: 2px solid var(--colore-secondario);
  padding: 0.8rem;
  margin: 1rem auto;
  text-align: center;
}

#qrcode {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem auto;
  width: 100%;
}

.testo-carta {
  font-family: 'Inter Tight', sans-serif;
  font-size: 15px;
  margin-top: 2rem;
}



/* Etichette e testi dentro la sezione preferiti */
#box-preferiti label {
  display: block;
  margin: 5px 0 5px;
}

#box-preferiti textarea {
  display: block;
  width: 100%;
  /* occupa tutta la larghezza */
  min-height: 80px;
  padding: 10px;
  border-radius: 6px;
  /* angoli arrotondati su entrambi i lati */
  border: 1px solid #ccc;
  resize: vertical;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  box-sizing: border-box;
  /* evita che il padding sfori */
}

#rispostaInformazioni {
  margin: 0;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
}



/* Contenitori fisarmonica (Profilo, Password, Preferiti) */
#box-profilo,
#box-pw-change,
#box-preferiti {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  margin-top: 0;
  margin-bottom: 0;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

#box-profilo.profilo-expanded,
#box-pw-change.pw-change-expanded,
#box-preferiti.preferiti-expanded {
  max-height: 800px;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  padding-top: 1.2rem;
  padding-bottom: 1.5rem;
  margin: 0 auto 2.5rem;
  margin-top: 2rem;
}

/* Etichette e Input */
#box-profilo label,
#box-pw-change label,
#box-preferiti label {
  display: block;
  margin: 5px 0;
}

#box-profilo input,
#box-pw-change input,
#box-preferiti textarea {
  display: block;
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  box-sizing: border-box;
}

#pw-requirements {
  margin: 10px 0;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 6px;
  border: 1px solid #eee;
}

#pw-requirements p {
  margin: 0 0 5px 0;
  font-weight: 600;
  font-size: 13px;
}

#pw-requirements ul {
  margin: 0;
  padding-left: 20px;
  list-style-type: disc;
}

#pw-requirements li {
  font-size: 13px;
  margin-bottom: 3px;
  transition: color 0.3s ease;
}

.req-invalid {
  color: #888;
}

.req-valid {
  color: #28a745;
  font-weight: 500;
}

.req-valid::before {
  content: "✓ ";
}

/* Bottoni icona+testo (aggiorna) */
.btn-dashboard-aggiorna {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: none;
  color: var(--colore-primario);
  border: 2px solid var(--colore-primario);
  border-radius: 8px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  transition: opacity 0.2s;
}

.btn-annulla {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: none;
  color: var(--colore-primario);
  margin: 0.2rem;
  border: 2px solid var(--colore-primario);
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-cancella {
  display: block;
  padding: 0.5rem 1rem;
  background: none;
  color: var(--colore-secondario);
  margin: 0rem auto 4rem;
  border: 2px solid var(--colore-secondario);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* -----------------------------------------------
   Riga di bottoni allineati (coupon/invita e gestione)
   Stessa larghezza dei .contenitore
----------------------------------------------- */
.riga-bottoni-dashboard {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 500px;
  margin: 1rem auto;
  padding: 0;
}

/* Bottoni icona+testo (coupon / invita un amico) */
.btn-dashboard {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background-color: var(--colore-primario);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  transition: opacity 0.2s;
}


.btn-dashboard span {
  display: block;
  text-align: center;
}

.btn-dashboard--green {
  background-color: #2b8a3e;
}

.btn-dashboard--gray {
  background-color: #495057;
}