/* =========================================================
   Review step: "Review your answers" panel (review-step.js)
   ========================================================= */

/* While reviewing, the panel replaces the fields and the submit row.
   review-step.js sets the hidden attribute on them; !important keeps
   theme rules (e.g. .form-field { display: flex }) from showing them. */
form.auto-form-builder-form.afb-is-reviewing > [data-afb-review-hidden] {
  display: none !important;
}

.afb-review[hidden],
.afb-step-nav .afb-step-review[hidden] {
  display: none !important;
}

/* "Back to review" in the step navigation, while an answer is edited. */
.afb-step-nav .afb-step-review {
  padding: 10px 22px;
  border: 1px solid var(--afb-primary, #2271b1);
  border-radius: 4px;
  background: transparent;
  color: var(--afb-primary, #2271b1);
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
}

.afb-step-nav .afb-step-review:focus-visible {
  outline: 2px solid var(--afb-primary, #2271b1);
  outline-offset: 2px;
}

.afb-review {
  margin: 0 0 8px;
}

.afb-review .afb-review-title {
  margin: 0 0 12px;
  font-size: 1.25em;
  line-height: 1.3;
}

.afb-review .afb-review-title:focus {
  outline: none;
}

.afb-review .afb-review-title:focus-visible {
  outline: 2px solid var(--afb-primary, #2271b1);
  outline-offset: 2px;
}

.afb-review .afb-review-intro {
  margin: 0 0 16px;
  white-space: pre-line;
}

.afb-review .afb-review-group {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
}

.afb-review .afb-review-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

.afb-review .afb-review-group-title {
  margin: 0;
  font-size: 1em;
}

.afb-review .afb-review-group-title[hidden] {
  display: none;
}

.afb-review .afb-review-edit {
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--afb-primary, #2271b1);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.afb-review .afb-review-list {
  margin: 0;
}

.afb-review .afb-review-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr;
  gap: 4px 16px;
  padding: 8px 0;
  border-top: 1px solid #eef0f3;
}

.afb-review .afb-review-row:first-child {
  border-top: 0;
}

.afb-review .afb-review-label {
  margin: 0;
  font-weight: 600;
  text-align: start;
}

.afb-review .afb-review-value {
  margin: 0;
  text-align: start;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.afb-review .afb-review-line {
  display: block;
}

.afb-review .afb-review-total {
  margin-block-start: 4px;
  font-weight: 600;
}

.afb-review .afb-review-signature {
  display: block;
  max-width: 160px;
  height: auto;
  border: 1px solid #eef0f3;
  background: #fff;
}

.afb-review .afb-review-captcha {
  margin: 0 0 16px;
}

.afb-review .afb-review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.afb-review .afb-review-back {
  padding: 10px 22px;
  border: 1px solid #c8cbd0;
  border-radius: 4px;
  background: transparent;
  color: #344054;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
}

.afb-review .afb-review-back:hover {
  border-color: var(--afb-primary, #2271b1);
  color: var(--afb-primary, #2271b1);
}

.afb-review .afb-review-back:focus-visible,
.afb-review .afb-review-edit:focus-visible {
  outline: 2px solid var(--afb-primary, #2271b1);
  outline-offset: 2px;
}

/* Accessibility-only text. Defined here because embed pages and many
   themes never ship a .screen-reader-text rule. */
.afb-review-status.screen-reader-text,
.afb-review .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  .afb-review .afb-review-row {
    grid-template-columns: 1fr;
  }

  .afb-review .afb-review-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .afb-review .afb-review-actions > button {
    width: 100%;
  }
}
