/* ============================================================================
   LAW Archive — visual system
   Brand: Legal Action Worldwide · navy #0a1460 · red #E31140
   ========================================================================== */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/static/fonts/Inter.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/static/fonts/Newsreader.woff2') format('woff2');
}

:root {
  --navy: #0a1460; --navy-600: #20308f; --navy-050: #eef0fb;
  --red: #e31140; --red-700: #b50d31; --red-050: #fdecf0;
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #fafbfd;
  --ink: #0e1230; --muted: #5d6478; --faint: #8b91a4; --line: #e3e7f0;
  --ok: #11774a; --ok-bg: #e6f6ee; --ok-line: #b9e6cd;
  --warn: #8a5a00; --warn-bg: #fdf2d8;
  --shadow-sm: 0 1px 2px rgba(10,20,96,.05);
  --shadow: 0 1px 3px rgba(10,20,96,.06), 0 10px 30px rgba(10,20,96,.07);
  --radius: 14px; --radius-sm: 9px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.55; letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: 'Newsreader', Georgia, serif; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--red); }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.86em; }
::selection { background: var(--red-050); }

/* ---- Buttons ---- */
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: var(--radius-sm);
  padding: 11px 18px; background: var(--navy); color: #fff; transition: background .15s, transform .05s;
  display: inline-flex; align-items: center; gap: 8px; line-height: 1;
}
button:hover, .btn:hover { background: var(--navy-600); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--navy-600); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--navy-050); color: var(--navy); }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 500; }
button.link:hover { background: none; color: var(--red); }
button.danger { background: #fff; color: var(--red-700); border: 1px solid #f0c2cd; }
button.danger:hover { background: var(--red-050); }

/* ---- Forms ---- */
label { display: block; font-weight: 600; font-size: 13.5px; margin: 16px 0 6px; color: var(--ink); }
input, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  outline: 0; border-color: var(--navy-600); box-shadow: 0 0 0 3px var(--navy-050);
}
input[type=file] { padding: 9px; background: var(--surface-2); }
textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.msg { background: var(--navy-050); border: 1px solid #cfd6f5; color: #2a356f; padding: 11px 14px; border-radius: var(--radius-sm); }
.msg.err { background: var(--red-050); border-color: #f3c4cf; color: var(--red-700); }

/* ============================================================================
   Login — split hero
   ========================================================================== */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-hero {
  background: radial-gradient(120% 120% at 30% 20%, #14207a 0%, var(--navy) 55%, #070d3e 100%);
  display: flex; align-items: center; justify-content: center; padding: 48px;
}
.login-hero .logo { height: 42px; opacity: .96; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--surface); }
.login-card { width: 100%; max-width: 360px; }
.login-card .brand-logo { height: 28px; margin-bottom: 28px; }
.login-card h2 { font-size: 25px; margin: 0 0 6px; }
.login-card .sub { color: var(--muted); margin: 0 0 22px; }
.login-card button { width: 100%; justify-content: center; margin-top: 18px; padding: 12px; }
@media (max-width: 820px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 40px 28px; }
  .login-hero h1 { font-size: 30px; }
  .login-hero ul.features { display: none; }
}

/* ============================================================================
   App chrome
   ========================================================================== */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 0 28px; height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.topbar .brand { display: flex; align-items: center; gap: 0; }
.topbar .brand img { height: 22px; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 13.5px; }
.topbar .back { font-weight: 600; font-size: 14px; }
.wrap { max-width: 1000px; margin: 32px auto 60px; padding: 0 28px; }
.backlink { display: inline-block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }

.page-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 18px; }
.page-head h1 { font-size: 26px; margin: 0; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 30px 0 12px; }

/* ---- Action cards ---- */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .actions { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 22px;
}
.card .card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; }
.card .card-head .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.card .card-head .ic.page { background: var(--navy-050); color: var(--navy); }
.card .card-head .ic.video { background: #efeafc; color: #5b3ca8; }
.card .card-head .ic.deposit { background: #fdeede; color: #9a5b13; }
.card .card-head h3 { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 650; margin: 0; }
.card .card-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.card textarea { margin-bottom: 12px; }
.card button { width: 100%; justify-content: center; }

.deposit-cta {
  margin: 18px 0 6px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px;
}
.deposit-cta .ic { width: 38px; height: 38px; border-radius: 10px; background: #fdeede; color: #9a5b13; display: grid; place-items: center; flex: none; }
.deposit-cta .txt { flex: 1; }
.deposit-cta .txt b { display: block; }
.deposit-cta .txt span { color: var(--muted); font-size: 13px; }

/* ---- Search + filter bar ---- */
.searchbar { display: flex; gap: 10px; margin-bottom: 14px; }
.searchbar input[type=search] { flex: 1; }
.searchbar select { width: auto; min-width: 150px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--ink); cursor: pointer; }
.searchbar button { flex: none; }

/* ---- Case ---- */
.caseform { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; color: var(--muted); }
.caseform input { max-width: 280px; padding: 7px 11px; }
.caseform button { padding: 7px 12px; }
.casechip { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--navy-600); font-size: 12px; font-weight: 600; }
.casechip:hover { background: var(--navy-050); text-decoration: none; }
.faint { color: var(--faint); }

/* ---- Table ---- */
table.captures {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.captures th, .captures td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.captures th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; background: var(--surface-2); }
.captures tbody tr { transition: background .12s; }
.captures tbody tr:hover { background: var(--surface-2); }
.captures tr:last-child td { border-bottom: 0; }
.nowrap { white-space: nowrap; }
.url { word-break: break-all; color: var(--ink); }
.captures td a { font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 40px 20px; }

/* ---- Badges ---- */
.pill, .type { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; background: currentColor; }
.pill.queued { background: #eef1f6; color: #6a7282; }
.pill.capturing { background: var(--warn-bg); color: var(--warn); }
.pill.complete { background: var(--ok-bg); color: var(--ok); }
.pill.failed { background: var(--red-050); color: var(--red-700); }
.type { text-transform: uppercase; letter-spacing: .04em; border-radius: 6px; }
.type.page { background: var(--navy-050); color: var(--navy-600); }
.type.video { background: #efeafc; color: #5b3ca8; }
.type.deposit { background: #fdeede; color: #9a5b13; }

/* ============================================================================
   Detail
   ========================================================================== */
.detail h1.url { font-size: 22px; word-break: break-all; margin: 6px 0 4px; }
.meta-row { color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px 22px; margin: 16px 0; }
.panel h3 { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }

/* Evidentiary seal */
.seal { display: flex; gap: 16px; align-items: flex-start; }
.seal .badge { width: 46px; height: 46px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; flex: none; }
.seal .badge.pending { background: var(--warn-bg); color: var(--warn); }
.hash { font-family: ui-monospace, monospace; font-size: 12.5px; color: var(--muted); word-break: break-all; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; display: block; margin-top: 6px; }

.artifacts { list-style: none; padding: 0; margin: 0; }
.artifacts li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.artifacts li:last-child { border-bottom: 0; }
.artifacts .akind { width: 30px; height: 30px; border-radius: 8px; background: var(--navy-050); color: var(--navy); display: grid; place-items: center; flex: none; }
.artifacts .aname { font-weight: 600; }
.artifacts .asize { color: var(--faint); font-size: 13px; }
.artifacts .ahash { margin-left: auto; color: var(--faint); font-family: ui-monospace, monospace; font-size: 12px; }

.timestamps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.timestamps li { display: flex; align-items: center; gap: 10px; }

table.kv { border-collapse: collapse; width: 100%; }
table.kv th { text-align: left; vertical-align: top; color: var(--muted); font-weight: 600; padding: 7px 18px 7px 0; white-space: nowrap; font-size: 13.5px; }
table.kv td { padding: 7px 0; word-break: break-word; }
.note-inline { color: var(--faint); font-size: 12.5px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.note { color: var(--muted); font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 28px 0 16px; }

.verify { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-sm); }
.verify.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); }
.verify.fail { background: var(--red-050); border: 1px solid #f3bcbc; }
.verify ul { margin: 8px 0 0; padding-left: 18px; }
