/* Ported from the calfresh_interview_trainer.html prototype's inline <style> block,
   split out as part of the frontend/backend rewrite (ADR-0004). Login-screen and
   budget-banner rules are new; everything else is carried over unchanged.
   Re-themed to USWDS (U.S. Web Design System) tokens/components — worker-facing tool,
   not a public-facing .gov site, so no official banner, but same visual register:
   Public Sans, USWDS primary blue, square/minimal-radius components, high-contrast
   focus states. See devops/architecture for the ADR recording this decision. */
:root {
  --bg: #f0f0f0; --surface: #ffffff; --surface2: #f0f0f0;
  --border: #dfe1e2; --text: #1b1b1b; --text2: #5c5c5c; --text3: #a9aeb1;
  --accent: #005ea2; --accent-dark: #1a4480; --accent-darker: #162e51;
  --accent-light: #d9e8f6; --accent-lightest: #f0f6fb; --accent-text: #1a4480;
  --warn: #936f38; --warn-border: #ffbe2e; --warn-bg: #faf3d1;
  --danger: #b50909; --danger-bg: #f4e3e3;
  --info: #00495a; --info-border: #00bde3; --info-bg: #e7f6f8;
  --success: #00a91c; --success-bg: #ecf3ec; --success-text: #04361e;
  --radius: 0; --radius-lg: 0; --radius-chat: 4px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Public Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 15px; }

/* USWDS-style high-contrast focus ring — matches the web-design-guidelines
   accessibility rules already adopted for this project. */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 0.25rem solid #2491ff; outline-offset: 0.25rem;
}

.app-header { background: var(--accent-darker); width: 100%; }
.app-header-inner { max-width: 780px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 18px 20px; }
.app-shell { max-width: 780px; margin: 0 auto; padding: 0 20px 60px; }
.header-badge { background: var(--surface); color: var(--accent-darker); font-size: 11px; font-weight: 700; padding: 4px 10px; letter-spacing: 0.06em; }
.header-title { font-size: 15px; font-weight: 600; color: var(--surface); }
.header-right { font-size: 13px; color: var(--border); margin-left: auto; }
.screen { display: none; }
.screen.active { display: block; }

.select-heading { font-size: 22px; font-weight: 700; margin: 28px 0 6px; }
.select-sub { font-size: 14px; color: var(--text2); margin-bottom: 24px; line-height: 1.6; }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 12px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.profile-card:hover { border-color: var(--accent); }
.profile-card.selected { border: 2px solid var(--accent); background: var(--accent-lightest); padding: 17px 19px; }
.pc-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.av-blue { background: var(--accent-light); color: var(--accent-darker); }
.av-amber { background: var(--warn-bg); color: var(--warn); }
.av-green { background: var(--success-bg); color: var(--success-text); }
.pc-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.pc-meta { font-size: 13px; color: var(--text2); }
.pc-badges { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 0.03em; padding: 3px 8px; border-radius: var(--radius); }
.b-green { background: var(--success-bg); color: var(--success-text); }
.b-amber { background: var(--warn-bg); color: var(--warn); }
.b-red { background: var(--danger-bg); color: var(--danger); }
.b-blue { background: var(--accent-light); color: var(--accent-darker); }
.pc-divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.pc-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 12px; }
.pc-detail-label { font-size: 12px; color: var(--text2); margin-bottom: 2px; }
.pc-detail-value { font-size: 13px; font-weight: 600; color: var(--text); }
.pc-focus { background: var(--surface2); border-radius: var(--radius); padding: 10px 13px; font-size: 13px; color: var(--text2); line-height: 1.6; }
.pc-focus strong { color: var(--text); }
.start-btn { width: 100%; margin-top: 8px; background: var(--accent); color: var(--surface); border: none; border-radius: var(--radius); padding: 14px 20px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.start-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.start-btn:not(:disabled):hover { background: var(--accent-dark); }

.int-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 28px 0 20px; flex-wrap: wrap; }
.int-title { font-size: 20px; font-weight: 700; margin-bottom: 3px; }
.int-sub { font-size: 13px; color: var(--text2); }
.btn-ghost { background: var(--surface); border: 1px solid #565c65; border-radius: var(--radius); padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap; transition: border-color 0.15s, background 0.15s; }
.btn-ghost:hover { background: var(--surface2); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }

.tab-bar { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 18px; }
.tab { font-size: 13px; font-weight: 600; padding: 10px 18px; border: none; background: none; color: var(--text2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color 0.15s; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover:not(.active) { color: var(--text); }

.chat-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.chat-messages { height: 360px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface2); }
.msg { max-width: 78%; padding: 10px 14px; border-radius: var(--radius-chat); font-size: 14px; line-height: 1.55; }
.msg.worker { align-self: flex-end; background: var(--accent); color: var(--surface); }
.msg.client { align-self: flex-start; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.msg.sysmsg { align-self: center; max-width: 90%; background: var(--warn-bg); color: var(--warn); font-size: 12px; padding: 5px 12px; text-align: center; }
.msg.thinking { align-self: flex-start; background: var(--surface); color: var(--text3); border: 1px solid var(--border); font-style: italic; font-size: 13px; }
.chat-input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-input-row textarea { flex: 1; resize: none; height: 64px; font-family: inherit; font-size: 14px; border: 1px solid #565c65; border-radius: var(--radius); padding: 9px 12px; color: var(--text); background: var(--surface); outline-offset: 0; line-height: 1.5; }
.chat-input-row textarea:focus { border-color: var(--accent); }
.btn-send { width: 74px; height: 64px; flex-shrink: 0; background: var(--accent); color: var(--surface); border: none; border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-send:not(:disabled):hover { background: var(--accent-dark); }
.chat-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.alerts-area { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.alert-box { border-radius: var(--radius); padding: 11px 14px 11px 16px; font-size: 13px; line-height: 1.65; display: flex; gap: 10px; align-items: flex-start; animation: slideIn 0.2s ease; border-left: 4px solid transparent; }
@keyframes slideIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.alert-immediate { background: var(--danger-bg); border-left-color: var(--danger); color: var(--danger); }
.alert-early     { background: var(--warn-bg);   border-left-color: var(--warn-border); color: var(--warn); }
.alert-post-expedited { background: var(--info-bg); border-left-color: var(--info-border); color: var(--info); }
.alert-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-title { font-weight: 700; margin-bottom: 3px; }
.alert-msg { white-space: pre-line; }
.alert-dismiss { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 16px; color: inherit; opacity: 0.5; padding: 0 0 0 8px; flex-shrink: 0; line-height: 1; }
.alert-dismiss:hover { opacity: 1; }

.hint-box { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; color: var(--warn); line-height: 1.65; margin-top: 10px; display: none; }
.suggest-box { background: var(--info-bg); border: 1px solid var(--info-border); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; color: var(--info); line-height: 1.65; margin-top: 10px; display: none; white-space: pre-wrap; }

.checklist-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.checklist-header { padding: 11px 16px; background: var(--surface2); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text2); letter-spacing: 0.05em; text-transform: uppercase; }
.checklist-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; font-size: 14px; color: var(--text2); user-select: none; }
.checklist-item:last-child { border-bottom: none; }
.checklist-item:hover { background: var(--surface2); }
.checklist-item.done { color: var(--accent); }
.check-circle { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.checklist-note { padding: 10px 16px; font-size: 12px; color: var(--text3); background: var(--surface2); border-top: 1px solid var(--border); }

.profile-file-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.pf-header { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.pf-details { padding: 0 18px; }
.pf-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; gap: 12px; }
.pf-row:last-child { border-bottom: none; }
.pf-row-label { color: var(--text2); flex-shrink: 0; }
.pf-row-value { font-weight: 600; text-align: right; }
.pf-focus { margin: 14px 18px; background: var(--accent-lightest); border-radius: var(--radius); padding: 10px 13px; font-size: 13px; color: var(--accent-text); line-height: 1.6; }
.supervisor-note { padding: 10px 18px 14px; font-size: 12px; color: var(--text3); }
.no-access-note { padding: 24px 18px; font-size: 13px; color: var(--text2); text-align: center; }

.debrief-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; }
.debrief-text { font-size: 14px; line-height: 1.9; color: var(--text); white-space: pre-wrap; }
.debrief-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.feedback-box { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 18px; }
.feedback-box label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.feedback-box textarea { width: 100%; height: 70px; font-family: inherit; font-size: 14px; border: 1px solid #565c65; border-radius: var(--radius); padding: 9px 12px; resize: vertical; }
.feedback-box .btn-ghost { margin-top: 8px; }

/* Team Performance screen (supervisor-only) */
.team-worker-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 16px; overflow: hidden; }
.twc-header { padding: 14px 18px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.twc-email { font-size: 15px; font-weight: 700; }
.twc-role-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--info); background: var(--info-bg); padding: 2px 7px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.twc-stats { font-size: 12px; color: var(--text2); margin-top: 3px; }
.twc-sessions { padding: 4px 18px; }
.team-session-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.team-session-row:last-child { border-bottom: none; }
.tsr-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tsr-profile { font-size: 14px; font-weight: 600; }
.tsr-status { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; }
.tsr-meta { font-size: 12px; color: var(--text2); margin-top: 4px; }
.tsr-debrief { font-size: 13px; color: var(--text); line-height: 1.6; white-space: pre-wrap; margin-top: 8px; background: var(--surface2); border-radius: var(--radius); padding: 10px 12px; }
.team-empty-note { padding: 16px 18px; font-size: 13px; color: var(--text2); }

/* Login screen (new — the prototype had no auth at all) */
.login-card { max-width: 360px; margin: 60px auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 26px; }
.login-card h1 { font-size: 18px; margin-bottom: 18px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
.login-card input { width: 100%; font-size: 14px; padding: 9px 12px; border: 1px solid #565c65; border-radius: var(--radius); }
.login-card .start-btn { margin-top: 18px; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; }
.login-hint { font-size: 12px; color: var(--text3); margin-top: 14px; line-height: 1.5; }
