/* =====================================================================
   Persona advisor theme (visual layer only)
   ---------------------------------------------------------------------
   Loaded LAST on: advisor/index.cfm, advisor/home.cfm,
   advisor_p/questionnaire.cfm.
   Re-skins the assessment to match landingpage.cfm:
     cream background, navy ink, terracotta CTAs, Figtree + Newsreader.
   No ids/classes are added or renamed; this file only overrides
   colours, type, borders and animations of existing selectors.
   ===================================================================== */

:root {
  /* New palette */
  --pn-bg: #F7F5F1;
  --pn-surface: #FFFFFF;
  --pn-ink: #1E2A38;
  --pn-muted: #535D6B;
  --pn-line: #E4E0D8;
  --pn-line-strong: #CFC9BE;
  --pn-accent: #B4532F;
  --pn-accent-hover: #9A472A;
  --pn-accent-soft: #FBF3EE;
  --pn-accent-line: #EBD3C5;
  --pn-sans: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  --pn-serif: Newsreader, Georgia, serif;
  --pn-ease: cubic-bezier(.22, .61, .36, 1);

  /* Remap the legacy variables used throughout assessment-bs5.css */
  --forest_Green: var(--pn-ink);
  --dark_forest_Green: #141D27;
  --vibrant_Lime: #FFFFFF;
  --airy_cream: var(--pn-bg);
  --Green_BG: var(--pn-accent-soft);
  --inky_blue: var(--pn-ink);
  --orange: var(--pn-accent);
  --dark_shade_gray: var(--pn-ink);
  --font-Satoshi: var(--pn-sans);
  --font: var(--pn-sans);
  --font-card: var(--pn-serif);
  --default_font: var(--pn-sans);

  /* home.cfm progress pills */
  --pill-bg: var(--pn-line);
  --pill-text: var(--pn-muted);
  --fill: var(--pn-accent);
}

/* ---------- Page surfaces ---------- */
html,
body {
  background-color: var(--pn-bg);
}
body {
  color: var(--pn-ink);
  font-family: var(--pn-sans);
  -webkit-font-smoothing: antialiased;
}
.header_area,
.advisor-new-header,
.sticky-button,
.multistep_form,
#msform,
#animationSandbox,
.btnPrev.new_secondary_cta {
  background-color: var(--pn-bg);
}
#msform fieldset button.previous {
  background-color: var(--pn-bg) !important;
}
.header_area,
.advisor-new-header {
  border-bottom: 1px solid var(--pn-line);
}

/* ---------- Typography ---------- */
.fs-title,
#msform .fs-title,
#msform h2.fs-title,
#msform h3.fs-title {
  font-family: var(--pn-serif);
  font-weight: 500;
  color: var(--pn-ink);
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
}
.static-qns,
.question-text {
  letter-spacing: -0.01em;
}
#msform p,
#msform .single_ques_top p,
#msform .sage_advice,
#msform .sage_advice p,
.static_sageadvise,
#msform .static_sage_advice {
  color: var(--pn-muted) !important;
  font-family: var(--pn-sans);
}
#msform .static_sage_advice {
  font-style: normal;
}
#why_ask,
.static_why_ask,
.modal_info_btn,
#clear-btnp {
  color: var(--pn-accent);
  font-family: var(--pn-sans);
  font-style: normal;
}
#why_ask:hover,
.static_why_ask:hover,
.modal_info_btn:hover {
  color: var(--pn-accent-hover);
}
.dob_question .single_ques_top h4,
.height_label_text,
.dob_select .form-group label {
  color: var(--pn-muted);
  font-family: var(--pn-sans);
}
#msform p.paragraph a,
.pink-text a,
.pink-text a.never_share,
.privacy_single_content a,
.privacypolicy_modal .modal-footer .btn-default {
  color: var(--pn-accent);
}
.pink-text a:hover,
.privacy_single_content a:hover {
  color: var(--pn-accent-hover);
}

/* ---------- Question top spacing ----------
   One consistent gap between the progress bar and every question title
   (index steps, home.cfm and advisor_p questionnaire). The landing step
   (fieldset.start_page) keeps its own layout. */
#msform fieldset:not(.start_page) {
  padding-top: 50px;
}
#msform fieldset:not(.start_page) .static-qns,
#msform fieldset:not(.start_page) .single_ques_top,
#msform fieldset:not(.start_page) .advisor_single_head,
#msform fieldset:not(.start_page) .advisor_single_head h3,
#msform fieldset:not(.start_page) .single_ques_top.center_align {
  margin-top: 0 !important;
}
@media (max-width: 767px) {
  #msform fieldset:not(.start_page) {
    padding-top: 44px;
  }
}

/* Mobile question titles: 22px (was 32px in assessment-bs5.css) */
@media (max-width: 767px) {
  .fs-title:not(.first_quest),
  #msform .fs-title:not(.first_quest),
  #msform h3.fs-title,
  .advisor_single_head h3 {
    font-size: 22px;
    line-height: 1.3;
    min-height: 0;
  }
}

/* Mobile sub-text under question titles (e.g. email step):
   19px (was 20px from #msform .single_ques_top p) */
@media (max-width: 767px) {
  #msform .single_ques_top p,
  #msform .single_ques_top p.paragraph {
    font-size: 19px;
    line-height: 1.45;
  }
}

/* ---------- Progress ---------- */
.multistep_form .progress,
.progress {
  background-color: var(--pn-line);
}
.static-progress {
  background-color: var(--pn-line) !important;
}
.multistep_form .progress-bar,
.progress-bar #bar,
#bar,
.fill-active,
.s-progress--segments li .fill {
  background: var(--pn-accent);
  transition: width .45s var(--pn-ease);
}
.s-progress--segments li {
  background: var(--pn-line);
}

/* ---------- Primary CTA (Continue / Next) ---------- */
.new-primary-cta,
.primary-btn-default,
.default_modal .gotit_close,
#msform fieldset button.new-primary-cta {
  background-color: var(--pn-accent);
  border: 1.5px solid var(--pn-accent);
  color: #FFFFFF;
  font-family: var(--pn-sans);
  font-weight: 600;
  border-radius: 999px !important;
  min-height: 52px;
  padding: 14px 32px;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.new-primary-cta:hover,
.new-primary-cta:focus-visible,
.primary-btn-default:hover,
.primary-btn-default:focus-visible,
.default_modal .gotit_close:hover,
#msform fieldset button.new-primary-cta:hover {
  background-color: var(--pn-accent-hover);
  border-color: var(--pn-accent-hover);
  color: #FFFFFF;
}
.new-primary-cta:active,
.primary-btn-default:active {
  transform: translateY(1px);
}
.new-primary-cta:focus-visible,
.primary-btn-default:focus-visible {
  outline: 2px solid var(--pn-accent);
  outline-offset: 3px;
}
.new-primary-cta:disabled,
.new-primary-cta[disabled] {
  background-color: var(--pn-line-strong);
  border-color: var(--pn-line-strong);
  color: #FFFFFF;
}
#msform fieldset button.action-button:hover {
  color: #FFFFFF;
}

/* ---------- Secondary / back buttons ---------- */
.secondary-btn-default {
  background: var(--pn-surface);
  border: 1.5px solid var(--pn-ink);
  color: var(--pn-ink);
}
.secondary-btn-default:hover,
.secondary-btn-default:focus-visible {
  background: var(--pn-ink);
  color: #FFFFFF;
}
#msform fieldset button.secondary_btn,
#msform fieldset button.secondary_cta {
  color: var(--pn-accent);
}
.new_secondary_cta:hover {
  color: var(--pn-ink) !important;
}
.btnPrev.new_secondary_cta img,
#msform fieldset button.previous img {
  transition: transform .18s ease, opacity .18s ease;
}
.btnPrev.new_secondary_cta:hover img,
#msform fieldset button.previous:hover img {
  transform: translateX(-3px);
  opacity: .75;
}

/* ---------- Answer options (radio / checkbox cards) ---------- */
.form-group label.radio_btn,
.form-group.radio_btn label,
.form-group .checkbox_btn {
  background-color: var(--pn-surface);
  border: 1.5px solid var(--pn-line) !important;
  border-radius: 16px !important;
  color: var(--pn-ink);
  font-family: var(--pn-sans);
  box-shadow: 0 1px 2px rgba(30, 42, 56, .04);
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s var(--pn-ease);
}
@media (hover: hover) and (pointer: fine) {
  .form-group label.radio_btn:hover,
  .form-group.radio_btn label:hover,
  .form-group .checkbox_btn:hover {
    border-color: var(--pn-accent) !important;
    background-color: var(--pn-accent-soft);
    box-shadow: 0 6px 18px -10px rgba(180, 83, 47, .45);
  }
}
/* No transform on the cards: a transform creates a stacking context that
   traps the info tooltip underneath the next card. */
.form-group input:focus-visible + label.radio_btn,
.form-group input:focus-visible + .checkbox_btn,
.form-group.radio_btn input:focus-visible + label {
  outline: 2px solid var(--pn-accent);
  outline-offset: 3px;
}

/* Selected state */
.form-group input:checked + label.radio_btn,
.form-group.radio_btn input:checked + label,
.form-group input[type="checkbox"]:checked + .checkbox_btn,
.form-group input:checked + label.green-gender,
.form-group input:checked + label.pink-gender,
.form-group input:checked + label.gender_selected_pink,
.form-group input:checked + label.gender_selected_green {
  background: var(--pn-accent-soft) !important;
  border: 1.5px solid var(--pn-accent) !important;
  color: var(--pn-ink);
  box-shadow: 0 0 0 3px rgba(180, 83, 47, .12);
}
.form-group input:checked + label.radio_btn::before,
.form-group.radio_btn input:checked + label::before,
.form-group.radio_btn input:checked + label.gender_selected_pink::before,
.form-group.radio_btn input:checked + label.gender_selected_green::before {
  background-color: var(--pn-accent-soft) !important;
  border-color: var(--pn-accent) !important;
}

/* Terracotta check icon on selected cards */
.form-group input:checked + label.radio_btn::after,
.form-group.radio_btn input:checked + label::after,
.form-group input[type="checkbox"]:checked + .checkbox_btn:after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%23B4532F'/%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  animation: pn-check-pop .28s var(--pn-ease) both;
}
@keyframes pn-check-pop {
  from { transform: translateY(-50%) scale(.4); opacity: 0; }
  to   { transform: translateY(-50%) scale(1);  opacity: 1; }
}

/* ---------- Answer grid: even, aligned cards ----------
   #answer.chkBox > .form-group > input + label(.radio_btn | .checkbox_btn)
   Scoped with #answer so it only touches the question answer list and
   wins over the fixed px widths in assessment-bs5.css media queries. */
#answer.chkBox {
  display: grid;
  grid-template-columns: minmax(0, 500px);
  justify-content: center;
  justify-items: stretch;
  align-items: stretch;
  gap: 14px;
  width: 100%;
}
#answer.chkBox:has(> :nth-child(5)) {
  grid-template-columns: repeat(2, minmax(0, 400px));
  grid-auto-rows: 1fr;          /* every row the same height */
  gap: 14px 16px;
}
#answer.chkBox > .form-group {
  display: flex;
  width: 100%;
  min-width: 0;
  margin: 0;
  float: none;
}
/* Odd card out in a 2-column list: centre it at column width */
/* Robust version: counts only .form-group cards, ignoring any other
   elements in #answer (kept as a separate rule so older browsers that
   don't support "of S" still get the rule below). */
#answer.chkBox:has(> :nth-child(5)) > .form-group:nth-child(odd of .form-group):nth-last-child(1 of .form-group) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 8px);
}
#answer.chkBox:has(> :nth-child(5)) > .form-group:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 8px);
}
#answer.chkBox > .form-group > label.radio_btn,
#answer.chkBox > .form-group > .checkbox_btn {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: auto;
  min-height: 76px;
  margin: 0 !important;
  padding: 14px 20px 14px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 500;
  text-align: left;
}
/* Same weight when selected so text doesn't re-wrap */
#answer.chkBox > .form-group > input:checked + label.radio_btn,
#answer.chkBox > .form-group > input:checked + .checkbox_btn {
  font-weight: 500;
}
#answer.chkBox > .form-group > input:checked + label.radio_btn::after,
#answer.chkBox > .form-group > input:checked + .checkbox_btn::after {
  left: 22px;
  width: 22px;
  height: 22px;
}

@media (max-width: 767px) {
  #answer.chkBox {
    grid-template-columns: minmax(0, 360px);
    gap: 10px;
    padding: 0 16px;
  }
  #answer.chkBox:has(> :nth-child(5)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;       /* rows sized to their tallest card */
    gap: 10px;
    max-width: 420px;
    margin: 0 auto;
  }
  #answer.chkBox:has(> :nth-child(5)) > .form-group:last-child:nth-child(odd) {
    width: calc(50% - 5px);
  }
  #answer.chkBox:has(> :nth-child(5)) > .form-group:nth-child(odd of .form-group):nth-last-child(1 of .form-group) {
    width: calc(50% - 5px);
  }
  /* assessment-bs5.css shrinks the checkbox wrapper to fit-content on
     mobile, which squeezes the cards; let it use the full width. */
  /* (Skipped for 9+ answers, whose custom scrollbar is positioned
     against the original fit-content width.) */
  #msform .advisor_single_input.multiple_checkbox:not(:has(> .chkBox > :nth-child(9))) {
    width: 100%;
    max-width: 100%;
  }
  #answer.chkBox > .form-group > label.radio_btn,
  #answer.chkBox > .form-group > .checkbox_btn {
    min-height: 60px;
    padding: 12px 12px 12px 36px;
    font-size: 15px;
    line-height: 1.3;
    border-radius: 14px !important;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  /* Cards with an info icon: pin the icon to the top-right corner so it
     never pushes outside the card, and keep the text clear of it. */
  #answer.chkBox > .form-group > label:has(.tooltip-container) {
    padding-right: 30px;
  }
  #answer.chkBox > .form-group > label .tooltip-container {
    margin: 0;
  }
  #answer.chkBox > .form-group > label .tooltip-container .info-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
  }
  #answer.chkBox > .form-group > input:checked + label.radio_btn::after,
  #answer.chkBox > .form-group > input:checked + .checkbox_btn::after {
    left: 10px;
    width: 18px;
    height: 18px;
  }
}
@media (max-width: 380px) {
  #answer.chkBox {
    padding: 0 12px;
  }
  #answer.chkBox > .form-group > label.radio_btn,
  #answer.chkBox > .form-group > .checkbox_btn {
    font-size: 14px;
    padding-left: 32px;
  }
}

/* Small checkboxes (GDPR / terms etc.) */
.form-group.checkbox_btn label:before,
.form-group.check_style label::before,
.medication_box label::before {
  border-color: var(--pn-line-strong);
  border-radius: 6px;
  transition: border-color .18s ease, background-color .18s ease;
}
.form-group.checkbox_btn label:hover:before {
  border-color: var(--pn-accent);
}
.form-group.checkbox_btn input[type="checkbox"]:checked + label:before,
.form-group.check_style input[type="checkbox"]:checked + label::before,
.medication_box input:checked + label::before {
  background: var(--pn-accent);
  border-color: var(--pn-accent);
}

/* Gender radio dots */
.select_gender .form-group .radio_btn:before {
  border-color: var(--pn-line-strong);
}
.select_gender .form-group input:checked + label.radio_btn:before {
  border-color: var(--pn-accent);
}
.select_gender .form-group input:checked + label.radio_btn::after,
.select_gender .form-group input[checked="checked"] + label.radio_btn::after {
  background: var(--pn-accent);
}

/* ---------- Text inputs / selects ---------- */
.advisor_single_ques input[type="text"],
.advisor_single_ques input[type="email"],
.advisor_single_ques input[type="number"],
.advisor_single_ques input[type="password"],
.multistep_form_tablecell .form-group .form-control,
.advisor_single_input select.birthday_select,
.question_area .input_half_section .form-group.weigh_input input[type="number"] {
  color: var(--pn-ink);
  font-family: var(--pn-sans);
  border-bottom: 1.5px solid var(--pn-line-strong);
  transition: border-color .2s ease;
}
.advisor_single_ques input:focus,
.multistep_form_tablecell .form-group .form-control:focus,
.advisor_single_input select.birthday_select:focus {
  border-bottom-color: var(--pn-accent);
  color: var(--pn-ink);
  outline: none;
}
.multistep_form_tablecell .form-group .form-control::placeholder {
  color: var(--pn-muted);
  opacity: .7;
}

/* ---------- Scrollbar for long answer lists ---------- */
.chkBox:has(> :nth-child(9)) ~ .scrollbar_track,
.scrollbar_track {
  background: var(--pn-line);
}
.chkBox:has(> :nth-child(9)) ~ .scrollbar_thumb {
  background: var(--pn-accent);
}

/* ---------- Tooltips / modals ---------- */
.tooltip-container .tooltip-text {
  background-color: var(--pn-ink);
  color: #FFFFFF;
  font-family: var(--pn-sans);
  border-radius: 12px;
}

/* Answer-card info tooltips (shown on hover or by advisor_new.js setting
   style="display:block" on click). Anchor to the card (label) instead of
   the tiny icon so the bubble sits right under the card, card-width, never
   over the answer text and never off-screen on mobile. */
#answer.chkBox > .form-group {
  position: relative;
  z-index: 1;
}
#answer.chkBox > .form-group:hover,
#answer.chkBox > .form-group:focus-within,
#answer.chkBox > .form-group:has(.tooltip-text[style*="block"]) {
  z-index: 20;
}
#answer.chkBox > .form-group .tooltip-container {
  position: static;
  flex-shrink: 0;
  margin-left: 8px;
}
#answer.chkBox > .form-group .tooltip-container .tooltip-text {
  position: absolute;
  top: calc(100% + 8px) !important;
  bottom: auto !important;
  left: 12px !important;
  right: 12px !important;
  width: auto !important;
  max-width: none;
  transform: none !important;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 400;
  text-align: left;
  white-space: normal;
  box-shadow: 0 12px 32px -12px rgba(30, 42, 56, .45);
  z-index: 30;
  animation: pn-tip-in .18s var(--pn-ease) both;
}
#answer.chkBox > .form-group .tooltip-container .tooltip-text::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;
  width: 12px;
  height: 12px;
  background: var(--pn-ink);
  transform: rotate(45deg);
  border-radius: 2px;
}
@keyframes pn-tip-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#answer.chkBox .info-icon {
  width: 20px;
  height: 20px;
  opacity: .8;
  transition: opacity .15s ease;
}
#answer.chkBox .tooltip-container:hover .info-icon {
  opacity: 1;
}
@media (max-width: 767px) {
  #answer.chkBox > .form-group .tooltip-container .tooltip-text {
    left: 0 !important;
    right: 0 !important;
    font-size: 13px;
    padding: 12px 14px;
  }
  #answer.chkBox .info-icon {
    width: 16px;
    height: 16px;
  }
}
.default_modal .modal-content,
.info_modal .modal-content {
  border: 1px solid var(--pn-line);
  border-radius: 20px;
  color: var(--pn-ink);
}
.default_modal button.btn-close {
  color: var(--pn-ink);
}
#Enable_cookies .modal-body {
  border-top-color: var(--pn-accent);
}

/* Question-title info tooltip (#question .custom-tooltip, both flows).
   The title block sits above the answer cards' layer so the bubble is
   never hidden behind them; the bubble drops below the info icon. */
#msform .advisor_single_head {
  position: relative;
  z-index: 25;
}
#question .tooltip-container {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}
#question .tooltip-container .info-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
#question .tooltip-container .tooltip-text {
  position: absolute;
  top: calc(100% + 10px) !important;
  bottom: auto !important;
  left: auto !important;
  right: -14px !important;
  transform: none !important;
  width: min(300px, calc(100vw - 32px)) !important;
  padding: 14px 16px;
  background-color: var(--pn-ink);
  color: #FFFFFF;
  font-family: var(--pn-sans);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
  border-radius: 12px;
  box-shadow: 0 12px 32px -12px rgba(30, 42, 56, .45);
  z-index: 30;
  animation: pn-tip-in .18s var(--pn-ease) both;
}
#question .tooltip-container .tooltip-text::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;
  width: 12px;
  height: 12px;
  background: var(--pn-ink);
  transform: rotate(45deg);
  border-radius: 2px;
}
@media (max-width: 767px) {
  #question .tooltip-container .info-icon {
    width: 16px;
    height: 16px;
  }
  #question .tooltip-container .tooltip-text {
    font-size: 13px;
    padding: 12px 14px;
  }
}

/* ---------- Medication step (legacy orange) ---------- */
a.recom_btn {
  background: var(--pn-accent);
}
.medication_list li button,
.goto_btn a {
  color: var(--pn-accent);
}
.goto_btn {
  border-color: var(--pn-accent);
}
.goto_btn:focus {
  background: var(--pn-accent);
}

/* ---------- Smooth transition between questions ----------
   Driven by assets/js/pn-question-transition.js through a data attribute on
   #animationSandbox1: the current question eases out when the user answers,
   the next one eases in when advisor_new.js renders it.
   The legacy animate.css "fadeInRight"/"fadeInLeft" classes that
   advisor_new.js puts on #animationSandbox are switched off so the two
   don't run on top of each other (and restart unreliably). */
#animationSandbox.animated.fadeInRight,
#animationSandbox.fadeInRight,
#animationSandbox.animated.fadeInLeft,
#animationSandbox.fadeInLeft {
  animation: none;
}
#animationSandbox1 {
  will-change: auto;
}
#animationSandbox1[data-pn-anim^="leave"] {
  opacity: 0;
  transition: opacity .22s ease-out, transform .22s ease-out;
}
#animationSandbox1[data-pn-anim="leave-next"] { transform: translate3d(-28px, 0, 0); }
#animationSandbox1[data-pn-anim="leave-prev"] { transform: translate3d(28px, 0, 0); }
#animationSandbox1[data-pn-anim="enter-next"] {
  animation: pn-q-in-next .48s var(--pn-ease) both;
}
#animationSandbox1[data-pn-anim="enter-prev"] {
  animation: pn-q-in-prev .48s var(--pn-ease) both;
}
@keyframes pn-q-in-next {
  from { opacity: 0; transform: translate3d(36px, 0, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes pn-q-in-prev {
  from { opacity: 0; transform: translate3d(-36px, 0, 0); }
  to   { opacity: 1; transform: none; }
}
/* answers follow the title a beat later, so the screen settles in order */
#animationSandbox1[data-pn-anim^="enter"] #answer,
#animationSandbox1[data-pn-anim^="enter"] .sage_advice_container {
  animation: pn-q-fade-up .42s var(--pn-ease) .08s both;
}
@keyframes pn-q-fade-up {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #animationSandbox1[data-pn-anim^="leave"] {
    transform: none;
    transition: opacity .15s linear;
  }
  #animationSandbox1[data-pn-anim^="enter"],
  #animationSandbox1[data-pn-anim^="enter"] #answer,
  #animationSandbox1[data-pn-anim^="enter"] .sage_advice_container {
    animation: pn-fade .2s linear both;
  }
  .form-group label.radio_btn,
  .form-group .checkbox_btn,
  .multistep_form .progress-bar {
    transition: none;
  }
  @keyframes pn-fade { from { opacity: 0; } to { opacity: 1; } }
}

/* ---------- Header logo (persona-logo-fingerprint.png) ----------
   155x45 everywhere; assessment-bs5.css caps header logos at 150px
   on mobile, so lift that cap for this logo only. */
.assessment_logo .vitamin-packs-logo img[src*="persona-logo-fingerprint"],
.assessment_logo span:last-child img[src*="persona-logo-fingerprint"] {
  width: 155px;
  height: 45px;
  min-width: 0;
  max-width: none;
  object-fit: contain;
}

/* =====================================================================
   Medication pages (medication.cfm + editMedication.cfm, both flows)
   All scoped to .medication_page (the wrapper on those pages).
   ===================================================================== */
.medication_page .advisor_single_head h1,
.medication_page h1.sent_med {
  font-family: var(--pn-serif);
  font-weight: 500;
  color: var(--pn-ink);
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
}
.medication_page .advisor_single_head p,
.medication_page .why_we_ask_text,
.selected_meds_label {
  color: var(--pn-muted);
  font-family: var(--pn-sans);
}
.medication_page .why_we_ask_btn,
.medication_page .advisor_single_head .modal_info_btn,
.medication_page .modal_info_btn {
  color: var(--pn-accent);
  font-family: var(--pn-sans);
  font-style: normal;
  font-weight: 600;
}
.medication_page .why_we_ask_btn:hover {
  color: var(--pn-accent-hover);
}

/* Search box */
.medication_page .med_search_label {
  color: var(--pn-ink);
  font-family: var(--pn-sans);
  font-weight: 600;
}
.medication_page .med_search_input,
.medication_page .search_input input {
  background-color: var(--pn-surface);
  border: 1.5px solid var(--pn-line-strong);
  color: var(--pn-ink);
  font-family: var(--pn-sans);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.medication_page .med_search_input:focus,
.medication_page .search_input input:focus {
  border-color: var(--pn-accent);
  box-shadow: 0 0 0 3px rgba(180, 83, 47, .12);
}
.medication_page .med_search_input::placeholder {
  color: var(--pn-muted);
  opacity: .8;
}
.medication_page #clear-btn {
  color: var(--pn-accent);
  border-bottom-color: var(--pn-accent) !important;
  font-family: var(--pn-sans);
}

/* Medication checkbox list */
.medication_page .medication_checkbox_grid {
  border: 1px solid var(--pn-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .45);
}
.medication_page .med_cb_item label {
  background: var(--pn-surface);
  border: 1.5px solid var(--pn-line);
  border-radius: 14px;
  color: var(--pn-ink);
  font-family: var(--pn-sans);
  font-weight: 500;
  line-height: 1.3;
  box-shadow: 0 1px 2px rgba(30, 42, 56, .04);
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .medication_page .med_cb_item label:hover {
    border-color: var(--pn-accent);
    background: var(--pn-accent-soft);
  }
}
.medication_page .med_cb_item input[type="checkbox"]:checked + label {
  background: var(--pn-accent-soft);
  border-color: var(--pn-accent);
  color: var(--pn-ink);
  font-weight: 500;            /* no bold: avoids text re-wrap */
  box-shadow: 0 0 0 3px rgba(180, 83, 47, .12);
}
.medication_page .med_cb_item input[type="checkbox"]:checked + label::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%23B4532F'/%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.medication_page .med_cb_item input[type="checkbox"]:focus-visible + label {
  outline: 2px solid var(--pn-accent);
  outline-offset: 2px;
}
.medication_page .med_no_results {
  color: var(--pn-muted);
}
.medication_page #med_scrollbar_track {
  background: var(--pn-line);
}
.medication_page #med_scrollbar_thumb {
  background: var(--pn-accent);
}

/* Selected medication chips */
.medication_page .sel_med_tag {
  background: var(--pn-surface);
  border: 1px solid var(--pn-accent-line);
  color: var(--pn-ink);
  font-family: var(--pn-sans);
}
.medication_page .sel_med_tag:hover {
  border-color: var(--pn-accent);
}
.medication_page .tag_remove {
  color: var(--pn-muted);
}
.medication_page .tag_remove:hover {
  background: var(--pn-accent);
  color: #FFFFFF;
}

/* "I'm not currently taking any..." checkbox */
.medication_page .form-group.checkbox_btn label {
  color: var(--pn-ink) !important;
  font-family: var(--pn-sans) !important;
  font-weight: 500;
}
.medication_page .form-group.checkbox_btn label::before {
  border: 1.5px solid var(--pn-line-strong) !important;
  border-radius: 6px;
  background: var(--pn-surface);
}
.medication_page .form-group.checkbox_btn label:hover::before {
  border-color: var(--pn-accent) !important;
}
.medication_page .form-group.checkbox_btn input[type="checkbox"]:checked + label::before {
  background: var(--pn-accent) !important;
  border-color: var(--pn-accent) !important;
}

/* Continue + Back */
.medication_page #subButton,
.medication_page .msform .recom_btn,
.msform .recom_btn {
  background-color: var(--pn-accent);
  border: 1.5px solid var(--pn-accent);
  color: #FFFFFF !important;
  font-family: var(--pn-sans);
  font-weight: 600;
  border-radius: 999px;
  min-height: 52px;
  padding: 14px 32px;
  transition: background-color .18s ease, border-color .18s ease;
}
.medication_page #subButton:hover,
.medication_page #subButton:focus-visible,
.msform .recom_btn:hover {
  background-color: var(--pn-accent-hover);
  border-color: var(--pn-accent-hover);
  color: #FFFFFF !important;
}
.medication_page #subButton:disabled,
.medication_page #subButton[disabled] {
  background-color: var(--pn-line-strong);
  border-color: var(--pn-line-strong);
}
.medication_page #btnPrevMed,
.medication_page .secondary_cta.round-btn.previous {
  color: var(--pn-ink) !important;
  font-family: var(--pn-sans);
}

/* Older editMedication layout bits */
.medication_page .medication_display_list ul li span,
.medication_page .misspelling_msg p {
  color: var(--pn-accent);
}

/* Full-width progress line under the header */
.complete-progress {
  background-color: var(--pn-accent);
}

@media (max-width: 767px) {
  .medication_page .advisor_single_head h1,
  .medication_page h1.sent_med {
    font-size: 22px;
    line-height: 1.3;
  }
  .medication_page .advisor_single_head p {
    font-size: 16px;
    line-height: 1.45;
  }
  .medication_page .med_cb_item label {
    font-size: 15px;
  }
}

/* Medication scrollbar thumb: its CSS start position (top:36px) sits over
   the search box until medication.cfm's script positions it (inline style)
   after jQuery loads. Keep it hidden until then so it never flashes there. */
.medication_page #med_scrollbar_thumb:not([style]) {
  visibility: hidden;
}
.medication_page #med_scrollbar_thumb {
  transition: top .08s linear;
}

/* Opening steps (name, gender, date of birth, email): no progress bar.
   visibility (not display) keeps the spacing and the width animation.js measures. */
.first_six_ques .static-progress {
  visibility: hidden;
}

/* ---------- "Why we ask?" directly under the question ----------
   The block now sits between the title and the answers (home.cfm /
   advisor_p/questionnaire.cfm). The legacy fixed 50px height would let the
   opened text overlap the answers, so let it size to its content. */
#msform .advisor_single_head + .sage_advice_container {
  height: auto;
  min-height: 0;
  margin: -6px auto 22px;
  max-width: 600px;
  text-align: center;
}
#msform .advisor_single_head + .sage_advice_container:has(#why_ask:empty) {
  margin: 0;
}
#msform .advisor_single_head + .sage_advice_container #sageadvise {
  padding: 8px 0 0;
}
@media (max-width: 767px) {
  #msform .advisor_single_head + .sage_advice_container {
    margin: -4px auto 18px;
    padding: 0 16px;
  }
}

/* ---------- Multi-select answers: hollow square checkbox ----------
   Checkbox questions show an empty square on every card so the user can
   tell several answers are allowed; it fills terracotta with a white tick
   when selected. Single-choice (radio) cards are unchanged. */
#answer.chkBox > .form-group > input[type="checkbox"] + .checkbox_btn {
  position: relative;
}
#answer.chkBox > .form-group > input[type="checkbox"] + .checkbox_btn::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  border: 2px solid var(--pn-line-strong);
  border-radius: 6px;
  background: var(--pn-surface) none;
  transition: border-color .15s ease, background-color .15s ease;
}
@media (hover: hover) and (pointer: fine) {
  #answer.chkBox > .form-group > input[type="checkbox"] + .checkbox_btn:hover::after {
    border-color: var(--pn-accent);
  }
}
#answer.chkBox > .form-group > input[type="checkbox"]:checked + .checkbox_btn::after {
  border-color: var(--pn-accent);
  background: var(--pn-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  animation: pn-check-pop .22s var(--pn-ease) both;
}
@media (max-width: 767px) {
  #answer.chkBox > .form-group > input[type="checkbox"] + .checkbox_btn::after {
    left: 10px;
    width: 18px;
    height: 18px;
    border-radius: 5px;
  }
  #answer.chkBox > .form-group > input[type="checkbox"]:checked + .checkbox_btn::after {
    background-size: 13px 13px;
  }
}

/* Opening steps (name, gender, age): "Why we ask?" now sits between the
   question and the input, so drop the legacy 45px top padding that kept it
   away from the answers and give it the same spacing as the questionnaire. */
#msform .single_question > .static_sage_advice {
  padding: 0;
  margin: -6px auto 22px;
  max-width: 600px;
  text-align: center;
}
#msform .single_question > .static_sage_advice .static_sageadvise {
  margin: 8px 0 0;
}
@media (max-width: 767px) {
  #msform .single_question > .static_sage_advice {
    margin: -4px auto 18px;
    padding: 0 16px;
  }
}

/* ---------- "Why we ask?" link: clean, consistent style ----------
   Same look on the opening steps (.static_why_ask) and the questionnaire
   (#why_ask): sentence case, no letter-spacing/italic, chevron aligned. */
#msform .static_why_ask,
#msform .why_ask_toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  font-family: var(--pn-sans);
  font-style: normal;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--pn-accent);
  cursor: pointer;
  user-select: none;
}
#msform .why_ask_toggle #why_ask {
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}
#msform .static_why_ask:hover,
#msform .why_ask_toggle:hover {
  color: var(--pn-accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#msform .static_why_ask .arrow,
#msform .why_ask_toggle .arrow {
  width: 12px;
  height: 12px;
  margin: 0;
  transition: transform .2s var(--pn-ease);
}
#msform .static_why_ask .arrow.rotated,
#msform .why_ask_toggle .arrow.rotated {
  transform: rotate(180deg);
}
#msform .static_sageadvise,
#msform #sageadvise,
#msform #sageadvise p {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  font-family: var(--pn-sans) !important;
  font-weight: 400 !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  color: var(--pn-muted) !important;
  text-align: center !important;
}
/* If the block still sits after the input (older markup / cached page),
   keep a proper gap from the input line instead of touching it. */
#msform .single_question > .question_area ~ .static_sage_advice {
  margin: 22px auto 0;
}
@media (max-width: 767px) {
  #msform .static_why_ask,
  #msform .why_ask_toggle { font-size: 14px; }
  #msform .static_sageadvise,
  #msform #sageadvise,
  #msform #sageadvise p { font-size: 14px !important; }
  #msform .single_question > .question_area ~ .static_sage_advice { margin-top: 18px; }
}
