/**
 * Screen 4 exact rebuild — Patient Portal + Support + FAQ + Footer
 * New BEM roots (.hp-s4-*) avoid fighting legacy track/fcta CSS.
 */

/* ========== PATIENT PORTAL ========== */
.hp-s4-portal {
  --s4-navy: #001d5a;
  --s4-green: #22c55e;
  padding: 10px 12px 8px;
  background: #fff;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

.hp-s4-portal__card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 128px;
  grid-template-areas: "copy phone";
  gap: 6px 8px;
  align-items: start;
  padding: 14px 12px 12px;
  border-radius: 18px;
  background: #001d5a !important;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 18, 64, 0.28);
  overflow: hidden;
}

.hp-s4-portal__copy {
  grid-area: copy;
  min-width: 0;
}

.hp-s4-portal__phone {
  grid-area: phone;
  margin-top: 2px;
}

.hp-s4-portal__copy h2 {
  margin: 0;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

/* Beat body.public-home-v2 .hp-page h2 { color: navy } on mobile */
body.page-home.public-home-v2 .hp-page .hp-s4-portal .hp-s4-portal__copy h2,
body.page-home.public-home-v2 .hp-page .hp-s4-portal h2#hp-track-journey-heading,
body.public-home-v2 .hp-page .hp-s4-portal h2 {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.hp-s4-portal__sub {
  margin: 6px 0 10px;
  color: #8ec5ff;
  font-size: 0.72rem;
  line-height: 1.35;
  max-width: 28ch;
  opacity: 1;
  text-shadow: none;
  filter: none;
  -webkit-font-smoothing: antialiased;
}

/* Beat body.public-home-v2 .hp-page p { color: muted navy } — soft sky blue, not white */
body.page-home.public-home-v2 .hp-page .hp-s4-portal .hp-s4-portal__sub,
body.public-home-v2 .hp-page .hp-s4-portal p.hp-s4-portal__sub,
body.public-home-v2 .hp-page .hp-s4-portal .hp-s4-portal__copy p {
  color: #8ec5ff !important;
  -webkit-text-fill-color: #8ec5ff !important;
  opacity: 1 !important;
  text-shadow: none !important;
  filter: none !important;
}

.hp-s4-portal__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hp-s4-portal__list li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #f7faff;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
}

.hp-s4-portal__check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.hp-s4-portal__check svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* HTML phone mockup */
.hp-s4-portal__phone {
  position: relative;
  display: block;
  width: 132px;
  aspect-ratio: 132 / 252;
  border-radius: 22px;
  background: linear-gradient(160deg, #d7dde8 0%, #9aa3b5 45%, #7d8798 100%);
  padding: 7px 6px 8px;
  text-decoration: none;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
  justify-self: end;
}

.hp-s4-portal__bezel {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.hp-s4-portal__notch {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: #111827;
  transform: translateX(-50%);
  z-index: 2;
}

.hp-s4-portal__screen {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.hp-s4-portal__status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 8px 2px;
  color: #0b2f5b;
  font-size: 0.48rem;
  font-weight: 700;
}

.hp-s4-portal__status-icons {
  width: 28px;
  height: 6px;
  border-radius: 2px;
  background:
    linear-gradient(#0b2f5b, #0b2f5b) 0 50% / 8px 4px no-repeat,
    linear-gradient(#0b2f5b, #0b2f5b) 11px 50% / 7px 4px no-repeat,
    linear-gradient(#0b2f5b, #0b2f5b) 21px 50% / 7px 5px no-repeat;
}

.hp-s4-portal__nav {
  display: grid;
  grid-template-columns: 14px 1fr 14px;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 6px;
  border-bottom: 1px solid #e8eef6;
}

.hp-s4-portal__nav strong {
  color: #1d4ed8;
  font-size: 0.58rem;
  font-weight: 750;
  text-align: center;
}

.hp-s4-portal__back,
.hp-s4-portal__exit {
  width: 12px;
  height: 12px;
  background: #1d4ed8;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.hp-s4-portal__back {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M15 6 9 12l6 6' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M15 6 9 12l6 6' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.hp-s4-portal__exit {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M10 7H7a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-3M14 4h6v6M20 4l-9 9' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M10 7H7a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-3M14 4h6v6M20 4l-9 9' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.hp-s4-portal__dash {
  margin: 0;
  padding: 2px 0 0;
  list-style: none;
  flex: 1;
}

.hp-s4-portal__dash-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid #edf2f7;
}

.hp-s4-portal__dash-ico {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: 0 0 16px;
  background: #0ea5a0 center / 60% 60% no-repeat;
}

.hp-s4-portal__dash-row--mint .hp-s4-portal__dash-ico { background-color: #14b8a6; }
.hp-s4-portal__dash-row--blue .hp-s4-portal__dash-ico { background-color: #2563eb; }
.hp-s4-portal__dash-row--indigo .hp-s4-portal__dash-ico { background-color: #4f46e5; }
.hp-s4-portal__dash-row--navy .hp-s4-portal__dash-ico { background-color: #1e3a8a; }

.hp-s4-portal__dash-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hp-s4-portal__dash-txt strong {
  color: #0b2f5b;
  font-size: 0.52rem;
  font-weight: 750;
  line-height: 1.15;
}

.hp-s4-portal__dash-txt em {
  color: #64748b;
  font-size: 0.46rem;
  font-style: normal;
  line-height: 1.15;
}

.hp-s4-portal__view {
  display: grid;
  place-items: center;
  margin: 6px 8px 8px;
  min-height: 22px;
  border-radius: 7px;
  background: #2563eb;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 750;
}

/* ========== SUPPORT ========== */
.hp-s4-support {
  padding: 6px 12px 10px;
  background: #fff !important;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

.hp-s4-support__card {
  padding: 14px 12px 12px;
  border-radius: 18px;
  background: #e8f6f0 !important;
  box-shadow: none !important;
  border: 0 !important;
}

.hp-s4-support__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 6px 8px;
  align-items: end;
}

.hp-s4-support__copy h2 {
  margin: 0;
  color: #0b2f5b;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hp-s4-support__copy p {
  margin: 6px 0 0;
  color: #1e3a5f;
  font-size: 0.72rem;
  line-height: 1.35;
  max-width: 28ch;
}

.hp-s4-support__visual {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.hp-s4-support__visual img {
  display: block;
  width: 118px;
  height: auto;
  max-height: 118px;
  object-fit: contain;
  object-position: bottom right;
}

.hp-s4-support__feats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.hp-s4-support__feats li {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(11, 47, 91, 0.06);
}

.hp-s4-support__feat--full img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1.05;
  object-fit: cover;
  object-position: center top;
}

.hp-s4-support__feat--ico {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 78px;
  padding: 6px 4px 8px;
  text-align: center;
}

.hp-s4-support__feat--ico img {
  display: block;
  width: 70%;
  height: auto;
  object-fit: contain;
}

.hp-s4-support__feat--ico span {
  color: #0b2f5b;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.15;
}

.hp-s4-support__feats img {
  display: block;
  width: 100%;
  height: auto;
}

.hp-s4-support__wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(22, 163, 74, 0.25);
}

.hp-s4-support__wa svg {
  flex: 0 0 auto;
}

/* ========== FAQ ========== */
@media (max-width: 767px) {
  body.page-home.public-home-v2 .faq-section.faq-section--s4ref {
    background: #fff !important;
    padding: 8px 0 10px !important;
  }

  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .section-pad,
  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .container-shell {
    width: 100% !important;
    max-width: none !important;
    padding-inline: 12px !important;
    margin: 0 !important;
  }

  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .section-heading {
    margin: 0 0 10px !important;
    text-align: center !important;
  }

  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .section-heading h2 {
    margin: 0 !important;
    color: #0b2f5b !important;
    font-size: 1.12rem !important;
    font-weight: 800 !important;
  }

  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .faq-card--s4ref {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .accordion-item {
    margin: 0 !important;
    border: 1px solid #e5edf5 !important;
    border-radius: 10px !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .accordion-trigger {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    border: 0 !important;
    background: #fff !important;
    color: #0b2f5b !important;
    font-size: 0.82rem !important;
    font-weight: 650 !important;
    text-align: start !important;
  }

  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .accordion-trigger svg {
    width: 16px !important;
    height: 16px !important;
    color: #0b2f5b !important;
    flex: 0 0 auto !important;
  }

  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .accordion-panel {
    display: none !important;
    padding: 0 12px 10px !important;
    color: #475569 !important;
    font-size: 0.8rem !important;
    line-height: 1.45 !important;
  }

  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .accordion-item.is-open .accordion-panel,
  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .accordion-panel:not([hidden]) {
    display: block !important;
  }

  /* ========== FOOTER ========== */
  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__shell,
  .ilj-footer.ilj-footer--s4ref .ilj-footer__shell {
    background: #001d5a !important;
    border-radius: 0 !important;
    padding: 16px 0 12px !important;
    box-shadow: none !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__map {
    display: none !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__inner {
    width: 100% !important;
    max-width: none !important;
    padding-inline: 14px !important;
    gap: 12px !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__row {
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) !important;
    gap: 8px 10px !important;
    align-items: start !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    padding: 0 !important;
    border: 0 !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__logo img {
    height: 42px !important;
    max-width: 160px !important;
    width: auto !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__tagline {
    margin: 0 !important;
    color: rgba(235, 245, 255, 0.82) !important;
    font-size: 0.62rem !important;
    line-height: 1.3 !important;
    max-width: 22ch !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__contact {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 2px 0 0 !important;
    list-style: none !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__contact a,
  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__address {
    display: flex !important;
    align-items: flex-start !important;
    gap: 6px !important;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 0.7rem !important;
    line-height: 1.3 !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__contact svg {
    width: 14px !important;
    height: 14px !important;
    color: #fff !important;
    margin-top: 1px !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__social {
    display: flex !important;
    gap: 6px !important;
    margin: 4px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__social a {
    display: grid !important;
    place-items: center !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: #001d5a !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__social svg {
    width: 14px !important;
    height: 14px !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__legal {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.18) !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__legal a {
    color: #fff !important;
    font-size: 0.72rem !important;
    text-decoration: none !important;
  }

  body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__copy {
    display: none !important;
  }

  body.pb-mobile-bar .ilj-footer.ilj-footer--s4ref .ilj-footer__shell {
    padding-bottom: calc(14px + var(--mobile-bar-h, 52px) + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Narrow */
@media (max-width: 370px) {
  .hp-s4-portal__card {
    grid-template-columns: minmax(0, 1fr) 118px;
    padding: 14px 12px 12px;
  }

  .hp-s4-portal__phone {
    width: 118px;
  }

  .hp-s4-portal__list li {
    font-size: 0.68rem;
  }

  .hp-s4-support__copy h2 {
    font-size: 0.95rem;
  }
}

/* 430 */
@media (min-width: 400px) and (max-width: 767px) {
  .hp-s4-portal__card {
    grid-template-columns: minmax(0, 1fr) 142px;
  }

  .hp-s4-portal__phone {
    width: 142px;
  }

  .hp-s4-portal__copy h2 {
    font-size: 1.2rem;
  }
}

/* Desktop */
@media (min-width: 768px) {
  .hp-s4-portal {
    padding: 24px 16px;
  }

  .hp-s4-portal__card {
    max-width: 1080px;
    margin-inline: auto;
    grid-template-columns: minmax(0, 1.2fr) 220px;
    gap: 20px 28px;
    padding: 28px 32px;
    border-radius: 22px;
  }

  .hp-s4-portal__copy h2 {
    font-size: 2rem;
  }

  .hp-s4-portal__sub {
    font-size: 1rem;
    max-width: 42ch;
  }

  .hp-s4-portal__list {
    gap: 12px;
  }

  .hp-s4-portal__list li {
    font-size: 1rem;
  }

  .hp-s4-portal__check,
  .hp-s4-portal__check svg {
    width: 22px;
    height: 22px;
  }

  .hp-s4-portal__phone {
    width: 200px;
  }

  .hp-s4-support {
    padding: 12px 16px 28px;
  }

  .hp-s4-support__card {
    max-width: 1080px;
    margin-inline: auto;
    padding: 24px 28px;
    border-radius: 22px;
  }

  .hp-s4-support__top {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .hp-s4-support__copy h2 {
    font-size: 1.7rem;
  }

  .hp-s4-support__copy p {
    font-size: 1rem;
    max-width: 48ch;
  }

  .hp-s4-support__visual img {
    width: 200px;
    max-height: 200px;
  }

  .hp-s4-support__feats {
    gap: 14px;
    margin-top: 16px;
  }

  .hp-s4-support__wa {
    min-height: 52px;
    font-size: 1.05rem;
    margin-top: 16px;
  }

  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .faq-card--s4ref {
    max-width: 760px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body.page-home.public-home-v2 .faq-section.faq-section--s4ref .accordion-item {
    border: 1px solid #e5edf5;
    border-radius: 12px;
    background: #fff;
  }

  .ilj-footer.ilj-footer--s4ref .ilj-footer__row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 24px;
  }

  .ilj-footer.ilj-footer--s4ref .ilj-footer__shell {
    background: #001d5a;
    border-radius: 0;
  }

  .ilj-footer.ilj-footer--s4ref .ilj-footer__map,
  .ilj-footer.ilj-footer--s4ref .ilj-footer__copy {
    display: none;
  }

  .ilj-footer.ilj-footer--s4ref .ilj-footer__social a {
    border-radius: 50%;
    background: #fff;
    color: #001d5a;
  }
}

/* RTL */
[dir="rtl"] .hp-s4-portal__copy h2,
[dir="rtl"] .hp-s4-portal__sub,
[dir="rtl"] .hp-s4-portal__list li,
[dir="rtl"] .hp-s4-support__copy h2,
[dir="rtl"] .hp-s4-support__copy p,
[dir="rtl"] body.page-home.public-home-v2 .faq-section.faq-section--s4ref .accordion-trigger {
  text-align: right;
}

[dir="rtl"] .hp-s4-portal__phone,
[dir="rtl"] .hp-s4-support__visual {
  justify-self: start;
  justify-content: flex-start;
}

[dir="rtl"] .hp-s4-support__visual img {
  object-position: bottom left;
}

[dir="rtl"] body.page-home .ilj-footer.ilj-footer--s4ref .ilj-footer__brand {
  align-items: flex-end;
}
