/* Shared portal + landing styles. Tokens mirror the scribe (index.html) so the
 * marketing site, portal, and app feel like one product. */
:root {
  --bg: #f5f7fa; --card: #ffffff; --line: #e5e9f0; --ink: #0f172a;
  --muted: #64748b; --accent: #0d9488; --accent-d: #0f766e;
  /* Blue — the second brand color, paired with the green accent. */
  --accent-2: #2563eb; --accent-2-d: #1d4ed8;
  --brand-grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --danger: #dc2626; --ok: #16a34a; --warn: #b45309;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-lg: 0 10px 30px rgba(15,23,42,.12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55;
}
a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; cursor: pointer; border: none; border-radius: 10px;
  padding: 12px 22px; background: var(--accent); color: #fff;
}
.btn:hover { background: var(--accent-d); }
.btn.lg { padding: 15px 30px; font-size: 17px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
a.btn, a.btn:hover, a.btn:visited { color: #fff; text-decoration: none; }
a.btn.ghost, a.btn.ghost:hover { color: var(--ink); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.brand .tag { color: var(--muted); font-weight: 600; font-size: 12px; }

/* Top nav (landing) */
.nav {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 22px;
}
.nav .links { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.nav .links a { color: var(--muted); font-weight: 600; font-size: 14px; }
.nav .links a:hover { color: var(--ink); text-decoration: none; }

/* Layout helpers */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 22px; }
.section { padding: 72px 0; }
.section h2 { font-size: 30px; margin: 0 0 10px; }
.section .lede { color: var(--muted); font-size: 17px; max-width: 640px; margin: 0 0 36px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 800; color: var(--accent-d); margin: 0 0 10px; }

/* Hero */
.hero { background: linear-gradient(160deg, #ecfeff 0%, #f5f7fa 55%, #fff 100%); border-bottom: 1px solid var(--line); }
.hero-inner { max-width: 1100px; margin: 0 auto; padding: 88px 22px 80px; text-align: center; }
.hero h1 { font-size: 52px; margin: 0 0 18px; letter-spacing: -.02em; }
.hero h1 .grad { background: linear-gradient(90deg, var(--accent), #2563eb); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { font-size: 20px; color: var(--muted); max-width: 680px; margin: 0 auto 30px; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .trust { margin-top: 22px; color: var(--muted); font-size: 13px; }

/* Feature cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; box-shadow: var(--shadow);
}
.feature .ico { width: 40px; height: 40px; border-radius: 10px; background: #ccfbf1; color: var(--accent-d); display: grid; place-items: center; font-size: 20px; margin-bottom: 12px; }
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

/* Slide deck (horizontal scroll-snap) */
.deck { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 22px 24px; scrollbar-width: thin; }
.deck::-webkit-scrollbar { height: 8px; }
.deck::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.slide {
  scroll-snap-align: center; flex: 0 0 min(560px, 86vw); min-height: 280px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 30px; box-shadow: var(--shadow-lg);
}
.slide .num { font-size: 13px; font-weight: 800; color: var(--accent-d); letter-spacing: .08em; }
.slide h3 { font-size: 24px; margin: 8px 0 12px; }
.slide p { color: var(--muted); font-size: 16px; margin: 0 0 10px; }
.slide ul { margin: 0; padding-left: 20px; color: var(--muted); }
.slide ul li { margin: 6px 0; }
.deck-hint { color: var(--muted); font-size: 13px; padding: 0 22px; }

/* Pricing */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.tier { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tier.featured { border-color: var(--accent); box-shadow: var(--shadow-lg); position: relative; }
.tier.featured::before { content: "Most popular"; position: absolute; top: -11px; left: 26px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 99px; letter-spacing: .04em; }
.tier h3 { margin: 0 0 4px; font-size: 18px; }
.tier .price { font-size: 38px; font-weight: 800; margin: 8px 0 2px; }
.tier .price small { font-size: 14px; font-weight: 600; color: var(--muted); }
.tier .note { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.tier ul { list-style: none; margin: 0 0 22px; padding: 0; }
.tier li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.tier li::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.tier .btn { margin-top: auto; }

/* Footer */
.foot { border-top: 1px solid var(--line); background: #fff; }
.foot-inner { max-width: 1100px; margin: 0 auto; padding: 30px 22px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; }
.foot-inner .links { margin-left: auto; display: flex; gap: 18px; }
.disclaimer { color: var(--muted); font-size: 12px; max-width: 760px; }

/* --- Portal (auth + onboarding + dashboard) ----------------------------- */
.portal-bg { min-height: 100vh; display: flex; flex-direction: column; }
.portal-top { border-bottom: 1px solid var(--line); background: #fff; }
.portal-top .wrap { display: flex; align-items: center; gap: 16px; padding: 14px 22px; }
.portal-top .links { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: 14px; }

.auth-card {
  width: 100%; max-width: 420px; margin: 7vh auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 30px; box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 24px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.swap { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.formerr { color: var(--danger); font-size: 13px; margin-top: 4px; min-height: 18px; }

/* Cards used by onboarding + dashboard */
.panel { max-width: 720px; margin: 6vh auto; padding: 0 22px; }
.card2 { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card2 h2 { font-size: 20px; margin: 0 0 4px; }
.card2 .muted { color: var(--muted); font-size: 14px; }
.steps { display: flex; gap: 8px; margin-bottom: 20px; }
.steps .dot { flex: 1; height: 6px; border-radius: 99px; background: var(--line); }
.steps .dot.on { background: var(--accent); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 4px; }
.choice button {
  font: inherit; text-align: left; padding: 16px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; cursor: pointer;
}
.choice button.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice button b { display: block; font-size: 15px; }
.choice button span { color: var(--muted); font-size: 13px; }

.statline { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 0; }
.led { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; flex: none; }
.led.on { background: var(--ok); }
.led.warn { background: var(--warn); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 5px 11px; border-radius: 99px; background: #ccfbf1; color: var(--accent-d); }
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* --- Shared app bar (tool pages: scribe / denial / EHR) ------------------ */
/* Consistent header: green→blue home button + in-page back/forward, then a
 * page title and a page-specific right slot. Green + blue + white throughout. */
.appbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; background: var(--card);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 30;
}
.nav-cluster { display: flex; align-items: center; gap: 6px; }
.nav-btn {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); font-size: 17px; line-height: 1; cursor: pointer;
  text-decoration: none; transition: background .12s, border-color .12s, color .12s;
}
.nav-btn:hover { background: var(--bg); border-color: var(--accent); color: var(--accent-d); text-decoration: none; }
.nav-btn:disabled { opacity: .38; cursor: default; }
.nav-btn:disabled:hover { background: #fff; border-color: var(--line); color: var(--ink); }
.nav-btn.nav-home { background: var(--brand-grad); border: none; color: #fff; font-size: 18px; }
.nav-btn.nav-home:hover { filter: brightness(1.06); color: #fff; }
.appbar-title { font-weight: 800; font-size: 16px; white-space: nowrap; }
.appbar-title .sub { color: var(--muted); font-weight: 600; font-size: 13px; margin-left: 4px; }
.appbar-spacer { flex: 1; }
.appbar-right { display: flex; align-items: center; gap: 10px; }
.appbar-right a { font-size: 13px; color: var(--muted); font-weight: 600; }
.appbar-right a:hover { color: var(--ink); text-decoration: none; }

/* Responsive */
@media (max-width: 820px) {
  .grid, .tiers { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .hero-inner { padding: 60px 20px 54px; }
  .hero h1 { font-size: 38px; }
  .hero p.sub { font-size: 17px; }
  .section h2 { font-size: 26px; }
  .section .lede { font-size: 16px; margin-bottom: 28px; }
  .nav .links { gap: 14px; }
  .nav .links a.nav-sec { display: none; }   /* hide in-page section anchors, keep Sign in + trial */
  .foot-inner .links { margin-left: 0; flex-wrap: wrap; }
  .choice { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .brand .tag { display: none; }
  .hero-inner { padding: 44px 18px 42px; }
  .hero h1 { font-size: 29px; }
  .hero p.sub { font-size: 15px; }
  .hero .cta-row { flex-direction: column; }
  .hero .cta-row .btn { width: 100%; }
  .btn.lg { padding: 13px 22px; font-size: 16px; }
  .section { padding: 42px 0; }
  .section h2 { font-size: 22px; }
  .slide { padding: 24px; }
  .slide h3 { font-size: 20px; }
  .tier .price { font-size: 32px; }
  .nav .links a:not(.btn) { display: none; }   /* tightest phones: only the trial button */
}
