/* ==========================================================================
   BioAlliance interactive components
   Self Assessment engine, results chart, forms, and search. Enqueued only on the pages that
   use them, so the pages that do not carry none of the weight.
   ========================================================================== */

/* ------------------------------------------------------- assessment panel */

.bas-saq {
  background: #fff;
  border: 1px solid var(--bas-line);
  border-radius: var(--bas-r-panel);
  padding: clamp(22px, 3vw, 34px) clamp(18px, 3vw, 36px);
  max-width: 780px;
  margin-inline: auto;
  box-shadow: var(--bas-sh-panel);
  transition: opacity var(--bas-dur) var(--bas-ease), transform var(--bas-dur) var(--bas-ease);
}
.bas-saq:focus { outline: none; }
.bas-saq.is-turning { opacity: .35; transform: translateY(6px); }

/* Five equal pillar segments, per the specification and change order CO-09. The dividers make
   the twenty percent boundaries visible so a reader can see which pillar they are inside. */
.bas-prog {
  position: relative;
  height: 8px; border-radius: 6px; background: #E7EEF4; overflow: hidden; margin-bottom: 10px;
}
.bas-prog::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to right,
    transparent 0 calc(20% - 1px),
    rgba(255, 255, 255, .85) calc(20% - 1px) 20%
  );
}
.bas-prog__fill {
  display: block; height: 100%; width: 0;
  background: var(--bas-grad); border-radius: 6px;
  transition: width var(--bas-dur) var(--bas-ease);
}

.bas-saq__meta {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--bas-muted); font-weight: 600;
  margin-bottom: 20px; letter-spacing: .4px;
}
.bas-saq__pillar {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--bas-lb-d); font-weight: 700;
}
.bas-saq__q {
  font-size: clamp(17px, 1.6vw + .5rem, 21px); font-weight: 700;
  color: var(--bas-navy); line-height: 1.35; margin: 0 0 22px;
}

.bas-scale { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 24px; }
@media (min-width: 700px) { .bas-scale { grid-template-columns: repeat(5, 1fr); } }

.bas-opt {
  border: 1.5px solid var(--bas-line); border-radius: 11px; padding: 14px 10px;
  text-align: center; cursor: pointer; background: #fff; font-family: inherit;
  min-height: 96px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: border-color var(--bas-dur) var(--bas-ease),
              background var(--bas-dur) var(--bas-ease);
}
@media (max-width: 699px) {
  .bas-opt { flex-direction: row; text-align: left; min-height: 56px; gap: 12px; padding: 12px 14px; }
}
.bas-opt:hover { border-color: var(--bas-lb); background: var(--bas-tint); }
.bas-opt__o { font-size: 22px; font-weight: 700; color: var(--bas-navy); line-height: 1; }
.bas-opt__ol { font-size: 11px; color: var(--bas-muted); font-weight: 700; letter-spacing: .3px; }
.bas-opt__od { font-size: 10.5px; color: var(--bas-muted); line-height: 1.35; display: none; }
@media (max-width: 699px) { .bas-opt__od { display: block; } }
.bas-opt.is-sel { border-color: var(--bas-green); background: var(--bas-green-tint); }
.bas-opt.is-sel .bas-opt__o,
.bas-opt.is-sel .bas-opt__ol { color: var(--bas-green-d); }

.bas-saq__nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bas-saq__nav .bas-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ------------------------------------------------------------------ forms */

.bas-form { display: grid; gap: 16px; }
.bas-form__row { display: grid; gap: 16px; }
@media (min-width: 640px) { .bas-form__row--2 { grid-template-columns: 1fr 1fr; } }

.bas-field { display: grid; gap: 6px; }
.bas-field label { font-size: 13px; font-weight: 600; color: var(--bas-navy); }
.bas-field .bas-req { color: var(--bas-muted); font-size: 11.5px; font-weight: 500; margin-left: 5px; }
.bas-field input,
.bas-field select,
.bas-field textarea {
  min-height: 48px; border-radius: var(--bas-r-btn); border: 1.5px solid var(--bas-line);
  padding: 12px 14px; font-family: inherit; font-size: 15px; color: var(--bas-ink);
  background: #fff; width: 100%;
}
.bas-field textarea { min-height: 116px; resize: vertical; }
.bas-field input:focus,
.bas-field select:focus,
.bas-field textarea:focus {
  border-color: var(--bas-lb); outline: 3px solid rgba(91, 192, 222, .35); outline-offset: 0;
}
/* Purple, never red. The frozen palette forbids red in every state, validation included. */
.bas-field input.is-invalid,
.bas-field select.is-invalid,
.bas-field textarea.is-invalid { border-color: var(--bas-purple); background: #F3EEF9; }
.bas-field input:valid:not(:placeholder-shown):not(.is-invalid) { border-color: var(--bas-green); }
.bas-field .bas-help { font-size: 12.5px; color: var(--bas-muted); }
.bas-field__err { font-size: 12.5px; color: var(--bas-purple); font-weight: 600; display: block; }
.bas-field__err::before { content: "! "; font-weight: 700; }

.bas-form__msg { font-size: 13px; margin: 0; min-height: 20px; color: var(--bas-muted); }
.bas-form__msg.is-error { color: var(--bas-purple); font-weight: 600; }
.bas-form__msg.is-success { color: var(--bas-green-d); font-weight: 600; }

.bas-formcol { display: grid; gap: 34px; align-items: start; }
@media (min-width: 1000px) { .bas-formcol { grid-template-columns: 1.25fr .75fr; gap: 44px; } }
.bas-aside {
  background: var(--bas-alt); border: 1px solid var(--bas-line);
  border-radius: var(--bas-r-card); padding: 26px;
}
.bas-aside img { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; display: block; }
.bas-aside h2, .bas-aside h3 { font-size: 18px; margin: 16px 0 4px; color: var(--bas-navy); }
.bas-aside__title { font-size: 12.5px; color: var(--bas-muted); margin: 0 0 18px; }
.bas-aside ul { list-style: none; margin: 0 0 18px; padding: 0; }
.bas-aside li { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--bas-line); }
.bas-aside li:last-child { border-bottom: 0; }
.bas-aside a { color: var(--bas-lb-d); text-decoration: none; }
.bas-aside a:hover { color: var(--bas-navy); text-decoration: underline; }
.bas-calendly {
  border: 1px solid var(--bas-line); border-radius: var(--bas-r-card);
  overflow: hidden; background: #fff; margin-top: 18px;
}
.bas-calendly iframe { display: block; width: 100%; min-height: 640px; border: 0; }
.bas-calendly.is-loaded { min-height: 640px; }

.bas-calendly__facade {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; width: 100%; min-height: 200px; padding: 34px 22px; cursor: pointer;
  background: var(--bas-tint); border: 0; font-family: inherit; text-align: center;
  transition: background var(--bas-dur) var(--bas-ease);
}
.bas-calendly__facade:hover { background: #DEEEF6; }
.bas-calendly__icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--bas-navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.bas-calendly__icon svg { width: 22px; height: 22px; }
.bas-calendly__label { font-size: 15px; font-weight: 600; color: var(--bas-navy); }
.bas-calendly__note { font-size: 12.5px; color: #566A7E; }   /* 5.0:1 on the tint ground */

/* ---------------------------------------------------------------- results */

.bas-results { display: grid; gap: 30px; align-items: center; }
@media (min-width: 1000px) { .bas-results { grid-template-columns: .8fr 1.2fr; } }
/* Three cards read better than two in the gap summary, which runs the full measure. */
[data-bas-gaps] .bas-grid { grid-template-columns: 1fr; }
@media (min-width: 700px) { [data-bas-gaps] .bas-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { [data-bas-gaps] .bas-grid { grid-template-columns: repeat(3, 1fr); } }

.bas-scorebox {
  background: var(--bas-navy); border-radius: var(--bas-r-large);
  padding: clamp(26px, 4vw, 34px); text-align: center; color: #fff;
  position: relative; overflow: hidden;
}
.bas-scorebox::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(300px 200px at 80% 10%, rgba(91, 192, 222, .25), transparent 60%);
}
.bas-scorebox > * { position: relative; }
.bas-scorebox__lab { display: block; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--bas-lb); font-weight: 600; }
.bas-scorebox__num { display: block; font-size: clamp(56px, 8vw, 84px); font-weight: 700; line-height: 1; margin: 8px 0 2px; }
.bas-scorebox__num small { font-size: .32em; color: #8FB6CF; font-weight: 600; }
.bas-scorebox__tier { display: inline-block; background: var(--bas-grad); color: #06283A; font-weight: 700; font-size: 13px; padding: 7px 18px; border-radius: 20px; margin-top: 10px; }
.bas-scorebox__ref { display: block; font-size: 11px; color: #9FC0D6; margin-top: 16px; }

.bas-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bas-bar__nm { flex: 0 0 auto; width: 40%; max-width: 176px; font-size: 12.5px; font-weight: 600; color: var(--bas-navy); text-align: right; line-height: 1.3; }
.bas-bar__track { position: relative; flex: 1; height: 22px; background: #EEF3F7; border-radius: 6px; overflow: hidden; display: block; }
.bas-bar__val { display: block; height: 100%; background: var(--bas-navy); border-radius: 6px; transition: width 900ms var(--bas-ease); }
.bas-bar__val.is-low { background: linear-gradient(90deg, #297891, #5BC0DE); }
.bas-bar__ref80 { position: absolute; left: 80%; top: 0; bottom: 0; width: 2px; background: var(--bas-green); }
.bas-bar__sc { flex: 0 0 32px; font-size: 12.5px; font-weight: 700; color: var(--bas-navy); text-align: right; }

.bas-chart-key { display: flex; gap: 18px; flex-wrap: wrap; font-size: 11.5px; color: var(--bas-muted); margin-top: 16px; }
.bas-chart-key span { display: inline-flex; align-items: center; gap: 7px; }
.bas-chart-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.bas-chart-key i.at { background: var(--bas-navy); }
.bas-chart-key i.low { background: linear-gradient(90deg, #297891, #5BC0DE); }
.bas-chart-key i.ref { width: 3px; height: 14px; background: var(--bas-green); border-radius: 2px; }

.bas-cta-dyn { background: var(--bas-tint); border-left: 4px solid var(--bas-lb); border-radius: 0 10px 10px 0; padding: 18px 20px; }
.bas-cta-dyn p { font-size: 13px; color: #143A52; margin: 0 0 14px; line-height: 1.6; }
.bas-cta-dyn__note { font-size: 12px; color: var(--bas-muted); margin: 12px 0 0 !important; }
.bas-cta-dyn .bas-ctas { margin-top: 0; }

.bas-results-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; align-items: center; }

/* ----------------------------------------------------------------- search */

.bas-searchform .wp-block-search__input {
  min-height: 48px; border-radius: 6px 0 0 6px; border: 1.5px solid var(--bas-line);
  padding: 12px 14px; font-family: inherit; font-size: 15px;
}
.bas-searchform .wp-block-search__button {
  min-height: 48px; background: var(--bas-navy); color: #fff; border: 0;
  border-radius: 0 6px 6px 0; padding: 0 22px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.bas-searchform .wp-block-search__button:hover { background: var(--bas-navy-800); }

@media (prefers-reduced-motion: reduce) {
  .bas-saq, .bas-prog__fill, .bas-bar__val { transition: none !important; }
}
