/* Heart Disease Code: members area, login and thank-you pages. Loaded after hdc.css. */
body.mem { background: var(--mist-2); font-size: 18px; }

/* Header */
.mem-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.mem-header__in { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.mem-logo { display: block; margin-right: auto; }
.mem-logo img { height: 42px; width: auto; }
.mem-topnav { display: flex; align-items: center; gap: 22px; }
.mem-topnav a { color: var(--navy); font-weight: 600; font-size: 16px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.mem-topnav a:hover { color: var(--blue); }
.mem-topnav .mem-logout { background: var(--mist); border-radius: 999px; padding: 8px 18px; color: var(--blue); }
.mem-topnav .mem-logout svg { width: 16px; height: 16px; }
.mem-menu-btn { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.mem-menu-btn span:not(.hdc-sr) { display: block; width: 26px; height: 3px; background: var(--navy); border-radius: 3px; margin: 5px 0; }

/* Layout with sidebar */
.mem-shell { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; padding: 28px 20px 48px; align-items: start; }
.mem-side { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); padding: 18px 14px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
.mem-side ul { list-style: none; margin: 0 0 14px; padding: 0; }
.mem-side a { display: block; padding: 7px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 16px; line-height: 1.4; font-weight: 500; }
.mem-side a:hover { background: var(--mist); color: var(--blue); }
.mem-side a.is-on { background: var(--blue); color: #fff; font-weight: 700; }
.mem-side__home { display: flex !important; align-items: center; gap: 8px; font-weight: 700 !important; color: var(--navy) !important; margin-bottom: 8px; }
.mem-side__home svg { width: 18px; height: 18px; color: var(--heart); }
.mem-side__home.is-on { color: #fff !important; }
.mem-side__head { margin: 14px 12px 6px; font-size: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.mem-main, .mem-plain { min-width: 0; }
.mem-main { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); padding: 36px 40px 44px; }
.mem-plain { max-width: 1100px; margin: 0 auto; padding: 36px 20px 56px; }
.mem-title { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: .6em; }
.mem-main h2 { font-size: clamp(23px, 2.4vw, 30px); margin-top: 1.4em; }
.mem-main h3 { font-size: 22px; margin-top: 1.2em; }
.mem-main p, .mem-main li { max-width: 78ch; }
.mem-main img { border-radius: 12px; }
.mem-ctr { text-align: center; }
.mem-ctr img { margin-left: auto; margin-right: auto; }
.mem-intro { font-size: 20px; color: var(--muted); }
.mem-steps { padding-left: 1.2em; }
.mem-steps li { margin-bottom: .6em; }
.mem-small { font-size: 16px; color: var(--muted); }

/* Video, always 16:9 */
.mem-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0A2E4D; border-radius: 14px; overflow: hidden; margin: 18px 0 26px; box-shadow: var(--shadow); }
.mem-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Downloads and next links */
.mem-dl { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 18px 0; }
.mem-dl img { max-width: 140px; height: auto; }
.mem-nextwrap { margin: 30px 0 6px; text-align: center; }
.mem-next { font-size: 18px; }

/* Accordion (exclusive videos) */
.mem-accordion { display: grid; gap: 10px; margin: 18px 0; }
.mem-accordion details { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mem-accordion summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--navy); font-size: 17px; list-style: none; display: flex; gap: 12px; align-items: baseline; }
.mem-accordion summary::-webkit-details-marker { display: none; }
.mem-accordion summary::after { content: "+"; margin-left: auto; color: var(--blue); font-size: 22px; font-weight: 700; }
.mem-accordion details[open] summary { background: var(--mist); }
.mem-accordion details[open] summary::after { content: "\2212"; }
.mem-accordion details > .mem-video { margin: 16px; width: calc(100% - 32px); }
.mem-accordion__n { color: var(--blue); font-weight: 700; min-width: 2em; }

/* Welcome screen */
.mem-welcome { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: center; margin-bottom: 34px; }
.mem-welcome__pic { margin: 0; }
.mem-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.mem-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; background: var(--mist-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; text-decoration: none; color: var(--navy); box-shadow: var(--shadow-s); transition: transform .15s, box-shadow .15s; }
.mem-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--navy); }
.mem-card img { height: 180px; width: auto; max-width: 100%; object-fit: contain; border-radius: 0; }
.mem-card h2 { font-size: 21px; margin: 0; }
.mem-card__go { color: var(--blue); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.mem-card__go svg { width: 18px; height: 18px; }

/* Login */
.mem-login-page { background: linear-gradient(180deg, var(--mist) 0%, #fff 70%); }
.mem-login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 48px; align-items: start; }
.mem-login__intro h1 { font-size: clamp(32px, 4vw, 46px); }
.mem-login__lead { font-size: 20px; color: var(--muted); max-width: 34em; }
.mem-login__pic { margin-top: 24px; }
.mem-login__panel { display: grid; gap: 22px; }
.mem-formcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 28px; }
.mem-formcard h2 { font-size: 24px; margin: 0; display: flex; align-items: center; gap: 8px; }
.mem-formcard h2 svg { width: 22px; height: 22px; color: var(--blue); }
.mem-formcard p { margin: 0; }
.mem-help { font-size: 16px; color: var(--muted); }
.mem-login-page .hdc-form input[type=submit], .mem-thanks-page .hdc-form input[type=submit], .mem-thanks input[type=submit] { cursor: pointer; border: 0; font-family: var(--sans); font-weight: 700; }

.mem-login-page .hdc-form input.hdc-btn--ghost { border: 2px solid var(--blue); }

/* Thank-you */
.mem-thanks { max-width: 760px; margin: 0 auto; }
.mem-thanks .mem-title { text-align: center; }
.mem-thanks__card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 30px 32px; }
.mem-thanks__card h2 { margin-top: 0; font-size: 26px; }
.mem-reg .reg-form, .mem-thanks .reg-form { display: grid; gap: 10px; }
.mem-thanks select, .mem-thanks input[type=text], .mem-thanks input[type=password] { width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.mem-confirm { width: 100%; border-collapse: collapse; margin: 16px 0 20px; }
.mem-confirm caption { text-align: left; font-weight: 700; color: var(--navy); padding-bottom: 8px; }
.mem-confirm th, .mem-confirm td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 17px; word-break: break-word; }
.mem-confirm th { width: 38%; color: var(--muted); font-weight: 600; }
.mem-optin { margin-top: 12px; font-size: 16px; }
.mem-optin label { display: flex; gap: 8px; align-items: flex-start; }
.mem-fine { max-width: 760px; margin: 28px auto 0; font-size: 16px; color: var(--muted); }

/* Footer */
.mem-footer { background: var(--navy); color: #fff; text-align: center; padding: 28px 20px; }
.mem-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-bottom: 10px; }
.mem-footer a { color: var(--sky-l); font-size: 16px; text-decoration: none; }
.mem-footer a:hover { color: #fff; text-decoration: underline; }
.mem-footer p { margin: 0; font-size: 16px; color: #C9D8E6; }

@media (max-width: 960px) {
  .mem-shell { grid-template-columns: minmax(0, 1fr); padding: 16px 14px 36px; }
  .mem-menu-btn { display: block; }
  .mem-side { display: none; position: static; max-height: none; }
  .mem-side.is-open { display: block; }
  .mem-main { padding: 24px 18px 30px; }
  .mem-welcome, .mem-login { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 640px) {
  body.mem { font-size: 17px; }
  .mem-header__in { padding: 8px 12px; gap: 8px; }
  .mem-logo img { height: 34px; }
  .mem-topnav { gap: 8px; }
  .mem-topnav a:not(.mem-logout) { display: none; }
  .mem-topnav .mem-logout { padding: 8px 14px; }
  .mem-plain { padding: 24px 14px 40px; }
  .mem-formcard, .mem-thanks__card { padding: 20px 16px; }
  .mem-confirm th, .mem-confirm td { display: block; width: 100%; border: 0; padding: 4px 0; }
  .mem-confirm tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .mem-dl { flex-direction: column; text-align: center; }
  .mem-accordion details > .mem-video { margin: 10px; width: calc(100% - 20px); }
}
