/* AskSathi caretaker secondary pages — v4.5 (D-193, D-197; PRD §6 S21, §10).
   Sign in / register / magic sign-in, Plan & Billing and Documents & guides on
   the same --ct-* tokens as the caretaker app (XIV.1): glass top bar (control
   layer only), solid content, 17 px body, ≥ 48 px controls, AA contrast.
   Scoped to body.ct-page so the shared login.css keeps serving the supervisor
   and operator sign-in pages unchanged. */

*, *::before, *::after { box-sizing: border-box; }
html body.ct-page {
  margin: 0; min-height: 100vh; background: var(--ct-paper); color: var(--ct-ink);
  font: var(--ct-fs-body)/1.5 var(--ct-font); -webkit-font-smoothing: antialiased;
}
/* Reset the shared element rules (tokens.css / login.css) inside these pages. */
html body.ct-page :is(button, input, select, textarea) { font: inherit; color: inherit; }
html body.ct-page :is(h1, h2, h3) { color: inherit; }
body.ct-page a { color: var(--ct-sage-deep); }
body.ct-page :focus-visible { outline: 3px solid var(--ct-focus); outline-offset: 2px; border-radius: 8px; }
body.ct-page [hidden] { display: none !important; }

/* decorative wash behind the top, as on Today */
body.ct-page::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 320px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 90% at 10% 0%, var(--ct-wash-sage) 0%, transparent 72%),
    radial-gradient(90% 70% at 100% 0%, var(--ct-wash-clay) 0%, transparent 70%);
}

/* ---------- glass top bar: wordmark + one link ---------- */
html body.ct-page header.site {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--ct-space-3);
  min-height: 64px; padding: var(--ct-space-2) var(--ct-gutter); margin: 0;
  background: var(--ct-glass); -webkit-backdrop-filter: var(--ct-blur); backdrop-filter: var(--ct-blur);
  border-bottom: 1px solid var(--ct-sep); box-shadow: none; color: var(--ct-ink);
}
html body.ct-page header.site h1 {
  flex: 1; margin: 0; font: 600 var(--ct-fs-xl)/1.2 var(--ct-font-brand); color: var(--ct-ink); letter-spacing: 0;
}
html body.ct-page header.site nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--ct-space-2);
  font-weight: 600; font-size: var(--ct-fs-body); color: var(--ct-sage-deep); text-decoration: none; background: none;
}
html body.ct-page header.site nav a:hover { text-decoration: underline; background: none; }

/* ---------- page column ---------- */
html body.ct-page main {
  position: relative; z-index: 1; max-width: 560px; margin: 0 auto;
  padding: var(--ct-space-7) var(--ct-gutter) var(--ct-space-8); background: none; box-shadow: none;
}
html body.ct-page.ct-wide main { max-width: 820px; }
.ct-eyebrow {
  margin: 0 0 var(--ct-space-1); font-size: var(--ct-fs-label); font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ct-ink-3);
}

/* ---------- auth pages (S21): no card chrome — the page IS the form ---------- */
html body.ct-auth .card {
  background: none; border: 0; box-shadow: none; padding: 0; margin: 0; max-width: none; border-radius: 0; text-align: left;
}
html body.ct-auth .card :is(h2, p, .lead) { text-align: left; }
html body.ct-auth .card h2 {
  margin: 0 0 var(--ct-space-2); font: 800 var(--ct-fs-title)/1.12 var(--ct-font); letter-spacing: -0.02em; color: var(--ct-ink);
}
html body.ct-auth .card p, html body.ct-auth .lead {
  margin: 0 0 var(--ct-space-5); font-size: var(--ct-fs-body); line-height: 1.5; color: var(--ct-ink-2);
}
html body.ct-auth label {
  display: block; margin: var(--ct-space-4) var(--ct-space-1) var(--ct-space-2); font-size: var(--ct-fs-label);
  font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ct-ink-3);
}
html body.ct-auth input {
  display: block; width: 100%; min-height: 52px; padding: 0 var(--ct-space-4); margin: 0;
  font-size: var(--ct-fs-body); color: var(--ct-ink); background: var(--ct-surface);
  border: 1px solid var(--ct-sep); border-radius: var(--ct-r-ctl); box-shadow: none;
}
html body.ct-auth input:focus { outline: 3px solid var(--ct-focus); outline-offset: 1px; border-color: var(--ct-sage); }
html body.ct-auth form button, html body.ct-auth a.button, html body.ct-auth .button {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--ct-tap);
  margin: var(--ct-space-5) 0 0; padding: 0 var(--ct-space-5); border: 0; border-radius: var(--ct-r-ctl);
  font-size: var(--ct-fs-body); font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--ct-sage-deep); color: var(--ct-on-accent); box-shadow: none;
}
html body.ct-auth form button:hover, html body.ct-auth .button:hover { background: var(--ct-sage); color: var(--ct-on-accent); }
html body.ct-auth form button[disabled] { opacity: 0.6; cursor: not-allowed; }
html body.ct-auth .secondary-link {
  display: flex; align-items: center; justify-content: center; min-height: var(--ct-tap); margin: var(--ct-space-2) 0 0;
  font-size: var(--ct-fs-body); font-weight: 600; color: var(--ct-sage-deep); text-decoration: none; background: none;
}
html body.ct-auth :is(#login-status, #register-status, #signin-status) {
  margin: var(--ct-space-3) var(--ct-space-1) 0; font-size: var(--ct-fs-small); color: var(--ct-alert-ink);
}
html body.ct-auth #waitlist-line { margin: var(--ct-space-6) var(--ct-space-1) 0; font-size: var(--ct-fs-small); color: var(--ct-ink-2); }
html body.ct-auth .card p a:not(.button) { color: var(--ct-sage-deep); text-decoration: underline; }

/* honest status banners: the alert-card style (warn = amber, info = sage) */
html body.ct-page .banner {
  margin: 0 0 var(--ct-space-4); padding: var(--ct-space-3) var(--ct-space-4); border-radius: var(--ct-r-ctl);
  font-size: var(--ct-fs-small); line-height: 1.5; border: 0; border-left: 4px solid var(--ct-sage);
  background: var(--ct-sage-tint); color: var(--ct-ink);
}
html body.ct-page .banner.warn { border-left-color: var(--ct-scam); background: var(--ct-scam-bg); color: var(--ct-ink); }
html body.ct-page .banner.info { border-left-color: var(--ct-sage); background: var(--ct-sage-tint); color: var(--ct-ink); }
html body.ct-page .banner strong { color: var(--ct-ink); }

/* first-time steps (managed sign-in) as a grouped list */
html body.ct-page .firsttime {
  margin: var(--ct-space-6) 0 0; padding: var(--ct-space-4); background: var(--ct-surface);
  border: 0; border-radius: var(--ct-r-card); box-shadow: var(--ct-shadow-card);
}
html body.ct-page .firsttime h3 { margin: 0 0 var(--ct-space-2); font-size: var(--ct-fs-lg); font-weight: 700; color: var(--ct-ink); }
html body.ct-page .steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
html body.ct-page .steps li {
  position: relative; margin: 0; padding: var(--ct-space-3) 0 var(--ct-space-3) 40px; border-bottom: 1px solid var(--ct-sep);
  font-size: var(--ct-fs-small); line-height: 1.5; color: var(--ct-ink-2);
}
html body.ct-page .steps li:last-child { border-bottom: 0; }
html body.ct-page .steps li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: var(--ct-space-3);
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: var(--ct-fs-label); font-weight: 800; background: var(--ct-sage-tint); color: var(--ct-sage-deep);
}
html body.ct-page .steps em { font-style: normal; font-weight: 700; color: var(--ct-ink); }

/* ---------- content cards (Documents, Plan & Billing) ---------- */
html body.ct-page .page-title {
  margin: 0 0 var(--ct-space-2); font: 800 var(--ct-fs-title)/1.12 var(--ct-font); letter-spacing: -0.02em; color: var(--ct-ink);
}
html body.ct-page .sub { margin: 0 0 var(--ct-space-5); font-size: var(--ct-fs-body); line-height: 1.5; color: var(--ct-ink-2); }
html body.ct-docs .card, html body.ct-page .bcard {
  margin: 0 0 var(--ct-space-4); padding: var(--ct-space-5); background: var(--ct-surface); color: var(--ct-ink);
  border: 0; border-radius: var(--ct-r-card); box-shadow: var(--ct-shadow-card); max-width: none;
}
html body.ct-docs .card h2, html body.ct-page .bcard h2 {
  margin: 0 0 var(--ct-space-3); font: 700 var(--ct-fs-h2)/1.25 var(--ct-font); color: var(--ct-ink);
}
html body.ct-docs .card :is(p, li) { font-size: var(--ct-fs-body); line-height: 1.55; color: var(--ct-ink-2); }
html body.ct-docs .card :is(ol, ul) { margin: 0; padding-left: var(--ct-space-5); }
html body.ct-docs .card li { margin: 0 0 var(--ct-space-3); }
html body.ct-docs .card strong { color: var(--ct-ink); }
html body.ct-page footer.site {
  position: relative; z-index: 1; max-width: 820px; margin: 0 auto; padding: var(--ct-space-4) var(--ct-gutter) var(--ct-space-7);
  background: none; border: 0; color: var(--ct-ink-2); font-size: var(--ct-fs-small); text-align: center;
}
html body.ct-page footer.site a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--ct-space-1); }

/* ---------- Plan & Billing ---------- */
.pill {
  display: inline-block; border-radius: var(--ct-r-pill); padding: var(--ct-space-1) var(--ct-space-3);
  font-size: var(--ct-fs-label); font-weight: 700; background: var(--ct-sage-tint); color: var(--ct-sage-deep);
}
.pill.free { background: var(--ct-sun-bg); color: var(--ct-scam); }
.pill.suspended { background: var(--ct-alert-bg); color: var(--ct-alert-ink); }
.founding {
  margin: 0 0 var(--ct-space-4); padding: var(--ct-space-4); border-radius: var(--ct-r-card);
  background: var(--ct-note-bg); border-left: 4px solid var(--ct-clay); font-size: var(--ct-fs-small); line-height: 1.55; color: var(--ct-ink);
}
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--ct-space-3); margin-top: var(--ct-space-2); }
.tier { border: 1px solid var(--ct-sep); border-radius: var(--ct-r-ctl); padding: var(--ct-space-4); background: var(--ct-surface); }
.tier.current { border: 2px solid var(--ct-sage); background: var(--ct-list-bg); }
.tier h3 { margin: 0 0 var(--ct-space-2); font: 700 var(--ct-fs-lg)/1.3 var(--ct-font); color: var(--ct-ink); }
.tier ul { margin: var(--ct-space-2) 0 0; padding-left: var(--ct-space-5); font-size: var(--ct-fs-small); line-height: 1.6; color: var(--ct-ink-2); }
.tier .safe { margin: var(--ct-space-2) 0 0; font-size: var(--ct-fs-label); color: var(--ct-ok); }
.choose { display: flex; flex-wrap: wrap; gap: var(--ct-space-3); align-items: center; margin: var(--ct-space-3) 0 var(--ct-space-2); }
.choose label { font-size: var(--ct-fs-label); font-weight: 700; color: var(--ct-ink-3); }
html body.ct-page select.big {
  min-height: var(--ct-tap); padding: 0 var(--ct-space-3); font-size: var(--ct-fs-body); color: var(--ct-ink);
  border: 1px solid var(--ct-sep); border-radius: var(--ct-r-ctl); background: var(--ct-surface);
}
html body.ct-page .btn {
  min-height: var(--ct-tap); padding: 0 var(--ct-space-5); border: 0; border-radius: var(--ct-r-ctl);
  font-size: var(--ct-fs-body); font-weight: 700; cursor: pointer;
}
html body.ct-page .btn.solid { background: var(--ct-sage-deep); color: var(--ct-on-accent); }
html body.ct-page .btn.solid[disabled] { opacity: 0.6; cursor: not-allowed; }
html body.ct-page .btn.ghost { background: var(--ct-surface); border: 1px solid var(--ct-sep); color: var(--ct-ink); }
.honest { margin: var(--ct-space-3) 0 0; font-size: var(--ct-fs-small); line-height: 1.55; color: var(--ct-ink-2); }
.legal ul { margin: 0; padding-left: var(--ct-space-5); font-size: var(--ct-fs-body); line-height: 1.6; color: var(--ct-ink-2); }
.legal li { margin: var(--ct-space-2) 0; }
.status { min-height: 1.4em; margin-top: var(--ct-space-3); font-size: var(--ct-fs-small); color: var(--ct-ink-2); }
.toast {
  position: fixed; left: 50%; bottom: var(--ct-space-6); transform: translateX(-50%); z-index: 80; display: none;
  padding: var(--ct-space-3) var(--ct-space-4); border-radius: var(--ct-r-pill);
  background: var(--ct-ink); color: var(--ct-on-accent); font-size: var(--ct-fs-small); box-shadow: var(--ct-shadow-float);
}
.ct-m0 { margin: 0; }
.ct-mb-2 { margin: 0 0 var(--ct-space-2); }

@media (prefers-reduced-transparency: reduce) {
  html body.ct-page header.site { background: var(--ct-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html body.ct-page header.site { background: var(--ct-surface); }
}
