/**
 * Minimal container styling for the embedded Qualtrics iframe and its
 * paired "Next" button. Content inside the iframe itself cannot be styled
 * from here (cross-origin); see the survey's own Look & Feel settings in
 * Qualtrics for that.
 */

.thrive-survey-embed {
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.thrive-survey-iframe {
  display: block;
  width: 100%;
  border: 0;
  transition: opacity 0.2s ease-out;

  /* Starting height, used only until the survey reports its real content
   * height and the bridge resizes the iframe to match (see the setHeight
   * handling in js/thrive-iframe-bridge.js). Sized for an intake form of
   * several questions, since a value shorter than the content makes the
   * iframe scroll internally for a moment before it is corrected. Lower
   * it if the embedded survey only ever asks one short question. */
  min-height: 700px;
}

/* Hidden the moment submission starts, so whatever the survey shows next
 * (e.g. its own end-of-survey message) fades out along with it rather
 * than being visible while the page navigates away, see
 * js/thrive-iframe-bridge.js. */
.thrive-survey-iframe.is-submitting {
  opacity: 0;
}

/* Disabled until the survey side confirms (via thrive:ready) that its
 * message listener is registered, see js/thrive-iframe-bridge.js. Applies
 * to every button the bridge wires up, which are the site's own buttons,
 * so it adds a state class rather than restyling them. */
.is-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}

/* Gives each Multiple Choice option its own bordered row, echoing the
 * answer-choice boxes already used in page body content elsewhere on
 * these Challenge pages. Colors match the site's existing input borders
 * (see bmc_base_theme's _forms.scss) rather than introducing new ones. */
.paragraph--type--thrive-question .form-item-answer {
  border: 1px solid rgba(24, 24, 24, 0.25);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  transition: border-color 0.2s ease-out;
}

.paragraph--type--thrive-question .form-item-answer:hover {
  border-color: rgba(0, 85, 111, 0.5);
}

.paragraph--type--thrive-question .form-item-answer label {
  cursor: pointer;
}

.js .paragraph--type--thrive-question input.js-hide {
  display: none;
}

.paragraph--type--thrive-question input[type='radio'],
.paragraph--type--thrive-question input[type='checkbox'] {
  min-height: 0;
  width: 1.2em;
  height: 1.2em;
}

/* Right-to-left languages. The survey inside the iframe lays itself out
 * from its own Look & Feel settings in Qualtrics, so only the parts
 * rendered by this module are handled here: the answer rows, whose text
 * and radio button swap sides, and our own Next button. */
[dir='rtl'] .paragraph--type--thrive-question .form-item-answer label {
  text-align: right;
}

[dir='rtl'] .paragraph--type--thrive-question .form-item-answer input[type='radio'] {
  margin-right: 0;
  margin-left: 0.5em;
}

