/* Member app. Colors are neutral defaults; each skin's skin.json overrides them inline per page. */
:root {
  --ink: #10231f; --muted: #5b6d67; --paper: #f7f8f3; --white: #ffffff; --mint: #dff5df;
  --accent: #b9ed66; --brand: #164f3f; --brand-2: #246b55; --line: #dce4dc;
  --shadow: 0 18px 50px rgba(16, 35, 31, .08); --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 17px; letter-spacing: .1px; }
.brand .mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--mint); }
.brand .mark svg { width: 22px; height: 22px; }

/* Layout */
main { flex: 1; width: 100%; }
.wrap { max-width: 620px; margin: 0 auto; padding: 40px 20px 56px; }
.wrap.wide { max-width: 1080px; padding-top: 28px; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.3px; }
.lede { color: var(--muted); margin: 0 0 28px; font-size: 17px; }
.muted { color: var(--muted); font-size: 14px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; }

.embed { display: flex; justify-content: center; }
.embed > * { width: 100%; display: block; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

/* Status + loading */
.status { padding: 12px 16px; border-radius: 12px; background: var(--mint); border: 1px solid #c4e8c4;
  margin: 0 0 18px; font-size: 15px; }
.status.error { background: #fff3f1; border-color: #f4c7c0; color: #7a2418; }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 32px 4px; font-size: 15px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand);
  animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Buttons */
button, .btn { font: inherit; font-size: 15px; font-weight: 600; padding: 10px 18px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--white); color: var(--ink); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
button[hidden], .btn[hidden] { display: none; }
button:hover { border-color: #c3cfc6; }
.btn { background: var(--brand); color: var(--white); border-color: var(--brand); }
.btn:hover { background: var(--brand-2); color: var(--white); }
.btn-quiet { padding: 8px 14px; font-size: 14px; }

/* Dashboard */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 18px; flex-wrap: wrap; }
.hello h1 { font-size: 26px; margin: 0; }
.tabs { display: flex; gap: 6px; padding: 5px; background: var(--white); border: 1px solid var(--line);
  border-radius: 10px; width: max-content; max-width: 100%; overflow-x: auto; margin: 0 0 20px; }
.tab { border: 0; border-radius: 7px; padding: 9px 18px; font-weight: 600; font-size: 15px; color: var(--muted);
  background: transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); background: var(--paper); }
.tab[aria-selected="true"] { background: var(--brand); color: var(--white); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; min-height: 240px; }
.panel[hidden] { display: none; }

/* Footer (bottom room so the fixed help bubble never covers Privacy · Terms) */
.foot { width: 100%; max-width: 1080px; margin: 0 auto; padding: 22px 20px 96px; color: var(--muted); font-size: 13px;
  display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.foot p { margin: 0; }

@media (max-width: 640px) {
  .wrap { padding: 28px 16px 40px; }
  h1 { font-size: 25px; }
  .lede { font-size: 16px; }
  .card { padding: 16px; border-radius: 14px; }
  .panel { padding: 12px; border-radius: 14px; }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 9px 10px; }
  .top-inner { padding: 10px 16px; }
}

/* Refused page: one template, message by reason */
body[data-reason="notfound"] .msg-invite, body:not([data-reason="notfound"]) .msg-notfound { display: none; }

/* ---- Wizard (join) ------------------------------------------------------ */
.step-label { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.progress { position: sticky; top: 57px; z-index: 9; height: 3px; background: var(--line); }
.progress-bar { height: 100%; width: 33%; background: var(--brand); transition: width .3s ease; }
.wizard { max-width: 680px; padding-top: 36px; }
.screen[hidden] { display: none; }
.screen-art { margin: 0 0 18px; }
.screen-art svg, .screen-art img { width: 100%; height: auto; display: block; border-radius: var(--radius); }
.screen-art img { aspect-ratio: 16 / 7; object-fit: cover; }
.screen-art:empty { display: none; }
.pill { display: inline-block; padding: 5px 10px; border-radius: 6px; font-size: 13px;
  font-weight: 600; background: var(--mint); color: var(--brand); margin: 0 0 14px; }
.wizard h1 { font-size: 36px; letter-spacing: -.6px; }
.sponsor { margin: -14px 0 22px; font-weight: 600; color: var(--brand); }
.sponsor:empty { display: none; }
.gets { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 10px; }
.gets li { display: flex; align-items: center; gap: 12px; font-size: 17px; }
.gets.compact li { font-size: 15px; }
.tick { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); flex: none; position: relative; }
.tick::after { content: ""; position: absolute; left: 7px; top: 4px; width: 5px; height: 10px; border: solid var(--accent-ink, var(--ink));
  border-width: 0 2px 2px 0; transform: rotate(45deg); }
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.actions[hidden] { display: none; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.link { background: none; border: 0; padding: 0; color: var(--brand-2); font: inherit; font-size: 14px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; }
.small { font-size: 14px; }

.bureaus { margin: 0 0 18px; font-size: 17px; }
.proof { display: grid; gap: 10px; margin: 0 0 28px; }
.proof-item { display: grid; gap: 2px; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--white);
  border-radius: 0 12px 12px 0; }
.proof-item span { color: var(--muted); font-size: 14px; }

.screen-form { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; align-items: start; }
.side-col { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  position: sticky; top: 84px; }
.side-col h2 { font-size: 15px; margin: 0 0 12px; }
.side-col .gets { margin-bottom: 12px; }
.wizard.wide-form { max-width: 980px; }

/* /join's own email step (the account), before the identity step. Same input as the account pages. */
.join-email { display: grid; gap: 16px; max-width: 460px; margin: 0 0 18px; }
.join-email[hidden] { display: none; }
.join-email .field { display: grid; gap: 6px; border: 0; background: none; min-height: 0; overflow: visible; }
.join-email .field:focus-within { box-shadow: none; }
.join-email label { font-size: 14px; font-weight: 600; }
.join-email input { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid #c9d4cc;
  border-radius: 10px; background: var(--white); color: var(--ink); min-height: 46px; }
.join-email input:focus { outline: 3px solid var(--accent); outline-offset: 0; border-color: var(--brand-2); }
.join-email input[aria-invalid="true"] { border-color: #c0392b; }

/* No entry motion: screens simply appear. */
.reveal { opacity: 1; transform: none; }

/* ---- Help layer --------------------------------------------------------- */
.help-bubble { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 56px; height: 56px; border-radius: 50%;
  padding: 0; border: 0; background: var(--brand); box-shadow: 0 10px 30px rgba(16,35,31,.25); overflow: hidden;
  display: grid; place-items: center; cursor: pointer; transition: transform .2s; }
.help-bubble:hover { filter: brightness(1.08); }
.help-bubble img, .help-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.help-mark svg { width: 26px; height: 26px; }
.help-bubble .help-mark svg path, .help-bubble .help-mark svg circle { stroke: var(--white); }
.help-panel { position: fixed; right: 20px; bottom: 88px; z-index: 41; width: 360px; max-width: calc(100vw - 32px);
  max-height: min(70vh, 560px); background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(16,35,31,.22); display: flex; flex-direction: column; overflow: hidden;
  }
.help-panel[hidden] { display: none; }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 12px;
  background: var(--brand); color: var(--white); }
.help-who { display: flex; align-items: center; gap: 12px; }
.help-who div { display: grid; line-height: 1.25; }
.help-who strong { font-size: 15px; } .help-who span { font-size: 12px; opacity: .8; }
.help-face { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.15);
  display: grid; place-items: center; flex: none; }
.help-face .help-mark svg path, .help-face .help-mark svg circle { stroke: var(--white); }
.help-close { background: none; border: 0; color: var(--white); font-size: 26px; line-height: 1; padding: 0 4px; cursor: pointer; }
.help-body { overflow-y: auto; padding: 14px; }
.help-greeting { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.help-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.help-list button { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 12px;
  padding: 11px 14px; font-weight: 600; font-size: 14px; }
.help-list button:hover { border-color: var(--brand); background: var(--white); }
.help-actions { display: grid; gap: 8px; }
.help-actions .btn, .help-actions .btn-quiet { justify-content: center; }
.help-back { margin: 0 0 10px; display: inline-block; }
#help-article h3 { font-size: 17px; margin: 0 0 10px; }
#help-article p, #help-article li { font-size: 14px; line-height: 1.55; }
#help-article ul { padding-left: 18px; }
body.help-handed .help-bubble { display: none; }

@media (max-width: 760px) {
  .screen-form { grid-template-columns: 1fr; }
  .side-col { position: static; order: 2; }
  .wizard h1 { font-size: 29px; }
  .help-panel { right: 12px; bottom: 80px; }
  .help-bubble { right: 14px; bottom: 14px; }
}

/* Programmatic focus on a screen's heading (for screen readers) shows no ring; keyboard focus elsewhere still does. */
.screen h1:focus { outline: none; }
/* Keep the help bubble clear of the identity form on phones. */
@media (max-width: 760px) {
  .help-bubble { width: 48px; height: 48px; }
  .help-mark svg { width: 22px; height: 22px; }
  .screen-form .form-col { padding-bottom: 72px; }
}

/* Account tab */
.account h2 { font-size: 20px; margin: 0 0 6px; }
.account h3 { font-size: 16px; margin: 26px 0 6px; }
.btn-danger { background: var(--white); color: #8a1f12; border: 1px solid #d9a39a; }
.btn-danger:hover { background: #fff3f1; border-color: #c0392b; }
.confirm { margin-top: 14px; padding: 14px 16px; border: 1px solid #f4c7c0; background: #fff3f1; border-radius: 10px; }
.confirm p { margin: 0 0 10px; } .confirm .actions { margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }

/* Raster logo marks (skins with mark_image): no tile, natural width */
.brand .mark:has(img) { background: none; width: auto; border-radius: 0; }
.brand .mark img { height: 30px; width: auto; display: block; }
.help-bubble .help-mark img, .help-face .help-mark img { width: 70%; height: auto; }

/* Membership step (programs that take payments). NMI's iframes sit inside .field. */
.screen-pay .lede { margin-bottom: 20px; }
.terms { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 18px; }
.terms h2 { font-size: 15px; margin: 0 0 8px; }
.terms ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 15px; }
.pay-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin: 0 0 18px; display: grid; gap: 14px; }
.pay-field { display: grid; gap: 6px; min-width: 0; }
.pay-email input { width: 100%; font: inherit; font-size: 16px; height: 46px; padding: 0 12px; border: 1px solid #c9d3cc;
  border-radius: 8px; background: var(--white); color: var(--ink); }
.pay-email input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--mint); }
.pay-email input[aria-invalid="true"] { border-color: #c0392b; }
.pay-email-note { margin: 0; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pay-brands { display: flex; flex-wrap: wrap; gap: 4px; }   /* the artwork carries its own clear space */
.pay-brands img { display: block; height: 48px; width: auto; }
.field-label { font-size: 14px; font-weight: 600; }
.field { border: 1px solid #c9d3cc; border-radius: 8px; background: var(--white); min-height: 46px; overflow: hidden; }
.field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--mint); }
.field.invalid { border-color: #c0392b; }
.field iframe { display: block; width: 100% !important; height: 44px !important; border: 0; }
.pay-secure { margin: 0; }
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 18px; font-size: 15px; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.pay-done .status { font-size: 16px; }
@media (max-width: 420px) { .pay-row { grid-template-columns: 1fr; } }
/* NMI_API_STYLE=v5: NMI's Payment Component (its own card fields, themed from the skin) in place of Collect.js's. */
.pay-block[data-style="v5"] .pay-card > .pay-field:not(.pay-email), .pay-block[data-style="v5"] .pay-row { display: none; }
.pay-component { min-width: 0; }
/* APPLE_PAY=on: Apple's button (NMI's component draws it) below the card's, where the browser has Apple Pay. */
.pay-wallet { display: grid; gap: 12px; margin: 18px 0 0; max-width: 360px; }
.pay-wallet[hidden], .pay-applepay[hidden], .pay-wallet-note[hidden] { display: none; }
.pay-or { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 14px; color: var(--muted); }
.pay-or::before, .pay-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.pay-applepay { min-width: 0; min-height: 40px; }
.pay-wallet-note { margin: 0; }

/* Start the trial or membership after activation: banner above the tabs, card in the Account tab. */
.start-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  background: var(--mint); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 18px; }
.start-banner[hidden] { display: none; }
.start-banner p { margin: 0; font-size: 15px; }
.start-block { margin: 22px 0 6px; padding-top: 18px; border-top: 1px solid var(--line); }
.start-block[hidden] { display: none; }
.start-block h3 { margin-top: 0; }
.start-block .terms, .start-block .pay-card { box-shadow: none; }

/* Dashboard: the Clients tab (accounts with the advisor role) is a link in the tab bar. */
.tabs a.tab { text-decoration: none; display: inline-flex; align-items: center; }
.tab[aria-current="page"] { background: var(--brand); color: var(--white); }

/* Account tab: "Your advisor" (members whose invite came from an advisor). The confirm step is a <details>. */
.advisor-block { margin: 22px 0 6px; padding-top: 18px; border-top: 1px solid var(--line); }
.advisor-block h3 { margin-top: 0; }
.advisor-block .advisor-line { margin: 0 0 4px; }
.confirm-step > summary { list-style: none; display: inline-flex; align-items: center; cursor: pointer; font-size: 15px;
  font-weight: 600; padding: 10px 18px; border-radius: 8px; margin-top: 10px; }
.confirm-step > summary::-webkit-details-marker { display: none; }
.confirm-step[open] > summary { display: none; }
.advisor-history { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.advisor-history li { display: flex; gap: 12px; }
.advisor-history .muted { flex: none; min-width: 96px; }
