/* Patient portal layout and its own pieces. The shared design system (tokens, sign-in,
   buttons, forms, panels, dialogs, toasts, chat) is app.css, copied from shared/css/.
   Patients include older people, so everything is a size up from the admin. */

:root {
  --text: 17px;
  --text-sm: 16px;
  --text-xs: 15px;
  --text-xxs: 14px;
  --control: 52px;
  --control-fs: 17px;
  --btn: 48px;
  --btn-fs: 16px;
  --icon-btn: 44px;
  --max: clamp(1000px, 84vw, 1800px);
}
body { letter-spacing: -.011em; }
.wrap { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Sign in ---------- */

.signin-bar nav { display: flex; align-items: center; gap: 24px; }
.auth-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: min(380px, calc(100vw - 32px)); margin-top: 40px;
  padding: 4px; border-radius: 999px; background: rgb(255 255 255 / .08);
}
.auth-switch button { min-height: 44px; border: 0; border-radius: 999px; background: none; color: rgb(255 255 255 / .75); font-size: 16px; font-weight: 500; transition: background-color .2s, color .2s; }
.auth-switch button:hover { color: var(--white); }
.auth-switch button[aria-selected="true"] { background: var(--white); color: var(--ink); }
#signinForm, #signupForm { margin-top: 24px; }
.signin .signin-error { width: min(380px, calc(100vw - 32px)); margin-top: 20px; text-align: left; }
.signin-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.signin-row .check { color: var(--dim); font-size: 15px; }
.signin-row .check input { accent-color: var(--blue); }
.signin-link { padding: 0; border: 0; background: none; color: var(--blue); font-size: 15px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.signin-help { font-size: 14px; color: var(--dim); }
.signin-form .signin-help { margin-top: -2px; }
.signin-foot { margin-top: 28px; max-width: 380px; font-size: 15px; color: var(--dim); }
.signin-foot a { color: var(--white); }

/* ---------- Dashboard header ---------- */

.pbar, .hello, .pfoot { background: var(--ink); color: var(--white); }
.pbar :focus-visible, .hello :focus-visible, .pfoot :focus-visible { outline-color: var(--blue); outline-offset: 3px; }
.pbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 96px; }
.pbar-in > a img { width: auto; height: 64px; filter: brightness(1.3) contrast(1.05); }
.pbar nav { display: flex; align-items: center; gap: 8px 24px; }
.pbar .tel { display: inline-flex; align-items: center; gap: 8px; color: rgb(255 255 255 / .85); font-weight: 500; text-decoration: none; }
.pbar .tel:hover { color: var(--white); }
.btn-ghost.on-dark { color: var(--white); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .35); }
.btn-ghost.on-dark:hover:not(:disabled) { background: rgb(255 255 255 / .1); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .6); }
@media (max-width: 640px) {
  .pbar-in { height: 76px; }
  .pbar-in > a img { height: 48px; }
  .pbar .tel span { display: none; }
}

/* The greeting and the two things patients come here to do. */
.hello { padding: 24px 0 64px; }
.hello .eyebrow { margin-bottom: 10px; font-weight: 600; color: var(--blue); }
.hello h1 { font-size: clamp(38px, 5.6vw, 64px); line-height: 1.04; font-weight: 650; letter-spacing: -.045em; text-wrap: balance; outline: none; }
.hello .lede { max-width: 52ch; margin-top: 16px; font-size: clamp(19px, 2vw, 22px); line-height: 1.36; font-weight: 500; letter-spacing: -.02em; color: var(--dim); }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hello .ctas { margin-top: 32px; }

/* ---------- Main area ---------- */

.pmain { padding-top: 32px; padding-bottom: 96px; }
.panel-head h2 { font-size: 20px; }
.rows > li, .row { padding: 18px 24px; }

/* Things waiting on the patient, so nothing gets forgotten. */
.todo { margin-bottom: 28px; }
.todo .rows > li { flex-wrap: wrap; }
.todo .row-main { min-width: min(320px, 100%); }
.todo-ico { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--sky); color: var(--blue-2); }
.todo-ico .i { width: 22px; height: 22px; }
@media (max-width: 640px) { .todo-ico { display: none; } }

.ptabs {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1) 20px; padding: 12px var(--gutter);
  background: rgb(244 242 239 / .88); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
}
.ptabs::-webkit-scrollbar { display: none; }
.ptabs button {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 46px; padding: 0 18px; border: 0; border-radius: 999px;
  background: none; color: var(--mute); font-size: 16px; font-weight: 500; white-space: nowrap; transition: background-color .15s, color .15s;
}
.ptabs button:hover { background: rgb(10 25 41 / .06); color: var(--ink); }
.ptabs button[aria-current="page"] { background: var(--ink); color: var(--white); }
.count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--blue); color: var(--ink); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums;
}

/* ---------- Appointments ---------- */

.visit { align-items: flex-start !important; }
/* The date as a calendar chip, like the portal drawing on the home page (.cal-chip in site.css). */
.cal-chip { display: grid; place-content: center; justify-items: center; gap: 4px; flex: none; width: 60px; height: 64px; border-radius: 14px; background: var(--ink); color: var(--white); line-height: 1; }
.cal-chip small { font-size: 12px; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; }
.cal-chip b { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.visit .row-title { font-size: 18px; }
.visit .row-meta { font-size: 16px; }
.visit-notes { display: grid; gap: 10px; margin-top: 12px; }
.callout b { font-weight: 600; }
.offer-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.done { display: grid; justify-items: center; gap: 10px; padding: 48px 24px; text-align: center; }
.done-ico { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 50%; background: #dcf3d0; color: #2f6512; }
.done-ico .i { width: 30px; height: 30px; }
.done h2 { font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
.done p { max-width: 46ch; color: var(--mute); }
.done .ctas { justify-content: center; margin-top: 14px; }
.as { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--paper); font-size: 16px; }
.as b { font-weight: 600; }

/* ---------- Messages ---------- */

.convo-row { cursor: pointer; }
.convo-row .row-title { font-size: 18px; }
.convo-row.unread .row-title::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.convo-row time { flex: none; font-size: 15px; color: var(--mute); }
.chat-top { display: flex; align-items: flex-start; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.chat-top h2 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.chat-top .row-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.portal-chat .chat-log { min-height: 300px; max-height: 60vh; }
.portal-chat .composer { padding: 16px 24px; }
.portal-chat .composer .btn { min-height: var(--control); }

/* ---------- Footer ---------- */

.pfoot { padding: 56px 0 40px; color: var(--dim); font-size: 15px; }
.pfoot .wrap { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px 40px; }
.pfoot img { width: auto; height: 56px; margin-bottom: 16px; filter: brightness(1.3) contrast(1.05); }
.pfoot p + p { margin-top: 6px; }
.pfoot h2 { margin-bottom: 10px; font-size: 15px; font-weight: 600; color: var(--white); }
.pfoot a { color: inherit; text-decoration: none; }
.pfoot a:hover { color: var(--white); }
.pfoot .tel { color: var(--blue); font-weight: 600; }
.pfoot-legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; border-top: 1px solid rgb(255 255 255 / .08); font-size: 14px; }
.pfoot-legal nav { display: flex; flex-wrap: wrap; gap: 20px; }
@media (max-width: 760px) { .pfoot .wrap { grid-template-columns: 1fr; } }
.back-link { margin-bottom: 16px; }
.note { padding: 12px 16px; border-radius: 12px; background: var(--paper); font-size: var(--text-sm); }
.note b { font-weight: 600; }

/* ---------- New patient form (new-patient.html) ---------- */
.done-ico.warn { background: #fdf0c8; color: #6b5200; }
.done a:not(.btn) { color: var(--blue-2); font-weight: 600; }
.hello .req { color: #ffb4ab; }
.reg-note { margin-top: 20px; }
