#quiz-progress {
  position: relative;
  padding-block: 24px 8px;
  margin: 0 24px 24px;
}

#quiz-progress::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: var(--percent, 0%);
  background-color: #06c;
  border-radius: 2px;
  transition: width 0.3s ease;
}
#quiz-progress::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background-color: #eff0f2;
  border-radius: 2px;
  transition: width 0.3s ease;
}


#quiz-question-answering-form {
  padding: 24px;
}
#quiz-question-answering-form h2,
#quiz-question-answering-form .field--entity-quiz-question > div:first-child {
  display: none;
}
#quiz-question-answering-form .field--entity-quiz-question > div:last-child p {
  font-size: 2.222rem;
  line-height: 1.2;
  font-weight: 700;
}

#quiz-question-answering-form table thead {
  display: none;
}
#quiz-question-answering-form table tbody td {
  vertical-align: middle;
  border-bottom: none;
}
#quiz-question-answering-form table tbody td:not(:first-child) {
  width: 100%;
  padding-left: 0;
}
#quiz-question-answering-form table tbody td .js-form-type-radio {
  margin-top: 0;
}
#quiz-question-answering-form table tbody td .js-form-type-radio input[type=radio],
.view-id-quiz_results table tbody input[type=radio],
.view-id-quiz_results table tbody input[type=checkbox] {
  opacity: 1 !important;
  position: initial !important;
  height: 1.5rem;
  width: 1.5rem;
  box-shadow: unset;
}
#quiz-question-answering-form table tbody label,
#quiz-question-answering-form table tbody p {
  margin: 0;
}


#quiz-question-answering-form .form-actions #edit-navigation-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
}
#quiz-question-answering-form .form-actions #edit-navigation-actions:has(> :only-child) {
  justify-content: end;
}
#quiz-question-answering-form .form-actions input {
  width: fit-content;
  border-radius: 100px;
  line-height: 1.3;
}

#quiz-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  margin-top: 56px;
  text-align: center;
}
#quiz-summary::before {
  content: 'Congratulazioni, hai concluso il quiz!';
  font-size: 1.5rem;
  font-weight: bold;
}
#quiz-summary p {
  margin: 0;
}
#quiz_score_possible {
  display: none;
}

#quiz_score_percent {
  text-align: center;
  display: flex;
  flex-direction: column;
  width: fit-content;
  margin: 32px auto;
  text-transform: uppercase;
  color: #435a70;
  font-weight: 600;
  border-bottom: 1px solid #eff0f2;
  padding: 0 92px 32px;
}
#quiz_score_percent .percentage-value {
  font-size: 80px;
  line-height: 1;
  font-weight: 600;
  color: initial;
}

.quiz-additional-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 32px 0 48px;
}
.quiz-additional-stats .quiz-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border: 1px solid #eff0f2;
  border-radius: 32px;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  min-width: 250px;
}
.quiz-additional-stats .quiz-stat .stat-value {
  font-weight: 600;
  font-size: 32px;
}
.quiz-additional-stats .quiz-stat:before {
  content: '';
  width: 32px;
  height: 32px;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.quiz-additional-stats .quiz-stat.quiz-correct-answers:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cg transform='scale(5.33333)'%3E%3Cpath fill='%234caf50' d='M44 24c0 11.045-8.955 20-20 20S4 35.045 4 24 12.955 4 24 4s20 8.955 20 20z'/%3E%3Cpath fill='%23ffffff' d='M34.586 14.586 21.016 28.172l-5.602-5.586-2.828 2.828 8.434 8.414 16.395-16.414z'/%3E%3C/g%3E%3C/svg%3E");
}
.quiz-additional-stats .quiz-stat.quiz-wrong-answers:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%239e0606' d='M44 24c0 11.045-8.955 20-20 20S4 35.045 4 24 12.955 4 24 4s20 8.955 20 20z'/%3E%3Cpath fill='%23fff' d='M29.656 15.516 32.484 18.344 18.344 32.484 15.516 29.656z'/%3E%3Cpath fill='%23fff' d='M32.484 29.656 29.656 32.484 15.516 18.344 18.344 15.516z'/%3E%3C/svg%3E");
}
.quiz-additional-stats .quiz-stat.quiz-time-spent:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cg transform='scale(5.12)'%3E%3Cpath fill='%23003466' d='M25 2C12.317 2 2 12.317 2 25s10.317 23 23 23 23-10.317 23-23S37.683 2 25 2zm0 26c-.462 0-.895-.113-1.286-.3l-6.007 6.007a.999.999 0 0 1-1.414 0 .999.999 0 0 1 0-1.414l6.007-6.007a2.94 2.94 0 0 1-.3-1.286c0-1.304.837-2.403 2-2.816V8c0-.553.447-1 1-1s1 .447 1 1v14.184c1.163.413 2 1.512 2 2.816 0 1.657-1.343 3-3 3z'/%3E%3C/g%3E%3C/svg%3E");
}

.quiz-report-score-container {
  border-radius: 100px;
  padding: 4px 12px !important;
  font-weight: 600;
}
fieldset.js-form-item.form-item.js-form-wrapper.form-wrapper {
  max-width: 1200px;
  margin: auto;
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid #eff0f2;
  border-radius: 32px;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}
fieldset.js-form-item.form-item.js-form-wrapper.form-wrapper legend { display: none; }

#it-block-italiagov-content:has(.answering-form) {
  max-width: 1200px;
  margin: auto;
  padding: 18px;
  margin-top: 42px;
  border-radius: 32px;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}
.quiz-report-score-container.q-correct,
.quiz-report-score-container.q-wrong {
  border: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.quiz-report-score-container.q-correct { color: #277427; }
.quiz-report-score-container.q-correct:before {
  content: '';
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cg transform='scale(5.33333)'%3E%3Cpath fill='%234caf50' d='M44 24c0 11.045-8.955 20-20 20S4 35.045 4 24 12.955 4 24 4s20 8.955 20 20z'/%3E%3Cpath fill='%23ffffff' d='M34.586 14.586 21.016 28.172l-5.602-5.586-2.828 2.828 8.434 8.414 16.395-16.414z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  width: 22px;
  height: 22px;
  display: block;
}
.quiz-report-score-container.q-wrong { color: #9e0606;}
.quiz-report-score-container.q-wrong:before {
  content: '';
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%239e0606' d='M44 24c0 11.045-8.955 20-20 20S4 35.045 4 24 12.955 4 24 4s20 8.955 20 20z'/%3E%3Cpath fill='%23fff' d='M29.656 15.516 32.484 18.344 18.344 32.484 15.516 29.656z'/%3E%3Cpath fill='%23fff' d='M32.484 29.656 29.656 32.484 15.516 18.344 18.344 15.516z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  width: 22px;
  height: 22px;
  display: block;
}

.quiz-result-table {
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 8px;
}
.quiz-result-table thead {
  display: none;
}
#quiz-question-answering-form tbody,
.quiz-result-table tbody {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.quiz-result-table tbody p {
  margin: 0;
}
#quiz-question-answering-form tbody tr,
.quiz-result-table tbody tr.quiz-result-row {
  display: flex;

}
.quiz-result-table tbody tr.quiz-result-row {
  flex-direction: column;
  gap: 8px;
}
.quiz-result-table tbody tr.quiz-result-row.quiz-result-correct .quiz-result-cell-score {
  border-color: #04ab08;
  background-color: #dfd;
  font-weight: 600;
  color: #064e3b;
}
.quiz-result-table tbody tr.quiz-result-row.quiz-result-not-correct.quiz-result-chosen .quiz-result-cell-score {
  border-color: #9e0606;
}
#quiz-question-answering-form tbody tr,
.quiz-result-table tbody .quiz-result-row .quiz-result-cell-score {
  border: 0.5px solid #0000004a;
  border-radius: 32px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quiz-result-table tbody .quiz-result-row .quiz-result-cell-score:before {
  content: '';
  width: 26px;
  height: 26px;
  display: block;
  flex-shrink: 0;
}

.quiz-result-table tbody tr.quiz-result-row.quiz-result-correct .quiz-result-cell-score:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cg transform='scale(5.33333)'%3E%3Cpath fill='%234caf50' d='M44 24c0 11.045-8.955 20-20 20S4 35.045 4 24 12.955 4 24 4s20 8.955 20 20z'/%3E%3Cpath fill='%23ffffff' d='M34.586 14.586 21.016 28.172l-5.602-5.586-2.828 2.828 8.434 8.414 16.395-16.414z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.quiz-result-table tbody tr.quiz-result-row.quiz-result-not-correct.quiz-result-chosen .quiz-result-cell-score:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%239e0606' d='M44 24c0 11.045-8.955 20-20 20S4 35.045 4 24 12.955 4 24 4s20 8.955 20 20z'/%3E%3Cpath fill='%23fff' d='M29.656 15.516 32.484 18.344 18.344 32.484 15.516 29.656z'/%3E%3Cpath fill='%23fff' d='M32.484 29.656 29.656 32.484 15.516 18.344 18.344 15.516z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.quiz-result-table tbody tr.quiz-result-row.quiz-result-correct .quiz-result-cell-score:after,
.quiz-result-table tbody tr.quiz-result-row.quiz-result-not-correct.quiz-result-chosen .quiz-result-cell-score:after {
  margin-left: auto;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
}
.quiz-result-table tbody tr.quiz-result-row.quiz-result-correct.quiz-result-chosen .quiz-result-cell-score:after {
  content: 'La tua risposta';
  background: #f7fefa;
}
.quiz-result-table tbody tr.quiz-result-row.quiz-result-correct.quiz-result-not-chosen .quiz-result-cell-score:after {
  content: 'Risposta corretta';
  background: #f7fefa;
}
.quiz-result-table tbody tr.quiz-result-row.quiz-result-not-correct.quiz-result-chosen .quiz-result-cell-score:after {
  content: 'La tua risposta';
  background: #fff2f2;
  color: #9e0606;
}

/* nascondi i feedback se non sono popolati */
.quiz-result-table tbody tr .quiz-result-cell-answer-feedback:not(:has(*))  {
  display: none;
}
.quiz-result-table tbody tr .quiz-result-cell-answer-feedback,
.quiz-result-table + p,
.quiz-result-table + .general-question-feedback {
  border: none;
  border-left: 4px solid #94a3b8;
  border-radius: 24px;
  background-color: #f9fafc;
}

.quiz-result-table + p,
.quiz-result-table + .general-question-feedback {
  padding: 1em;
  margin: 46px 0 0;
}
.quiz-result-table + p:before,
.quiz-result-table + .general-question-feedback:before {
  content: '';
  width: 100%;
  height: 1px;
  display: block;
  background-color: rgb(67 90 112 / 22%);
  top: -38px;
  position: relative;
}

.quiz-question-header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.quiz-question-header-wrapper .quiz-question-legend {
  text-transform: uppercase;
  color: #4e5969;
  font-size: 14px;
}
.quiz-question-title {
  font-size: 26px;
  font-weight: 600;
  margin: 1.2rem 0;
}
.quiz-question-title p { margin: 0; }

.error-message-not-answered {
  display: none;
}
#it-block-italiagov-content:has(.answering-form input[aria-invalid="true"]) .error-message-not-answered {
  display: block;
  border-radius: 100px;
  padding: 1em;
  font-weight: 600;
  color: #9e0606;
  border: 1px solid #9e0606;
  background-color: #fcc;
  display: flex;
  align-items: center;
  gap: 38px;
  margin: 0 24px;
}
#it-block-italiagov-content:has(.answering-form input[aria-invalid="true"]) .error-message-not-answered::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='22' fill='%239e0606'/%3E%3Crect x='22' y='11' width='4' height='18' rx='2' fill='%23ffffff'/%3E%3Ccircle cx='24' cy='34' r='2.5' fill='%23ffffff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.answering-form .form-item--error-message.invalid-feedback {
  display: none;
}

.answering-form table:has(input[aria-invalid="true"]) tr {
  border-color: #9e0606 !important;
}

@media (max-width: 992px) {
  .quiz-additional-stats {
    flex-direction: column;
    gap: 16px;
  }
}
