Files
vitareba/components/Assessment/Assessment.module.css
GandClaude Fable 5 2b10a18392 fix(ux): portal shell survives assessment, dual-role switching, tabbed patient record (#26)
Four coherence fixes from George's walkthrough:

- /assessment no longer hijacks the viewport: the instrument renders
  embedded inside the portal shell (sidebar + header stay visible)
  instead of mounting the marketing full-screen overlay on top of it.
- Dual-role switching is first-class: 'Clinician area →' in the portal
  sidebar (admins only), '← Patient portal' in the admin sidebar, and
  the user dropdown offers the OTHER side instead of the one you're in.
- Admins can actually reach the patient portal again: the middleware
  rule bouncing /dashboard → /admin/patients predated dual-role care
  and made the portal unreachable for Manuel and George. Post-login
  'clinicians land in admin' now lives in the login page, where an
  explicit returnTo still wins.
- Admin patient record is tabbed (Overview / Clinical / Activity /
  Edit profile) instead of ~12 stacked cards; tab state survives
  refresh via URL hash. Admin header gains the same breadcrumb the
  portal has; admin messages list unread threads first.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 20:31:55 +00:00

542 lines
9.1 KiB
CSS

.overlay {
position: fixed;
inset: 0;
background: var(--ink);
z-index: 200;
overflow-y: auto;
display: flex;
flex-direction: column;
}
/* Embedded variant — the portal /assessment page renders the instrument
INSIDE the portal shell (sidebar + header stay visible) instead of
hijacking the whole viewport like the marketing overlay does. The fixed
children (progress bar, close button) become absolute within this frame. */
.embedded {
position: relative;
inset: auto;
z-index: auto;
border-radius: var(--radius-xl);
min-height: calc(100vh - 14rem);
overflow: hidden;
}
.embedded .ovPb {
position: absolute;
}
.embedded .ovClose {
position: absolute;
}
.ovPb {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 3px;
background: var(--white-5);
z-index: 201;
}
.ovPbFill {
height: 100%;
background: var(--teal);
transition: width var(--transition-slow);
}
.ovClose {
position: fixed;
top: 1.2rem;
right: 1.5rem;
background: none;
border: 1px solid var(--white-10);
color: var(--white-40);
font-size: 1.2rem;
width: 2.2rem;
height: 2.2rem;
cursor: pointer;
border-radius: var(--radius-full);
z-index: 202;
display: flex;
align-items: center;
justify-content: center;
transition: all var(--transition-normal);
}
.ovClose:hover {
border-color: var(--teal);
color: var(--teal);
}
.ovClose:focus-visible {
outline: 2px solid var(--teal);
outline-offset: 2px;
}
.ovScreen {
display: none;
max-width: 700px;
margin: 0 auto;
padding: 5rem 2rem;
width: 100%;
}
.active {
display: block;
}
.ovEyebrow {
font-size: 0.55rem;
letter-spacing: 0.3em;
text-transform: uppercase;
color: var(--teal-60);
margin-bottom: 1.5rem;
}
.ovH1 {
font-family: var(--font-cormorant), serif;
font-size: 3.5rem;
font-weight: 300;
color: var(--white);
line-height: 1.1;
}
.ovH1 em {
font-style: italic;
color: var(--teal);
}
.ovH2 {
font-family: var(--font-cormorant), serif;
font-size: 1.2rem;
font-weight: 300;
color: var(--white-30);
margin-top: 0.8rem;
}
.ovSub {
font-size: 0.82rem;
color: var(--white-30);
line-height: 1.85;
margin-top: 1.5rem;
max-width: 32rem;
}
.ovStats {
display: flex;
gap: 3rem;
margin-top: 2rem;
}
.ovStatN {
font-family: var(--font-cormorant), serif;
font-size: 1.8rem;
color: var(--white);
}
.ovStatL {
font-size: 0.6rem;
letter-spacing: 0.15em;
text-transform: uppercase;
color: var(--white-20);
}
.ovDims {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
gap: 0.5rem;
margin-top: 2rem;
}
.ovDim {
background: var(--white-3);
border: 1px solid var(--white-6);
border-radius: var(--radius-sm);
padding: 0.8rem;
text-align: center;
}
.ovDimIcon {
font-size: 1.2rem;
margin-bottom: 0.3rem;
}
.ovDimName {
font-size: 0.55rem;
letter-spacing: 0.1em;
color: var(--white-25);
}
.ovStartBtn {
background: var(--teal);
color: var(--white);
border: none;
padding: 1rem 2.5rem;
font-size: 0.7rem;
letter-spacing: 0.16em;
text-transform: uppercase;
cursor: pointer;
font-family: var(--font-dm-sans), sans-serif;
border-radius: var(--radius-sm);
margin-top: 2.5rem;
transition: background var(--transition-normal);
}
.ovStartBtn:hover {
background: var(--teal-dark);
}
.ovStartBtn:focus-visible {
outline: 2px solid var(--teal);
outline-offset: 2px;
}
.ovDisc {
font-size: 0.6rem;
color: var(--white-12);
margin-top: 1.5rem;
}
/* Question screen */
.qDimLabel {
font-size: 0.6rem;
letter-spacing: 0.2em;
text-transform: uppercase;
color: var(--teal);
margin-bottom: 0.5rem;
}
.qProg {
font-size: 0.6rem;
color: var(--white-20);
margin-bottom: 0.3rem;
}
.qTrack {
height: 2px;
background: var(--white-5);
border-radius: var(--radius-2xs);
margin-bottom: 2rem;
}
.qTrackFill {
height: 100%;
background: var(--teal);
border-radius: var(--radius-2xs);
transition: width var(--transition-normal);
}
.qText {
font-family: var(--font-cormorant), serif;
font-size: 1.5rem;
font-weight: 300;
color: var(--white);
line-height: 1.4;
margin-bottom: 2rem;
}
.qBtns {
display: flex;
gap: 0.4rem;
margin-bottom: 2rem;
flex-wrap: wrap;
}
.qBtn {
width: 3rem;
height: 3rem;
border-radius: var(--radius-sm);
border: 1px solid var(--white-10);
background: none;
color: var(--white-30);
font-size: 0.85rem;
cursor: pointer;
font-family: var(--font-dm-sans), sans-serif;
transition: all var(--transition-fast);
}
.qBtn:hover {
border-color: var(--teal);
color: var(--teal);
}
.qBtn:focus-visible {
outline: 2px solid var(--teal);
outline-offset: 2px;
}
.selected {
background: var(--teal);
border-color: var(--teal);
color: var(--white);
}
.qScale {
display: flex;
justify-content: space-between;
font-size: 0.6rem;
color: var(--white-15);
margin-top: -1.2rem;
margin-bottom: 2rem;
}
.qNav {
display: flex;
gap: 0.6rem;
}
.qPrev {
background: none;
border: 1px solid var(--white-10);
color: var(--white-30);
padding: 0.6rem 1.5rem;
font-size: 0.65rem;
letter-spacing: 0.14em;
text-transform: uppercase;
cursor: pointer;
font-family: var(--font-dm-sans), sans-serif;
border-radius: var(--radius-xs);
transition: all var(--transition-normal);
}
.qPrev:hover {
border-color: var(--teal);
color: var(--teal);
}
.qPrev:focus-visible,
.qNext:focus-visible {
outline: 2px solid var(--teal);
outline-offset: 2px;
}
.qPrev:disabled {
opacity: 0.2;
cursor: default;
}
.qNext:disabled {
cursor: default;
}
.qNext {
background: var(--white-5);
border: none;
color: var(--white-15);
padding: 0.6rem 1.5rem;
font-size: 0.65rem;
letter-spacing: 0.14em;
text-transform: uppercase;
cursor: default;
font-family: var(--font-dm-sans), sans-serif;
border-radius: var(--radius-xs);
transition: all var(--transition-normal);
}
.enabled {
background: var(--teal);
color: var(--white);
cursor: pointer;
}
/* Results screen */
.vCard {
background: var(--white-3);
border: 1px solid var(--white-6);
border-radius: var(--radius-lg);
padding: 2.5rem;
text-align: center;
margin-bottom: 2rem;
}
.vScore {
font-family: var(--font-cormorant), serif;
font-size: 4rem;
font-weight: 300;
color: var(--teal);
}
.vScore span {
font-size: 1.5rem;
color: var(--teal-50);
}
.vName {
font-family: var(--font-cormorant), serif;
font-size: 1.3rem;
color: var(--white);
margin: 0.5rem 0;
}
.vText {
font-size: 0.8rem;
color: var(--white-35);
line-height: 1.8;
max-width: 28rem;
margin: 0 auto;
}
.rScores {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0.8rem;
margin-bottom: 2.5rem;
}
.rScoreCard {
background: var(--white-3);
border-radius: var(--radius-sm);
padding: 1rem;
text-align: center;
}
.rScIcon {
font-size: 1.2rem;
margin-bottom: 0.3rem;
}
.rScName {
font-size: 0.55rem;
letter-spacing: 0.1em;
color: var(--white-25);
margin-bottom: 0.4rem;
}
.rScN {
font-family: var(--font-cormorant), serif;
font-size: 1.4rem;
font-weight: 300;
}
.rScBar {
height: 3px;
background: var(--white-5);
border-radius: var(--radius-2xs);
margin-top: 0.5rem;
}
.rScFill {
height: 100%;
border-radius: var(--radius-2xs);
transition: width var(--transition-slow);
}
.rDim {
margin-bottom: 1.5rem;
}
.rDimTop {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.4rem;
}
.rDimName {
font-size: 0.7rem;
letter-spacing: 0.1em;
color: var(--white-40);
}
.rDimScore {
font-family: var(--font-cormorant), serif;
font-size: 1.1rem;
}
.rDimBar {
height: 4px;
background: var(--white-5);
border-radius: var(--radius-2xs);
margin-bottom: 0.6rem;
}
.rDimFill {
height: 100%;
border-radius: var(--radius-2xs);
}
.rDimText {
font-size: 0.78rem;
color: var(--white-30);
line-height: 1.75;
}
.rCta {
text-align: center;
margin-top: 3rem;
padding: 2rem;
background: var(--teal-8);
border-radius: var(--radius-md);
}
.rCtaTitle {
font-family: var(--font-cormorant), serif;
font-size: 1.4rem;
color: var(--white);
margin-bottom: 0.5rem;
}
.rCtaSub {
font-size: 0.83rem;
color: var(--muted);
margin-bottom: 1.5rem;
}
.rCtaSubSpaced {
composes: rCtaSub;
margin-top: 0.5rem;
}
.rCtaBtns {
display: flex;
gap: 0.7rem;
justify-content: center;
flex-wrap: wrap;
}
.rBtnP {
background: var(--teal);
color: var(--white);
border: none;
padding: 0.8rem 2rem;
font-size: 0.7rem;
letter-spacing: 0.16em;
text-transform: uppercase;
cursor: pointer;
font-family: var(--font-dm-sans), sans-serif;
border-radius: var(--radius-sm);
text-decoration: none;
display: inline-block;
}
.rBtnO {
border: 1px solid var(--teal-30);
color: var(--teal);
background: none;
padding: 0.8rem 2rem;
font-size: 0.7rem;
letter-spacing: 0.16em;
text-transform: uppercase;
cursor: pointer;
font-family: var(--font-dm-sans), sans-serif;
border-radius: var(--radius-sm);
}
@media (max-width: 767px) {
.ovClose,
.ovStartBtn,
.qPrev,
.qNext,
.rBtnP,
.rBtnO {
min-height: 2.75rem;
}
}
@media (min-width: 768px) {
.rScores {
grid-template-columns: repeat(5, 1fr);
}
}