/* ==========================================================================
   MECANDRIA — Mecandria HMS (page-specific; loaded only on hms.html, after built.css)
   Classes are prefixed .hm- and build on the .bm- tokens of the Built by Mecandria page.

   hero (dashboard screenshot) → a patient's visit → module explorer →
   module picker → client quote → CTA.

   Content rule: module names and groups match the HMS admin's plan screen.
   ========================================================================== */

/* ---- hero ---- */
.hm-hero-grid { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
.hm-hero h1 { max-width: 15ch; }
.hm-facts { display: flex; flex-wrap: wrap; gap: 14px 36px; margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--bm-line); }
.hm-facts div { display: grid; gap: 2px; }
.hm-facts dt { font-size: clamp(1.8rem, 1.2rem + 1.4vw, 2.6rem); font-weight: 800; line-height: 1; letter-spacing: -.03em; color: #1D1B2F; font-variant-numeric: tabular-nums; }
.hm-facts dd { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--bm-dim); }
.hm-hero-shot { position: relative; }
.hm-badge { position: absolute; padding: 9px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--bm-line-2); box-shadow: 0 18px 34px -22px rgba(29, 27, 47, .5); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #1D1B2F; animation: hm-float 6s ease-in-out infinite; }
.hm-badge::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: rgb(var(--bm-cyan)); vertical-align: 1px; }
.hm-badge--a { left: -18px; bottom: 18%; }
.hm-badge--b { right: -12px; top: -16px; animation-delay: -3s; }
.hm-badge--b::before { background: rgb(var(--bm-violet)); }
@keyframes hm-float { 50% { transform: translateY(-8px); } }

/* ---- shared line icon tile ---- */
.hm-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--bm-cyan), .08); color: rgb(var(--bm-cyan)); }
.hm-ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hm-ic--lg { width: 56px; height: 56px; border-radius: 16px; }
.hm-ic--lg svg { width: 28px; height: 28px; stroke-width: 1.5; }

/* ---- 01 · a patient's visit ---- */
.hm-journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; position: relative; }
.hm-journey::before { content: ""; position: absolute; left: 4%; right: 4%; top: 46px; height: 1px; background: linear-gradient(90deg, rgba(var(--bm-violet), .4), rgb(var(--bm-cyan))); z-index: 0; }
.hm-journey li { position: relative; z-index: 1; }
.hm-journey a { display: grid; justify-items: center; gap: 8px; padding: 24px 12px 22px; text-align: center; color: inherit; border-radius: 14px; border: 1px solid transparent; transition: border-color .3s ease, background .3s ease, transform .35s var(--ease); }
.hm-journey a:hover { background: var(--bm-surface); border-color: rgba(var(--bm-cyan), .4); transform: translateY(-3px); }
.hm-journey .hm-ic { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 1px solid rgba(var(--bm-cyan), .45); box-shadow: 0 0 0 6px var(--bm-bg-2); }
.hm-journey li:last-child .hm-ic { background: rgb(var(--bm-cyan)); color: #fff; border-color: transparent; }
.hm-journey b { margin-top: 6px; font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; text-transform: uppercase; }
.hm-journey span:not(.hm-ic) { font-size: .8rem; line-height: 1.4; color: var(--bm-muted); }
.js .hm-journey:not(.is-in) li { opacity: 0; transform: translateY(14px); }
.js .hm-journey[data-reveal] { opacity: 1; transform: none; }
.js .hm-journey.is-in li { transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i) * .1s); }

/* ---- 02 · module explorer: list left, one module right (wide screens); every module a card (phones) ---- */
.hm-explorer { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.hm-nav { position: sticky; top: calc(var(--nav-sticky-h, 76px) + 20px); display: grid; gap: 2px; }
.hm-nav-k { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 18px 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--bm-line); font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: rgb(var(--bm-cyan)); }
.hm-nav-k:first-child { margin-top: 0; }
.hm-nav-k span { font-size: 9.5px; letter-spacing: .12em; color: var(--bm-dim); }
.hm-tab { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 10px; color: #3A3648; font-size: .95rem; font-weight: 600; transition: background .25s ease, color .25s ease; }
.hm-tab .hm-ic { width: 30px; height: 30px; border-radius: 8px; background: transparent; color: var(--bm-dim); transition: background .25s ease, color .25s ease; }
.hm-tab .hm-ic svg { width: 17px; height: 17px; }
.hm-tab:hover { background: rgba(255, 255, 255, .7); color: #1D1B2F; }
.hm-tab[aria-current="true"] { background: #fff; color: #1D1B2F; box-shadow: 0 10px 24px -20px rgba(29, 27, 47, .6); }
.hm-tab[aria-current="true"] .hm-ic { background: rgb(var(--bm-cyan)); color: #fff; }
.hm-tab:focus-visible { outline: 2px solid rgb(var(--bm-magenta)); outline-offset: 2px; }

.hm-panels { display: grid; gap: 16px; }
.hm-panel { padding: clamp(24px, 3vw, 40px); border: 1px solid var(--bm-line-2); border-radius: 18px; background: var(--bm-surface); box-shadow: 0 30px 60px -48px rgba(29, 27, 47, .5); scroll-margin-top: calc(var(--nav-sticky-h, 76px) + 20px); }
.js .hm-explorer.is-tabs .hm-panel:not(.is-on) { display: none; }
.js .hm-explorer.is-tabs .hm-panel.is-on { animation: hm-in .5s var(--ease) both; }
@keyframes hm-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hm-panel-head { display: flex; align-items: center; gap: 18px; }
.hm-panel h3 { margin: 0; font-size: clamp(1.5rem, 1rem + 1.5vw, 2.3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.hm-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 0; }
.hm-tag { font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; padding: 4px 9px; border-radius: 6px; color: rgb(var(--bm-cyan)); background: rgba(var(--bm-cyan), .08); }
.hm-tag--core { color: rgb(var(--bm-violet)); background: rgba(var(--bm-violet), .08); }
.hm-plan { font-size: .82rem; color: var(--bm-dim); }
.hm-sum { margin: 24px 0 26px; max-width: 62ch; font-size: 1.08rem; line-height: 1.7; color: #3A3648; }
.hm-k { margin: 0 0 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--bm-dim); }
.hm-list { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.hm-list li { position: relative; padding: 12px 0 12px 26px; border-bottom: 1px solid var(--bm-line); font-size: .95rem; color: #3A3648; }
.hm-list li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 12px; height: 7px; border-left: 2px solid rgb(var(--bm-cyan)); border-bottom: 2px solid rgb(var(--bm-cyan)); transform: rotate(-45deg); }
.hm-works { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.hm-works a { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--bm-line-2); font-size: .82rem; font-weight: 600; color: #3A3648; transition: border-color .25s ease, color .25s ease; }
.hm-works a:hover { border-color: rgb(var(--bm-cyan)); color: rgb(var(--bm-cyan)); }

/* ---- 03 · module picker (looks like the HMS plan screen) ---- */
.hm-plan { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hm-plan .bm-h2 { margin: 22px 0 18px; }
.hm-count { margin: 26px 0 22px; font-size: .95rem; color: var(--bm-muted); }
.hm-count b { font-size: 1.6rem; color: #1D1B2F; font-variant-numeric: tabular-nums; }
.hm-picker { margin: 0; padding: clamp(18px, 2.4vw, 28px); border: 1px solid var(--bm-line-2); border-radius: 18px; background: var(--bm-surface); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; box-shadow: 0 30px 60px -48px rgba(29, 27, 47, .5); }
.hm-picker legend { float: left; grid-column: 1 / -1; width: 100%; padding: 0; margin-bottom: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--bm-dim); }
.hm-pick { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px; border-radius: 10px; border: 1.5px solid var(--bm-line-2); background: var(--bm-surface-2); cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.hm-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hm-pick .box { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 4px; border: 1.5px solid var(--bm-line-2); background: #fff; display: grid; place-items: center; }
.hm-pick input:checked + .box { background: rgb(var(--bm-cyan)); border-color: rgb(var(--bm-cyan)); }
.hm-pick input:checked + .box::after { content: ""; width: 7px; height: 4px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.hm-pick:has(input:checked) { border-color: rgba(var(--bm-cyan), .6); background: rgba(var(--bm-cyan), .04); }
.hm-pick input:focus-visible + .box { outline: 2px solid rgb(var(--bm-magenta)); outline-offset: 2px; }
.hm-pick .t { display: grid; gap: 2px; min-width: 0; }
.hm-pick b { font-size: .86rem; line-height: 1.25; }
.hm-pick small { font-size: 9.5px; letter-spacing: .14em; color: var(--bm-dim); }
.hm-pick em { margin-left: auto; font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: .14em; padding: 3px 6px; border-radius: 5px; color: rgb(var(--bm-violet)); background: rgba(var(--bm-violet), .08); }
.hm-pick.is-core { cursor: default; border-style: dashed; }
.hm-pick.is-core input + .box { background: rgba(var(--bm-violet), .55); border-color: transparent; }

/* ---- 04 · client quote ---- */
.hm-quote { margin: 0 auto; max-width: 960px; display: grid; gap: 22px; padding: clamp(28px, 4vw, 56px); border-radius: 22px; border: 1px solid var(--bm-line-2); background: linear-gradient(140deg, rgba(var(--bm-cyan), .06), rgba(var(--bm-violet), .05)), var(--bm-surface); }
.hm-quote blockquote { margin: 0; }
.hm-quote p { margin: 0; font-size: clamp(1.15rem, .95rem + .8vw, 1.6rem); line-height: 1.55; font-weight: 600; letter-spacing: -.01em; color: #1D1B2F; }
.hm-quote figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 20px; border-top: 1px solid var(--bm-line); }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .hm-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .hm-hero-grid { grid-template-columns: 1fr; }
  .hm-badge--a { left: 8px; }
  .hm-badge--b { right: 8px; }
  .hm-journey { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
  .hm-journey::before { display: none; }
  .hm-plan { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hm-explorer { grid-template-columns: 1fr; }
  .hm-nav { display: none; }
  .js .hm-explorer.is-tabs .hm-panel:not(.is-on) { display: block; }
  .js .hm-explorer.is-tabs .hm-panel.is-on { animation: none; }
}
@media (max-width: 640px) {
  .hm-journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-list { grid-template-columns: 1fr; }
  .hm-picker { grid-template-columns: 1fr; }
  .hm-panel-head { gap: 14px; }
  .hm-ic--lg { width: 48px; height: 48px; }
  .hm-badge { font-size: 9.5px; padding: 7px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-badge, .js .hm-explorer.is-tabs .hm-panel.is-on { animation: none; }
  .js .hm-journey li { opacity: 1 !important; transform: none !important; transition: none !important; }
}
