.ks-widget * {
  box-sizing: border-box;
}

.ks-widget {
  width: min(100%, 1040px);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d9e2e7;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(31, 41, 51, 0.08);
}

.ks-progress {
  height: 8px;
  background: #e8eef1;
}

.ks-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 163, 226, 1) 0%, rgba(152, 199, 74, 1) 100%);
  transition: width 180ms ease;
}

.ks-form {
  padding: 32px;
}

.ks-step {
  display: none;
}

.ks-step.is-active {
  display: block;
}

.ks-kicker {
  margin: 0 0 8px;
  color: #007c89;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ks-step > h2 {
  margin: 0 0 41px;
  font-size: var(--aks-heading-font-size, clamp(26px, 4vw, 38px));
  line-height: var(--aks-heading-line-height, 1.14);
}

.ks-copy {
  max-width: 52ch;
  margin: 0 0 24px;
  color: #53616b;
  font-size: var(--aks-copy-font-size, 17px);
  line-height: var(--aks-copy-line-height, 1.55);
}

.ks-copy p {
  margin: 0 0 12px;
}

.ks-copy p:last-child {
  margin-bottom: 0;
}

.ks-widget .ks-copy p,
.ks-widget .ks-copy ul,
.ks-widget .ks-copy ol,
.ks-widget .ks-copy li,
.ks-widget .ks-copy ul *,
.ks-widget .ks-copy ol * {
  line-height: var(--aks-copy-line-height, 1.55) !important;
}

.ks-copy h3 {
  margin: 0 0 16px;
  color: #000000;
  font-size: var(--aks-subheading-font-size, 22px);
  line-height: var(--aks-subheading-line-height, 1.28);
  font-weight: 700;
}

.ks-copy h3:not(:first-child) {
  margin-top: 24px;
}

.ks-content-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin: 0 0 24px;
}

.ks-content-column--main {
  display: grid;
  gap: 24px;
  align-content: start;
}

.ks-content-column--aside {
  display: grid;
  gap: 16px;
}

.ks-content-row .ks-copy,
.ks-content-row .ks-media,
.ks-content-row .ks-hint {
  margin-bottom: 0;
}

.ks-content-row .ks-copy {
  max-width: none;
}

.ks-step[data-type="knowledge"] .ks-content-column--main {
  grid-column: 1 / -1;
}

.ks-step[data-type="knowledge"] .ks-content-column--aside {
  display: none;
}

.ks-media {
  margin: 0 0 24px;
  overflow: hidden;
  border-radius: 15px;
}

.ks-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
}

.ks-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid #d9e2e7;
  border-radius: 6px;
  color: #53616b;
  font-size: var(--aks-hint-font-size, 17px);
  line-height: var(--aks-hint-line-height, 1.5);
}

.ks-hint__icon {
  display: inline-flex;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1px solid #007c89;
  border-radius: 50%;
  color: #007c89;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.ks-hint__text p {
  margin: 0 0 8px;
}

.ks-hint__text p:last-child {
  margin-bottom: 0;
}

.ks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ks-actions--stacked {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
}

.ks-actions--stacked .ks-button,
.ks-actions--stacked .ks-choice {
  width: 100%;
}

.ks-knowledge {
  display: grid;
  gap: 20px;
}

.ks-knowledge__feedback:not(:empty) {
  display: grid;
  gap: 24px;
}

.ks-knowledge__failed-view:not([hidden]) {
  display: grid;
  gap: 24px;
}

.ks-step.is-knowledge-failed .ks-copy {
  display: none;
}

.ks-knowledge__review {
  display: grid;
  gap: 16px;
}

.ks-knowledge__review:empty {
  display: none;
}

.ks-knowledge-review__head {
  padding: 16px;
  background: #f4f7f8;
  border: 1px solid #d9e2e7;
  border-radius: 6px;
}

.ks-knowledge-review__head p {
  margin: 8px 0 0;
  color: #53616b;
}

.ks-knowledge__journey-back {
  display: none;
  justify-self: start;
  order: 20;
  width: 100%;
}

.ks-knowledge.is-first-panel > .ks-knowledge__journey-back,
.ks-knowledge.has-result > .ks-knowledge__journey-back {
  display: inline-flex;
  align-items: center;
}

.ks-knowledge__panel {
  display: none;
}

.ks-knowledge__panel.is-active {
  display: grid;
  gap: 20px;
}

.ks-knowledge.has-result .ks-knowledge__panel {
  display: none;
}

.ks-refusal,
.ks-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: var(--aks-question-font-size, 17px);
  line-height: var(--aks-question-line-height, 1.45);
}

.ks-option,
.ks-option input {
  cursor: pointer;
}

.ks-option.is-selected-wrong {
  background: #ffe0dc;
  border-color: #c7362d;
  box-shadow: inset 4px 0 0 #c7362d;
}

.ks-option.is-missing-correct {
  background: #dff5df;
  border-color: #23813b;
  box-shadow: inset 4px 0 0 #23813b;
}

.ks-option.is-selected-correct {
  background: #eaf8ea;
  border-color: #52a463;
  box-shadow: inset 4px 0 0 #52a463;
}

.ks-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ks-option.is-disabled input,
.ks-option.is-disabled span {
  cursor: not-allowed;
}

.ks-option__status {
  margin-left: auto;
  padding-left: 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.ks-refusal {
  padding: 14px;
  background: #f4f7f8;
  border: 1px solid #d9e2e7;
  border-radius: 6px;
}

.ks-knowledge__question {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px;
  border: 1px solid #d9e2e7;
  border-radius: 6px;
  font-size: var(--aks-question-font-size, 17px);
  line-height: var(--aks-question-line-height, 1.45);
}

.ks-knowledge__question--review {
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(31, 41, 51, 0.06);
}

.ks-knowledge__question--review input:disabled {
  opacity: 1;
}

.ks-knowledge__question legend {
  padding: 0 6px;
  font-weight: 700;
}

.ks-knowledge__question:focus {
  outline: 3px solid rgba(36, 164, 223, 0.3);
  outline-offset: 2px;
}

.ks-knowledge__question[aria-invalid="true"] {
  border-color: #a52820;
}

.ks-knowledge__counter,
.ks-knowledge__title {
  display: block;
}

.ks-knowledge__counter {
  margin-bottom: 6px;
  color: #53616b;
  font-size: 14px;
}

.ks-knowledge__correct-count {
  margin: -4px 0 4px;
  color: #53616b;
  font-size: 14px;
}

.ks-result {
  display: grid;
  gap: 14px;
  margin: 0 0 24px;
}

.ks-result:empty {
  display: none;
}

.ks-result__group,
.ks-warning {
  padding: 16px;
  background: #f4f7f8;
  border: 1px solid #d9e2e7;
  border-radius: 6px;
}

.ks-warning {
  background: #fff8e5;
  border-color: #f0c36a;
}

.ks-success {
  padding: 16px;
  background: #eaf8ea;
  border: 1px solid #52a463;
  border-radius: 6px;
}

.ks-success p {
  margin: 8px 0 0;
}

.ks-field-error {
  margin: -10px 0 0;
  color: #a52820;
  font-weight: 700;
}

.ks-field-error[hidden] {
  display: none;
}

.ks-result ul,
.ks-warning ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.ks-warning p {
  margin: 8px 0 0;
}

.ks-warning div {
  margin-top: 8px;
}

.ks-warning div p {
  margin: 0 0 8px;
}

.ks-warning div p:last-child {
  margin-bottom: 0;
}

.ks-knowledge-errors {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.ks-knowledge-error {
  padding-top: 12px;
  border-top: 1px solid #f0c36a;
}

.ks-knowledge-error p {
  margin: 8px 0 0;
}

.ks-button,
.ks-choice,
.ks-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 6px !important;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.ks-button,
.ks-choice {
  padding: 0 20px;
  background: #00a3e2;
  color: #ffffff;
  font-size: clamp(1rem, 1rem + ((1vw - 0.2rem) * 0.16), 1.13rem);
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: none;
}

.ks-choice {
  min-width: 120px;
}

.ks-widget .eg-button--gray {
  background: #777777;
  color: #ffffff;
}

.ks-choice:hover:not(:disabled),
.ks-button:hover:not(:disabled) {
  background: #000000;
  color: #ffffff;
  filter: none;
  text-decoration: none;
  transform: none;
}

.ks-choice:focus-visible,
.ks-button:focus-visible {
  outline: 3px solid rgba(36, 164, 223, 0.3);
  outline-offset: 2px;
  filter: none;
  transform: none;
}

.ks-choice:disabled,
.ks-choice[aria-disabled="true"],
.ks-button:disabled,
.ks-button[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
}

.ks-link {
  padding: 0 6px;
  background: transparent;
  color: #007c89;
}

.ks-link[data-back] {
  flex-basis: 100%;
  order: 20;
  min-height: auto;
  margin-top: 4px;
  padding: 16px 0 0;
  border-top: 1px solid #d9e2e7;
  border-radius: 0;
  color: #007c89;
  font-size: var(--aks-back-font-size, 14px);
  line-height: var(--aks-back-line-height, 1.35);
  text-align: left;
}

.ks-link[data-back]:hover {
  color: #005f69;
}

.ks-link:focus-visible {
  outline: 3px solid rgba(36, 164, 223, 0.3);
  outline-offset: 2px;
}

.ks-knowledge__actions {
  justify-content: space-between;
  align-items: center;
}

.ks-knowledge__actions .ks-button {
  margin-left: 0;
}

.ks-knowledge__actions [data-knowledge-next],
.ks-knowledge__actions [data-knowledge-submit] {
  margin-left: auto;
}

.ks-summary {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
  padding: 16px;
  background: #f4f7f8;
  border: 1px solid #d9e2e7;
  border-radius: 6px;
}

.ks-summary:empty {
  display: none;
}

.ks-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.ks-summary__label {
  color: #53616b;
}

.ks-summary__value {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  text-align: right;
}

.ks-step[data-type="result"] .ks-content-row {
  grid-template-columns: minmax(0, 680px);
  justify-content: center;
}

.ks-step[data-type="result"] .ks-kicker {
  display: none;
}

.ks-step[data-type="result"] h2 {
  text-align: center;
}

.ks-step[data-type="result"] .ks-content-column--main {
  justify-items: center;
  text-align: center;
}

.ks-step[data-type="result"] .ks-content-column--aside {
  display: none;
}

.ks-step[data-type="result"] .ks-copy,
.ks-step[data-type="result"] .ks-result,
.ks-step[data-type="result"] .ks-summary,
.ks-step[data-type="result"] .ks-actions {
  width: min(100%, 560px);
}

.ks-step[data-type="result"] .ks-summary {
  padding: 0;
  background: transparent;
  border: 0;
}

.ks-step[data-type="result"] .ks-summary__row {
  align-items: center;
  padding: 12px 16px;
  border: 1px solid #d9e2e7;
  border-radius: 6px;
  background: #ffffff;
  text-align: left;
}

@media (max-width: 760px) {
  .ks-widget {
    width: min(100%, 680px);
  }

  .ks-content-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 520px) {
  .ks-form {
    padding: 24px;
  }

  .ks-actions,
  .ks-choice,
  .ks-button {
    width: 100%;
  }
}
