/*
 * patient-look.css - The patient pages in the checkout's Evergreen type and shapes (round 6 look,
 * 2026-11-17; owner: "we want our patient dashboard to become delightful").
 *
 * The secure booking checkout and the "Set your password" screen (wiki/secure-booking-checkout.md)
 * set the look: Newsreader for headings, Geist for every other word, white fields with 8px
 * corners and an apricot focus ring, and forest buttons with 8px corners. This sheet carries that
 * look into the patient app: the patient shell (patient_shell.html: Payment / Intake / Session /
 * Report, Settings, Feedback & Questions and every window) and the intake pages
 * (atlas_evidence.html: Provide Details, the interviews, cards and questionnaires).
 *
 * Scope: everything here sits under `body.patient-app`, a class only those two templates put on
 * <body>. Clinician and admin pages load some of the same CSS (ui-components.css, ui-dialog.css,
 * pd-buttons.css) but never this file or that class, so they stay as they are.
 *
 * Load it last on the page, so its rules win over the shared ones at the same weight. Colours
 * come from colour-tokens.css (the checkout's values). Rules are by role (page title, card title,
 * window title, field, button), never by screen: a new screen built from the shared classes
 * (.ui-btn, .ui-input, .acp-card-title, UiDialog) gets the look with no extra CSS.
 */

/* ---- Fonts --------------------------------------------------------------------------------- */

/* Geist, self-hosted (app/static/fonts/geist, OFL), as on the checkout. Newsreader comes from
   Google Fonts (the template's <link>, opsz 6..72, weight 500). */
@font-face {
  font-family: 'Geist';
  src: url('/static/fonts/geist/geist-latin-400-normal.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('/static/fonts/geist/geist-latin-500-normal.woff') format('woff');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('/static/fonts/geist/geist-latin-600-normal.woff') format('woff');
  font-weight: 600;
  font-display: swap;
}

body.patient-app {
  /* The two faces. Every shared rule reads --font-ui; the intake reads its two --pd-font-*
     names (the "serif" one is its heading face, so it becomes Newsreader again). */
  --font-ui: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-heading: 'Newsreader', Georgia, 'Times New Roman', serif;
  --pd-font-sans: var(--font-ui);
  --pd-font-serif: var(--font-heading);
  /* Geist is loaded to 600: bold text takes 600 rather than a browser-thickened 700. */
  --fw-bold: 600;
  /* Shapes: the checkout's 8px corners on fields and buttons. */
  --ui-input-radius: 8px;
  --pl-radius: 8px;
  --pl-focus: var(--color-decor);
  font-family: var(--font-ui);
}

/* Rules that name Inter themselves (written before the font was a token). */
body.patient-app,
body.patient-app .atlas-root,
body.patient-app .atlas-modal-overlay,
body.patient-app .pd-boot-screen,
body.patient-app .pd-fullpage,
body.patient-app .pd-optout-modal,
body.patient-app .fbq-overlay,
body.patient-app .nps-card,
body.patient-app .nps-standalone {
  font-family: var(--font-ui);
}

/* Bold words (700 in older rules) at Geist's 600. */
body.patient-app :is(b, strong) {
  font-weight: 600;
}

/* ---- Headings: Newsreader 500, like the checkout's "Start your evaluation" ----------------- */

/* Page titles: the evaluation's name over the tabs, the intake step's title, the end screens. */
body.patient-app .ps-case-title,
body.patient-app .pd-section-card .pd-step-title,
body.patient-app .pd-complete-title,
body.patient-app .pd-entry-card .pd-complete-title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.005em;
}

/* Card titles ("Required from you", "Book your session"), headings inside a card, window titles. */
body.patient-app .acp-card-title,
body.patient-app .ui-subhead,
body.patient-app .ui-dialog-title,
body.patient-app .atlas-settings-title,
body.patient-app .shset-confirm-title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

/* The small "What to expect" card keeps its quieter title, one step down. */
body.patient-app .acp-session-expectations .acp-card-title {
  font-size: 19px;
}

@media (max-width: 760px) {
  body.patient-app .ps-case-title,
  body.patient-app .pd-section-card .pd-step-title,
  body.patient-app .pd-complete-title,
  body.patient-app .pd-entry-card .pd-complete-title {
    font-size: 28px;
  }
  body.patient-app .acp-card-title,
  body.patient-app .ui-subhead,
  body.patient-app .ui-dialog-title,
  body.patient-app .atlas-settings-title,
  body.patient-app .shset-confirm-title {
    font-size: 21px;
  }
}

/* ---- Fields: white, 8px corners, apricot focus ring ----------------------------------------- */

body.patient-app :is(.ui-input, .ui-dialog-input, .atlas-settings-input, .atlas-modal-input,
  .pd-name-input, .pd-inf-input, .ps-informant-input, .fux-field) {
  border: 1px solid var(--color-line);
  border-radius: var(--pl-radius);
  background-color: var(--color-card);
  color: var(--color-text);
  font-family: var(--font-ui);
}

body.patient-app :is(.ui-input, .ui-dialog-input, .atlas-settings-input, .atlas-modal-input,
  .pd-name-input, .pd-inf-input, .ps-informant-input, .fux-field):focus,
body.patient-app :is(.ui-input, .ui-dialog-input, .atlas-settings-input, .atlas-modal-input,
  .pd-name-input, .pd-inf-input, .ps-informant-input, .fux-field):focus-visible {
  border-color: var(--color-main);
  outline: 2px solid var(--pl-focus);
  outline-offset: 2px;
  box-shadow: none;
}

/* A field the check marked wrong keeps its red border while it has focus. */
body.patient-app :is(.ui-input, .ui-dialog-input, .atlas-settings-input)[aria-invalid="true"] {
  border-color: var(--ps-red, #b42318);
}

/* ---- Buttons: 8px corners; the main one forest ------------------------------------------- */

/* Every shared text button (main, secondary, tool, danger) takes the checkout's corner, so a
   main button never sits beside a round one. Round icon-only buttons stay round. The main
   button's forest fill already comes from colour-tokens.css (--color-main) through the shared
   classes, so no colour is set here. */
body.patient-app :is(.ui-btn, .pd-btn, .ui-dialog-btn, .acp-cta.ui-btn) {
  border-radius: var(--pl-radius);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

body.patient-app :is(.ui-btn, .pd-btn, .ui-dialog-btn):focus-visible {
  outline: 2px solid var(--pl-focus);
  outline-offset: 2px;
}

/* ---- Header: "Questions? Call/Text" and the number (shell-support-line.js) ------------------- */

body.patient-app .ps-header-help {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 1px;
  min-height: 44px;
  margin-right: 8px;
  padding: 0 4px;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.2;
}
body.patient-app .ps-header-help-icon {
  display: none;
}
body.patient-app .ps-header-help-lead {
  color: var(--color-muted);
  font-size: 12.5px;
}
body.patient-app .ps-header-help-num {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
body.patient-app .ps-header-help:hover .ps-header-help-num {
  text-decoration: underline;
}
body.patient-app .ps-header-help:focus-visible {
  outline: 2px solid var(--pl-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* On a phone the line folds to a phone icon over "Call/Text", the header buttons' own shape;
   the link's aria-label keeps the full line and the number. */
@media (max-width: 760px) {
  body.patient-app .ps-header-help {
    justify-items: center;
    gap: 2px;
    min-width: 56px;
    height: 48px;
    margin-right: 0;
    padding: 0 6px;
    border-radius: 10px;
    color: var(--ps-text-soft);
  }
  body.patient-app .ps-header-help-icon {
    display: block;
    font-size: var(--fs-16, 16px);
  }
  body.patient-app .ps-header-help-lead {
    color: inherit;
    font-size: var(--fs-12, 12px);
    font-weight: 600;
  }
  body.patient-app .ps-header-help-q,
  body.patient-app .ps-header-help-num {
    display: none;
  }
}

/* Under 480px four header buttons and the brand's word do not fit side by side: the brand
   keeps its mark (still the link home) and its name stays for screen readers. */
@media (max-width: 480px) {
  body.patient-app .ps-header .ps-header-brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
