/* My Case Assistant — white/blue/gold theme (matches the Humanize Family Court System), mobile-first. */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel2: #f2f6fb;
  --line: #d8e0ea;
  --gold: #e8b84a;
  --gold-dark: #a97e12;
  --blue: #4682dc;
  --navy: #16324f;
  --ink: #1c2b3a;
  --white: #ffffff;
  --grey: #5b6b7c;
  --red: #c0392b;
  --green: #2e7d32;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--blue); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 16px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
label { display: block; font-size: 13px; color: var(--grey); margin: 12px 0 4px; }

/* ---------- layout ---------- */
#app { display: flex; min-height: 100vh; }
#sidebar {
  width: 248px; flex: 0 0 248px; background: var(--white);
  border-right: 1px solid var(--line); padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
#sidebar .brand {
  font-size: 22px; font-weight: 800; color: var(--white); line-height: 1.15;
  background: var(--navy); border-radius: var(--radius); padding: 12px 14px;
}
#sidebar .brand small { display: block; font-size: 12px; font-weight: 400; color: var(--gold); margin-top: 2px; }
#sidebar nav { margin-top: 22px; display: flex; flex-direction: column; gap: 2px; }
#sidebar nav button {
  text-align: left; background: none; border: none; color: var(--ink);
  padding: 11px 12px; border-radius: 8px; font-size: 15px;
}
#sidebar nav button:hover { background: var(--panel2); }
#sidebar nav button.active { background: var(--blue); color: var(--white); font-weight: 700; }
#sidebar .signout { margin-top: 18px; width: 100%; background: none; border: 1px solid var(--line); color: var(--grey); border-radius: 8px; padding: 10px; font-size: 14px; }
#sidebar .userline { margin-top: 14px; font-size: 12px; color: var(--grey); word-break: break-all; }
#main { flex: 1; min-width: 0; padding: 24px 28px 80px; }
#view { max-width: 960px; margin: 0 auto; }

/* ---------- components ---------- */
h1 { font-size: 26px; margin: 4px 0 6px; color: var(--navy); }
h2 { font-size: 20px; margin: 26px 0 8px; color: var(--navy); }
h3 { font-size: 16px; margin: 0 0 6px; color: var(--navy); }
p.muted, .muted { color: var(--grey); }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin: 14px 0;
  box-shadow: 0 1px 3px rgba(22, 50, 79, 0.08);
}
.card.gold-border { border-color: var(--gold); }
.btn {
  display: inline-block; background: var(--blue); color: var(--white); font-weight: 700;
  border: none; border-radius: 8px; padding: 11px 18px; font-size: 15px; text-decoration: none;
}
.btn.secondary { background: var(--white); color: var(--blue); border: 1px solid var(--blue); font-weight: 600; }
.btn.danger { background: none; color: var(--red); border: 1px solid var(--red); font-weight: 600; padding: 8px 12px; font-size: 13px; }
.btn.small { padding: 8px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  box-shadow: 0 1px 3px rgba(22, 50, 79, 0.08);
}
.stat .num { font-size: 28px; font-weight: 800; color: var(--blue); }
.stat .lbl { font-size: 13px; color: var(--grey); }
.listrow {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 10px 0;
  box-shadow: 0 1px 3px rgba(22, 50, 79, 0.08);
}
.listrow .title { font-weight: 700; }
.listrow .sub { color: var(--grey); font-size: 14px; margin-top: 2px; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px;
  border-radius: 20px; background: var(--panel2); color: var(--navy); border: 1px solid var(--line);
}
.badge.done { color: var(--green); }
.badge.overdue { color: var(--red); border-color: var(--red); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 4px; }
.tabs button {
  background: var(--panel2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 20px; padding: 8px 14px; font-size: 14px;
}
.tabs button.active { background: var(--blue); color: var(--white); font-weight: 700; border-color: var(--blue); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 20px; accent-color: var(--blue); }
.check.done span { text-decoration: line-through; color: var(--grey); }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.formgrid .full { grid-column: 1 / -1; }
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--navy); color: var(--white); font-weight: 700; padding: 12px 20px;
  border-radius: 8px; display: none; z-index: 50; max-width: 92vw; text-align: center;
}
#error { color: var(--red); margin: 10px 0; font-size: 14px; }
footer { max-width: 960px; margin: 40px auto 0; color: var(--grey); font-size: 13px; text-align: center; }
.exhibit-img { max-width: 100%; border-radius: 8px; margin-top: 10px; }
.exhibit-pdf { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.process-step { border-left: 3px solid var(--gold); padding: 4px 0 4px 14px; margin: 18px 0; }
.process-step h3 { margin-bottom: 4px; }
.process-step .todo { color: var(--gold-dark); font-size: 14px; margin-top: 6px; }

/* ---------- trial signup box (top of the signed-out main page) ---------- */
#signupbox { max-width: 960px; margin: 0 auto 14px; }
#signupbox h2 { margin-top: 0; }
#signup-error { color: var(--red); margin: 10px 0; font-size: 14px; }

/* ---------- preview bar (signed-out visitors) ---------- */
#previewbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: #fffdf6; border: 1px solid var(--gold); border-radius: var(--radius);
  padding: 12px 14px; margin: 0 0 14px;
}
.preview-tag {
  font-size: 12px; font-weight: 800; letter-spacing: 0.5px; color: var(--navy);
  background: var(--gold); border-radius: 20px; padding: 3px 10px; white-space: nowrap;
}
.preview-text { flex: 1 1 220px; font-size: 14px; color: var(--grey); }
.preview-cta { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- auth ---------- */
#authscreen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.authbox {
  width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px; box-shadow: 0 2px 12px rgba(22, 50, 79, 0.10);
}
.authbox h1 { text-align: center; }
.authbox .tag { text-align: center; color: var(--blue); font-size: 14px; margin-bottom: 18px; }
.divider { text-align: center; color: var(--grey); font-size: 13px; margin: 16px 0; }
.googlebtn {
  width: 100%; background: var(--white); color: var(--ink); font-weight: 700;
  border: 1px solid var(--line); border-radius: 8px; padding: 11px; font-size: 15px;
}
.linklike { background: none; border: none; color: var(--blue); font-size: 14px; padding: 0; }

/* ---------- mobile ---------- */
#mobilebar { display: none; }
@media (max-width: 860px) {
  #app { flex-direction: column; }
  #sidebar {
    position: static; width: 100%; flex: none; height: auto;
    border-right: none; border-bottom: 1px solid var(--line); padding: 12px 14px;
  }
  #sidebar nav { flex-direction: row; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
  #sidebar nav button { white-space: nowrap; }
  #sidebar .signout, #sidebar .userline { display: none; }
  #main { padding: 16px 14px 80px; }
  .statgrid { grid-template-columns: repeat(2, 1fr); }
  .formgrid { grid-template-columns: 1fr; }
  #mobilebar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--white); border-top: 1px solid var(--line);
    justify-content: space-around; padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
  }
  #mobilebar button { background: none; border: none; color: var(--ink); font-size: 12px; padding: 8px 4px; }
  #mobilebar button.active { color: var(--blue); font-weight: 700; }
}
