/* ==========================================================================
   Quiz di pre-qualifica (finestra sopra la pagina) — colori e font del sito
   ========================================================================== */
html.quiz-open { overflow: hidden; }

.quiz {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.quiz.is-open { opacity: 1; }
.quiz[hidden] { display: none; }
.quiz__backdrop { position: absolute; inset: 0; background: rgba(13, 11, 11, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

.quiz__dialog {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 32px 36px 30px;
  border-radius: 28px;
  background:
    radial-gradient(70% 50% at 100% 0%, rgba(95, 0, 10, 0.07) 0%, transparent 100%),
    #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  font-family: "Inter", sans-serif;
  color: #111;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.35s cubic-bezier(.22, .61, .36, 1);
}
.quiz.is-open .quiz__dialog { transform: none; }

.quiz__x {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
}
.quiz__x:hover { background: rgba(0, 0, 0, 0.1); }
.quiz__x svg { width: 18px; height: 18px; fill: none; stroke: #111; stroke-width: 2; stroke-linecap: round; }

.quiz__top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-right: 44px; }
.quiz__eyebrow { padding: 4px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.quiz__count { font-size: 13px; font-weight: 500; color: #888; }
.quiz__bar { height: 4px; margin-bottom: 30px; border-radius: 4px; background: rgba(95, 0, 10, 0.1); overflow: hidden; }
.quiz__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #b3263a, var(--accent)); transition: width 0.4s ease; }

.quiz__body.is-in { animation: quiz-in 0.35s ease both; }
@keyframes quiz-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

.quiz__title {
  margin: 0 0 10px;
  font-family: "Geist", sans-serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: #111;
}
.quiz__help { margin: 0 0 20px; font-size: 15px; line-height: 1.5; color: #666; }
.quiz__help strong { color: #111; }

.quiz__input {
  width: 100%;
  margin-top: 12px;
  padding: 16px 18px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  background: #fff;
  font: 400 17px/1.3 "Inter", sans-serif;
  color: #111;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.quiz__input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(95, 0, 10, 0.1); }

.quiz__opts { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.quiz__opts--multi { grid-template-columns: 1fr 1fr; }
.quiz__opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  background: #fff;
  font: 500 15px/1.3 "Inter", sans-serif;
  color: #222;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}
.quiz__opt:hover { border-color: rgba(95, 0, 10, 0.4); }
.quiz__opt:active { transform: scale(0.99); }
.quiz__opt i {
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  transition: all 0.2s ease;
}
.quiz__opts--multi .quiz__opt i { border-radius: 6px; }
.quiz__opt.is-on { border-color: var(--accent); background: rgba(95, 0, 10, 0.05); color: #111; }
.quiz__opt.is-on i {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
}

.quiz__error { min-height: 20px; margin: 12px 0 0; font-size: 14px; color: #b3263a; }
.quiz__nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.quiz__nav[hidden] { display: none; }
.quiz__back { padding: 10px 4px; border: 0; background: none; font: 500 15px "Inter", sans-serif; color: #666; cursor: pointer; }
.quiz__back:hover { color: #111; }
.quiz__next {
  padding: 14px 26px;
  border: 1px solid rgba(217, 86, 106, 0.3);
  border-radius: 999px;
  background: linear-gradient(155deg, #b3263a 0%, #7a0010 55%, var(--accent) 100%);
  color: #fff;
  font: 600 16px/1 "Inter", sans-serif;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(190, 30, 55, 0.3), 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.quiz__next:hover { transform: translateY(-1px); box-shadow: 0 0 34px rgba(190, 30, 55, 0.45), 0 6px 18px rgba(0, 0, 0, 0.25); }
.quiz__next:disabled { opacity: 0.6; cursor: wait; }

.quiz__done { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 0 4px; }
.quiz__check { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 18px; border-radius: 50%; background: var(--accent); box-shadow: 0 10px 30px rgba(95, 0, 10, 0.35); animation: quiz-pop 0.5s cubic-bezier(.34, 1.56, .64, 1) both; }
.quiz__check svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes quiz-pop { from { transform: scale(0.5); opacity: 0; } to { transform: none; opacity: 1; } }
.quiz__done .quiz__help { max-width: 420px; }

@media (max-width: 600px) {
  .quiz { padding: 0; align-items: flex-end; }
  .quiz__dialog { max-height: 92vh; padding: 26px 20px 22px; border-radius: 24px 24px 0 0; }
  .quiz__title { font-size: 24px; }
  .quiz__opts--multi { grid-template-columns: 1fr; }
  .quiz__nav { position: sticky; bottom: -22px; padding: 12px 0 2px; background: #fff; }
}

.quiz__altro { margin-top: 12px; }
.quiz__altro[hidden] { display: none; }

/* Mini sondaggio "come mi hai conosciuto?" nella schermata finale */
.quiz__survey { width: 100%; max-width: 440px; margin: 4px 0 22px; padding: 16px; border: 1px dashed rgba(0, 0, 0, 0.12); border-radius: 16px; }
.quiz__survey-q { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: #777; }
.quiz__survey-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.quiz__survey-opts button {
  padding: 7px 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: #fff;
  font: 500 13px "Inter", sans-serif;
  color: #333;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.quiz__survey-opts button:hover:not(:disabled) { border-color: var(--accent); }
.quiz__survey-opts button.is-on { border-color: var(--accent); background: var(--accent); color: #fff; }
.quiz__survey-opts button:disabled:not(.is-on) { opacity: 0.45; cursor: default; }
.quiz__survey-thanks { margin: 10px 0 0; font-size: 13px; color: var(--accent); }
