/* access: who may only read (docs/design/FAMILY.md for the look).

   access.js marks <html data-access="full | unverified | patient | paused">. A verified clinician's page (full) is not
   touched by anything here. For the other two: the controls that take part are drawn quieter, a comment or
   reply field becomes one quiet line, the top bar carries a "Read only" pill, and one small glass card says
   why. A patient's page also loses what is a clinician's alone. The last part is the door's first question
   and the patient's sign-up (claim-door.js). Tokens only. */

/* 1. The pill in the top bar ---------------------------------------------------------------------------- */
.acc-pill {
  display: inline-flex; flex: none; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 11px;
  border: 1px solid var(--frost-line); border-radius: 999px; background: var(--frost-strong); box-shadow: var(--frost-rim);
  font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1; white-space: nowrap; color: var(--oryn-text-2); cursor: pointer;
  transition: border-color .16s var(--ease-out), color .16s var(--ease-out), scale .12s var(--ease-out);
}
.acc-pill > i { font-size: 17px; color: var(--color-muted-foreground); }
.acc-pill:hover { border-color: var(--oryn-border-hover); color: var(--color-foreground); }
.acc-pill:active { scale: .96; }
.acc-pill:focus-visible, .acc-line__go:focus-visible, .acc-card__go:focus-visible { outline: none; box-shadow: var(--frost-rim), 0 0 0 4px var(--brand-soft); }
@media (min-width: 1024px) { .acc-pill { height: 44px; padding: 0 18px 0 14px; font-size: 14px; } }

/* 2. The card that says why: real glass, it grows from the control that was pressed ---------------------- */
.acc-card {
  position: fixed; z-index: 900; left: 12px; top: 12px; width: min(340px, calc(100vw - 24px)); padding: 22px 22px 20px;
  border: 1px solid var(--frost-line); border-radius: 22px; background: var(--frost-float); color: var(--color-foreground);
  box-shadow: var(--frost-rim), var(--frost-pop);
  -webkit-backdrop-filter: blur(26px) saturate(1.6); backdrop-filter: blur(26px) saturate(1.6);
  transform-origin: var(--acc-ox, 50%) var(--acc-oy, 0); opacity: 0; transform: scale(.86);
  transition: opacity .16s var(--ease-out), transform .3s var(--frost-ease, var(--ease-out));
}
.acc-card.is-in { opacity: 1; transform: none; }
.acc-card__mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: var(--brand-soft); font-size: 20px; color: var(--color-brand-ink); }
.acc-card__title { margin: 14px 0 0; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -.012em; }
.acc-card__text { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--color-muted-foreground); }
.acc-card__more { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.acc-card__foot { display: flex; justify-content: flex-end; margin-top: 18px; }
.acc-card__go {
  height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--color-brand); color: var(--color-primary-foreground);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-primary-foreground) 28%, transparent), 0 8px 18px -10px var(--color-brand);
  transition: background-color .16s var(--ease-out), scale .12s var(--ease-out);
}
.acc-card__go:hover { background: var(--color-brand-hover); }
.acc-card__go:active { scale: .96; }
.acc-card[data-acc-kind="patient"] .acc-card__go { border: 1px solid var(--frost-line); background: var(--frost-strong); color: var(--color-foreground); box-shadow: var(--frost-rim); }
@media (prefers-reduced-motion: reduce) { .acc-card { transform: none; transition: opacity .12s linear; } }
html.a11y-reduce-motion .acc-card { transform: none; transition: opacity .12s linear; }

/* 3. What is switched off is drawn quieter, and still answers a press with the card ----------------------- */
html[data-access="unverified"] .acc-off, html[data-access="patient"] .acc-off { opacity: .42; filter: saturate(.3); cursor: help; }
html[data-access="unverified"] .acc-off:hover, html[data-access="patient"] .acc-off:hover { translate: none; }
/* a paused account (the team paused its posting): the same quiet controls */
html[data-access="paused"] .acc-off { opacity: .42; filter: saturate(.3); cursor: help; }
html[data-access="paused"] .acc-off:hover { translate: none; }

/* a comment or reply field is one quiet line */
html[data-access="unverified"] :is(.pp-write, .cx-foot, #commentEmpty),
html[data-access="paused"] :is(.pp-write, .cx-foot, #commentEmpty),
html[data-access="patient"] :is(.pp-write, .cx-foot, #commentEmpty) { display: none !important; }
.acc-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 18px 0 6px; padding: 14px 18px;
  border-radius: 18px; background: var(--frost-well); font-size: 14px; line-height: 1.5; color: var(--color-muted-foreground);
}
.acc-line > i { flex: none; font-size: 18px; }
.acc-line > span { flex: 1 1 220px; min-width: 0; }
.acc-line__go {
  flex: none; height: 36px; padding: 0 16px; border: 1px solid var(--frost-line); border-radius: 999px; background: var(--frost-strong);
  box-shadow: var(--frost-rim); font: inherit; font-size: 13.5px; font-weight: 600; color: var(--color-brand-ink); cursor: pointer;
  transition: border-color .16s var(--ease-out), scale .12s var(--ease-out);
}
.acc-line__go:hover { border-color: var(--oryn-border-hover); }
.acc-line__go:active { scale: .96; }

/* 4. A clinician who is not verified: Create is the way to verification ----------------------------------- */
#newPostBtn.acc-verify { gap: 8px; }
/* on a phone the round button of the bottom bar is the one Create: the top bar keeps the pill */
@media (max-width: 639.98px) { #newPostBtn.acc-verify { display: none; } }

/* 4b. In review: a method was sent and a person on the team has it. Nothing invites the doctor to verify again:
   Create is a calm place that says so, with a point that breathes, and opens the explanation (door.css has the
   three steps the card shows, vw-*) ------------------------------------------------------------------------ */
#newPostBtn.acc-wait {
  padding: 0 18px 0 15px; gap: 10px; border: 1px solid var(--frost-line); background: var(--frost-strong); box-shadow: var(--frost-rim); color: var(--color-foreground);
}
#newPostBtn.acc-wait:hover { border-color: var(--oryn-border-hover); box-shadow: var(--frost-rim), 0 0 0 4px var(--brand-soft); }
.acc-live { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--color-brand); animation: vw-breathe 1.6s ease-in-out infinite; }
.acc-live::after { content: ''; position: absolute; inset: 0; border: 1.5px solid var(--color-brand); border-radius: 50%; animation: vw-halo 1.6s var(--ease-out) infinite; }
/* the phone bar's round button: quiet, with the same live point */
#mnavCreate.acc-wait .mnav-create-btn { position: relative; border: 1px solid var(--frost-line); background: var(--frost-strong); box-shadow: var(--frost-rim); color: var(--color-brand-ink); }
#mnavCreate.acc-wait .mnav-create-btn::after { content: ''; position: absolute; right: 1px; top: 1px; width: 10px; height: 10px; border: 2px solid var(--color-card); border-radius: 50%; background: var(--color-brand); animation: vw-breathe 1.6s ease-in-out infinite; }
.acc-card__steps { margin: 16px 0 14px; }
.acc-card[data-acc-wait] { width: min(360px, calc(100vw - 24px)); }
.acc-card[data-acc-wait] .acc-card__go { border: 1px solid var(--frost-line); background: var(--frost-strong); color: var(--color-foreground); box-shadow: var(--frost-rim); }
.acc-card[data-acc-wait] .acc-card__go:hover { border-color: var(--oryn-border-hover); background: var(--frost-strong); }

/* 4c. The team approved while the app was open: said once, where Create is, with one ring of light --------- */
.acc-card--ok .acc-card__mark { background: color-mix(in srgb, var(--color-success) 16%, transparent); color: color-mix(in srgb, var(--color-success) 70%, var(--color-foreground)); }
.acc-card--ok .acc-card__foot { gap: 8px; }
.acc-card__quiet {
  height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--color-muted-foreground); cursor: pointer;
  transition: color .16s var(--ease-out), background-color .16s var(--ease-out);
}
.acc-card__quiet:hover { background: var(--oryn-surface-hover); color: var(--color-foreground); }
.acc-card__quiet:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
#newPostBtn.acc-opened, #mnavCreate.acc-opened .mnav-create-btn { animation: acc-opened 1.5s var(--ease-out) 1; }
@keyframes acc-opened {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-brand) 55%, transparent); }
  100% { box-shadow: 0 0 0 22px transparent; }
}
@media (prefers-reduced-motion: reduce) { .acc-live, .acc-live::after, #mnavCreate.acc-wait .mnav-create-btn::after, #newPostBtn.acc-opened, #mnavCreate.acc-opened .mnav-create-btn { animation: none; } .acc-live::after { display: none; } }
html.a11y-reduce-motion :is(.acc-live, #newPostBtn.acc-opened, #mnavCreate.acc-opened .mnav-create-btn), html.a11y-reduce-motion .acc-live::after, html.a11y-reduce-motion #mnavCreate.acc-wait .mnav-create-btn::after { animation: none; }
html.a11y-reduce-motion .acc-live::after { display: none; }

/* 5. A patient's page: nothing that is a clinician's alone ------------------------------------------------- */
html[data-access="patient"] :is(#newPostBtn, #mnavCreate, #ppRail, #consultBadge,
  [data-view="consults"], [data-goto="consults"], [data-view-public],
  [data-open-consult], [data-detail-consult], [data-sheet-consult],
  [data-cl-invite], [data-dir-invite], [data-dirfilter="invitations"], [data-clin-claim], [data-cm-reply],
  .bs-vf-card) { display: none !important; }
/* Settings: the account, briefing preferences, notifications, and how the app looks (Display, and Appearance
   in Accessibility). Not the clinician's profile, the public page or the drafts. */
html[data-access="patient"] :is(#setNav, #setNavMobile) :is([data-setnav="profile"], [data-setnav="public"], [data-setnav="drafts"]),
html[data-access="patient"] :is([data-sheet-nav="profile"], [data-sheet-nav="public"], [data-sheet-nav="drafts"]),
html[data-access="patient"] :is([data-setpanel="profile"], [data-setpanel="public"], [data-setpanel="drafts"]),
html[data-access="patient"] #setNav > p:has(+ [data-setnav="drafts"]),
html[data-access="patient"] [data-setpanel="account"] > .grid:first-child { display: none !important; }
/* the phone bar keeps Home, Library and the account: three even places */
html[data-access="patient"] .mnav { grid-template-columns: repeat(3, 1fr); }
/* the welcome: no question about a role or a specialty */

/* the Doctorpedia Library, in a new tab (shown once window.BS_LIBRARY_URL is set) */
.acc-lib { text-decoration: none; }
.app-sidebar a.nav-link.acc-lib { display: flex; align-items: center; }
.acc-lib__out { margin-left: auto; font-size: 15px; color: var(--color-muted-foreground); opacity: .7; }
html[data-nav="collapsed"] .acc-lib__out { display: none; }

/* 6. The door: "Who are you?" and the patient's sign-up (claim-door.js) ----------------------------------- */
.cd-kinds { display: grid; gap: 16px; margin-top: 8px; }
.cd-kind {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 20px; align-items: center; gap: 18px; width: 100%; min-height: 112px;
  padding: 24px 22px; border: 1px solid var(--frost-line); border-radius: 22px; background: var(--frost-strong);
  box-shadow: var(--frost-rim), var(--frost-shadow); font: inherit; text-align: left; color: var(--color-foreground); cursor: pointer;
  transition: border-color .16s var(--ease-out), box-shadow .32s var(--ease-out), translate .42s var(--frost-ease, var(--ease-out)), scale .12s var(--ease-out);
}
.cd-kind__ic { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; background: var(--brand-soft); font-size: 25px; color: var(--color-brand-ink); }
.cd-kind__body { display: block; min-width: 0; }
.cd-kind__body b { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -.012em; }
.cd-kind__body span { display: block; margin-top: 5px; font-size: 14px; line-height: 1.5; color: var(--color-muted-foreground); }
.cd-kind__go { font-size: 19px; color: var(--color-muted-foreground); transition: translate .3s var(--ease-out), color .16s var(--ease-out); }
@media (hover: hover) {
  .cd-kind:hover { border-color: var(--oryn-border-hover); box-shadow: var(--frost-rim), var(--frost-shadow-up); translate: 0 -1px; }
  .cd-kind:hover .cd-kind__go { translate: 3px 0; color: var(--color-brand); }
}
.cd-kind:active { scale: .98; }
.cd-kind:focus-visible { outline: none; border-color: color-mix(in srgb, var(--color-brand) 70%, transparent); box-shadow: var(--frost-rim), 0 0 0 4px var(--brand-soft); }
@media (max-width: 420px) { .cd-kind { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 20px 18px; } .cd-kind__ic { width: 44px; height: 44px; font-size: 22px; } .cd-kind__go { display: none; } }

/* the patient's one screen: room between the parts */
.cd-patient .cd-form { gap: 20px; }
.cd-checks { display: grid; gap: 4px; }
.cd-note {
  display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 16px 18px; border: 1px solid var(--frost-line); border-radius: 18px;
  background: var(--frost); box-shadow: var(--frost-rim); font-size: 13.5px; line-height: 1.55; color: var(--oryn-text-2);
}
.cd-note > i { flex: none; margin-top: 1px; font-size: 18px; color: var(--color-brand-ink); }
@media (prefers-reduced-motion: reduce) { .cd-kind, .cd-kind__go, .acc-pill, .acc-line__go, .acc-card__go { transition: none; } }
