/* Conditional questions use .ls-hidden. That rule must beat the row layout below. */
.js .question-container.ls-hidden,
.js .group-container.ls-hidden {
  display: none !important;
}

/* Logo navy on every screen size. The parent theme still compiles some
   button hovers as green rgb(), so these rules follow that file and win. */
:root {
  --bs-primary: #182048;
  --bs-primary-rgb: 24, 32, 72;
  --bs-link-color: #182048;
  --bs-link-hover-color: #24356a;
}
.btn-primary,
.btn-primary:disabled,
.btn-primary.disabled,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-check:focus + .btn-primary,
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary,
.show > .btn-primary.dropdown-toggle {
  color: #fff;
  background-color: #182048;
  border-color: #182048;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-check:focus + .btn-primary,
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary,
.show > .btn-primary.dropdown-toggle {
  background-color: #24356a;
  border-color: #24356a;
  box-shadow: 0 0 0 0.25rem rgba(24, 32, 72, 0.35);
}
.form-check-input:checked {
  background-color: #182048;
  border-color: #182048;
}
.form-control:focus,
.form-select:focus {
  border-color: #182048;
  box-shadow: 0 0 0 0.2rem rgba(24, 32, 72, 0.25);
}
.progress-bar {
  background-color: #182048;
}
#survey-nav.navbar {
  border-bottom: 2px solid #182048;
}
a {
  color: #182048;
}
a:hover {
  color: #24356a;
}

/* Desktop column is an 11-inch page: 1056px (96 CSS pixels per inch).
   The navbar inner bar uses the same width so the logo lines up with the fields.
   Height stays with the page. A fixed height would clip the longer sections. */
@media (min-width: 1200px) {
  #survey-nav > .container-fluid.col-xl-8,
  .outerframe.container-fluid > .row > .col-centered.col-xl-8 {
    flex: 0 0 1056px;
    width: 1056px;
    max-width: calc(100% - 1.5rem);
    margin-left: auto;
    margin-right: auto;
  }
}

/* Short answers (name, phone, date, zip, state) share a row on wide screens. */
@media (min-width: 768px) {
  .group-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 20px;
  }
  .group-container > *:not(.question-container) {
    flex: 1 0 100%;
    width: 100%;
    max-width: 100%;
  }
  .group-container > .question-container {
    margin-left: 0 !important;
    margin-right: 0 !important;
    min-width: 0;
    box-sizing: border-box;
  }
  .group-container > .question-container.mjb-xs:not(.ls-hidden),
  .group-container > .question-container.mjb-sm:not(.ls-hidden),
  .group-container > .question-container.mjb-md:not(.ls-hidden) {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
  }
  .question-container.mjb-xs .answer-container,
  .question-container.mjb-sm .answer-container,
  .question-container.mjb-md .answer-container {
    width: 100%;
  }
  .question-container.mjb-xs {
    flex: 1 1 0;
    min-width: 170px;
    max-width: 230px;
  }
  .question-container.mjb-sm {
    flex: 1 1 0;
    min-width: 220px;
    max-width: 320px;
  }
  .question-container.mjb-md {
    flex: 1 0 45%;
    min-width: 300px;
    max-width: 70%;
  }
  .question-container.mjb-full {
    flex: 1 0 100%;
    max-width: 100%;
  }
  .question-container.mjb-xs .ls-answers > [class*="col-"],
  .question-container.mjb-sm .ls-answers > [class*="col-"],
  .question-container.mjb-md .ls-answers > [class*="col-"] {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
  }
  .question-container.mjb-xs .ls-answers,
  .question-container.mjb-sm .ls-answers,
  .question-container.mjb-md .ls-answers {
    margin-bottom: 0 !important;
  }
  .question-container.mjb-xs .mjb-combo,
  .question-container.mjb-sm .mjb-combo,
  .question-container.mjb-md .mjb-combo {
    width: 100%;
    max-width: 100%;
  }
  .question-container.mjb-xs .ls-label-question,
  .question-container.mjb-sm .ls-label-question,
  .question-container.mjb-md .ls-label-question {
    font-size: 18px;
    line-height: 24px;
  }
}

/* Required asterisk sits inline before the label instead of on its own line. */
.question-container .question-title-container {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.question-container .question-title-container > .asterisk {
  flex: 0 0 auto;
  margin-top: 2px;
  color: #182048;
}
.question-container .question-title-container > .question-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* Date helper sits tight under the box on one line. */
.date-item .tip.help-block {
  margin: 2px 0 0;
  font-size: 0.8rem;
  font-weight: 400;
  white-space: nowrap;
}

/* A dropdown needs no "Choose one of the following answers" hint. */
.list-dropdown .ls-em-tip.em_default { display: none; }

/* Text inside the answer box. Inputs are 14px and dropdowns 0.9975rem in the
   parent theme. +2px so the narrower columns stay readable. */
.question-container .form-control {
  font-size: 16px;
  line-height: 18px;
}
.question-container .form-select {
  font-size: calc(0.9975rem + 2px);
  line-height: 18px;
}
.question-container .mjb-combo-button,
.question-container .mjb-combo-search,
.question-container .mjb-combo-option {
  font-size: calc(1em + 2px);
}

/* Client-info form (boards "Request info"): the survey builder sets the width
   as mjb-w-N columns out of 12, so each row adds up to a full line. */
@media (min-width: 768px) {
  .group-container > .question-container.mjb-ci:not(.ls-hidden) {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    flex-grow: 0;
    flex-shrink: 0;
  }
  .question-container.mjb-ci .answer-container,
  .question-container.mjb-ci .ls-answers > [class*="col-"] {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
  }
  .question-container.mjb-ci .ls-answers { margin-bottom: 0 !important; }
  .question-container.mjb-ci .ls-label-question { font-size: 18px; line-height: 24px; }
  .question-container.mjb-w-3  { flex-basis: calc(25% - 15px); }
  .question-container.mjb-w-4  { flex-basis: calc(33.333% - 13.34px); }
  .question-container.mjb-w-5  { flex-basis: calc(41.666% - 11.67px); }
  .question-container.mjb-w-6  { flex-basis: calc(50% - 10px); }
  .question-container.mjb-w-12 { flex-basis: 100%; }
}
.question-container.mjb-ci .mjb-ci-error { line-height: 1.3; }
/* LimeSurvey's "Please check the format" / "Choose one" hints only show once the answer is wrong. */
.question-container.mjb-ci .ls-em-tip:not(.ls-em-error):not(.text-danger) { display: none; }
.question-container.mjb-ci .question-help-container:empty { display: none; }
/* Sections read as one form: smaller headings, less air between them. */
.group-outer-container:has(.mjb-ci) { margin-top: 8px !important; margin-bottom: 4px !important; padding-top: 0 !important; }
.group-outer-container:has(.mjb-ci) > .group-container { margin-top: 0 !important; margin-bottom: 4px !important; }
.group-outer-container:has(.mjb-ci) .group-title {
  font-size: 1.35rem;
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e1e4ee;
}

.mjb-state { position: relative; width: 100%; }
.question-container.mjb-ci-state .answer-container,
.question-container.mjb-ci-state .ls-answers > [class*="col-"] {
  width: 100%;
  max-width: 100%;
  flex: 1 1 100%;
}
.mjb-state-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.mjb-state-list .mjb-combo-option { font-size: 16px; }
