/* ClaimRudder app look: the same calm healthcare system as claimrudder.com (site file: website/brand.css).
   Loaded LAST by index.html, signup.html, enroll.html and dev-checkout.html so its tokens and rules win.
   Fonts are served from this app (./fonts, SIL Open Font License), so no page asks a third party for anything. */
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-latin.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }

:root {
  --bg: #F7F6F2; --panel: #FFFFFF; --ink: #1C2834; --muted: #4B5866; --line: #E2E0D9; --soft: #EAF1FA;
  --brand: #015DAB; --brand-ink: #FFFFFF; --brand-2: #015DAB; --navy: #012443;
  --green: #17734A; --green-bg: #E8F5EC; --red: #B42318; --red-bg: #FDECEA;
  --orange: #A8470B; --orange-bg: #FDF1E7; --amber: #855000; --amber-bg: #FCF3DF; --gray-bg: #F0EFEA;
  --shadow: 0 1px 2px rgba(28, 40, 52, .05), 0 8px 24px -12px rgba(28, 40, 52, .14);
  --line-strong: #8F8B80;
  --ui: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --tap: 44px;
}
:root[data-theme="dark"] {
  --bg: #0E1620; --panel: #16212D; --ink: #E7EDF3; --muted: #A3B1BF; --line: #2A3847; --soft: #1C2B3D;
  --brand: #8DB8F2; --brand-ink: #0C1A2B; --brand-2: #8DB8F2; --navy: #B9D3F5;
  --green: #6FD3A0; --green-bg: #12291F; --red: #F98A80; --red-bg: #2E1716;
  --orange: #F3A76B; --orange-bg: #33200F; --amber: #F2BE62; --amber-bg: #2C2312; --gray-bg: #1F2A36;
  --shadow: none; --line-strong: #3A4B5D;
}

body { font-family: var(--ui); font-size: 17px; line-height: 1.55; background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
h1, h2, h3, h4, .brand, nav .brand { font-family: var(--display); letter-spacing: -0.01em; }
h1 { font-weight: 800; }
h2, h3, h4 { font-weight: 700; }
a { color: var(--brand); text-underline-offset: 3px; }
.muted { color: var(--muted); }

/* Buttons and fields: big enough for a thumb, one solid primary */
button { font: inherit; font-weight: 600; min-height: var(--tap); padding: 9px 18px; border-radius: 12px; border: 1.5px solid var(--line-strong);
  background: var(--panel); color: var(--ink); letter-spacing: 0; }
button:hover { border-color: var(--brand); background: var(--soft); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--brand); outline-offset: 2px; }
tr.click:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
button.primary { background: var(--brand); color: var(--brand-ink); border: 1.5px solid var(--brand); padding: 9px 20px; box-shadow: 0 1px 2px rgba(22, 63, 112, .25); }
button.primary:hover { background: var(--navy); border-color: var(--navy); filter: none; box-shadow: 0 1px 2px rgba(22, 63, 112, .25); }
:root[data-theme="dark"] button.primary:hover { background: #A9CBF6; border-color: #A9CBF6; }
button.cta { min-height: 0; border: 0; padding: 6px 0; background: none; }
button.cta:hover { background: none; }
button.chip { min-height: 40px; border-radius: 999px; padding: 6px 16px; font-size: 15px; }
input, select, textarea { font: inherit; font-size: 17px; min-height: var(--tap); padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--ink); }
input[type=checkbox], input[type=radio] { min-height: 0; width: 20px; height: 20px; accent-color: var(--brand); }
textarea { min-height: 120px; }
label { font-size: 16px; }

/* Pills and banners */
.pill { font-size: 14px; font-weight: 600; padding: 2px 10px; }
.tag { font-size: 14px; padding: 2px 10px; }
.banner, .err, .ok, .note, .devnote, .warnline { border-radius: 12px; padding: 12px 16px; line-height: 1.5; }
.banner a.btn.primary { background: var(--brand); color: var(--brand-ink); min-height: 40px; display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 10px; }

/* Cards, tiles, tables */
.card, .tile, .auth, .signup-cta, .user, .ask, .modal, .tour-pop, .toast { border-radius: 16px; border-color: var(--line); }
.card { padding: 20px; }
.card h3 { font-size: 18px; margin-bottom: 6px; }
.tile { padding: 18px 20px; }
.tile .v { font-family: var(--display); font-size: 30px; font-weight: 800; }
.wrap { border-radius: 14px; box-shadow: var(--shadow); }
table { font-size: 16px; }
th, td { padding: 12px 14px; }
th { font-size: 14px; text-transform: none; letter-spacing: 0; background: var(--gray-bg); }
tr.click:hover td { background: var(--soft); }
.empty { padding: 36px 20px; font-size: 17px; }
section h2 { font-size: 26px; margin-bottom: 6px; }
section > p.muted { max-width: 70ch; }
.price { font-family: var(--display); font-size: 22px; font-weight: 800; }
.minimum { border-radius: 14px; padding: 16px 20px; }
.choices button { min-height: 64px; font-size: 17px; border-radius: 14px; }
.choices button.on { background: var(--soft); border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
.steps .dot { width: 24px; height: 24px; }
.lin .n { width: 30px; height: 30px; font-size: 14px; }
.srcnote, .ask-box, .warnline, .src p, pre, .agreement, .terms { font-size: 15px; }
.secret, .code-real { font-family: ui-monospace, Consolas, monospace; }
.kv { grid-template-columns: 160px 1fr; }

/* App shell: calm sidebar with clear "you are here" */
#app { grid-template-columns: 248px 1fr; }
nav { padding: 18px 12px; gap: 2px; }
nav .brand { font-size: 20px; font-weight: 800; color: var(--navy); padding: 4px 12px 18px; display: flex; align-items: center; gap: 10px; }
nav a { padding: 10px 12px; border-radius: 10px; font-size: 16.5px; align-items: center; min-height: 44px; }
nav a:hover { background: var(--gray-bg); }
nav a.on { background: var(--soft); color: var(--navy); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand); }
nav .count { font-size: 13px; font-weight: 700; padding: 1px 9px; }
main { padding: 0 32px 56px; }
header { padding: 14px 0; gap: 10px 14px; }
#h-tenant { font-family: var(--display); font-size: 19px; }
header .who { gap: 8px 10px; font-size: 15px; }
header .who button { min-height: 40px; padding: 6px 14px; font-size: 15px; }

/* Sign-in screen */
#login h1 { font-size: 32px; }
.auth { padding: 26px; }
.auth button.big, .modal button.big { min-height: 50px; font-size: 17px; }
.signup-cta { border-top-width: 1px; }
.signup-cta a.btn { min-height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 16px; border: 1.5px solid var(--line-strong); }

/* Public pages (signup, enroll, checkout: common.css) */
.page { max-width: 620px; padding: 28px 16px 72px; }
.page > .brand { font-size: 22px; display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.page h1 { font-size: clamp(28px, 6vw, 34px); line-height: 1.15; margin-bottom: 10px; }
.page > p.muted { font-size: 17px; }
.page .card { padding: clamp(18px, 4vw, 28px); margin-top: 22px; }
.page label { margin: 18px 0 6px; font-size: 16px; }
.page input, .page select { min-height: 48px; }
.page button.primary { min-height: 52px; font-size: 18px; padding: 12px 24px; }
label.choice { padding: 14px 16px; border-radius: 14px; border-width: 1.5px; }
label.choice:has(input:checked) { background: var(--soft); }
.plan { border-radius: 12px; padding: 14px 16px; }
details.doc { border-radius: 12px; padding: 12px 14px; }

/* Phones: tables marked .stack become cards; the first row (headings) hides and each cell shows its own label */
@media (max-width: 760px) {
  body { font-size: 17px; }
  #app { grid-template-columns: 1fr; }
  nav { padding: 10px 14px; position: sticky; top: 0; z-index: 15; background: var(--panel); }
  nav .brand { padding: 4px 0; font-size: 18px; }
  #nav-toggle { min-height: 44px; }
  nav .links { gap: 2px; padding-bottom: 6px; }
  nav a { font-size: 17px; }
  main { padding: 0 16px 48px; }
  header { padding: 12px 0; }
  header .who { width: 100%; }
  section h2 { font-size: 24px; }
  .bar select { flex: 1 1 100%; width: 100%; max-width: 100%; min-width: 0; }
  nav.open .links { max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; }
  header .who { gap: 6px 8px; font-size: 14.5px; }
  header .who button { min-height: 40px; padding: 4px 12px; font-size: 14.5px; }
  header .who .pill { font-size: 13px; }
  .page button.primary { width: 100%; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  .wrap:has(table.stack) { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.stack tr:first-child:has(th) { display: none; }
  table.stack tbody { display: grid; gap: 10px; }
  table.stack tr { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px 16px; }
  table.stack td { border-bottom: 1px solid var(--line); padding: 10px 0; text-align: left; }
  table.stack td:last-child { border-bottom: 0; }
  table.stack td.empty { text-align: center; }
  table.stack td[data-label] { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 15px; font-weight: 500; flex: none; }
  table.stack td[data-label] > * { text-align: right; }
  table.stack td.lead { font-weight: 700; font-size: 17px; }
  table.stack td:empty { display: none; }
  tr.click:hover td { background: transparent; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
input[type=file] { width: 100%; max-width: 100%; padding: 8px; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; color: var(--ink); background: var(--soft); border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 8px 14px; margin-right: 12px; cursor: pointer; }

/* Logo (from the brand sheet). The dark theme swaps in the white-text version. */
.logo { display: block; height: 36px; width: auto; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.login-logo { margin-bottom: 18px; }
.login-logo .logo { height: 44px; }
.page > .brand .logo { height: 40px; }
@media (max-width: 760px) { nav .brand .logo { height: 30px; } .page > .brand .logo { height: 34px; } }
