/* ============================================================================
   Veri5 Notary — design system (UI redesign 2026-08). Dark brand, cyan→blue.
   Superset stylesheet: new system + retained legacy classes (retokenized) so
   pages not yet migrated keep working. Legacy blocks marked "legacy" are
   removed in the Phase-7 sweep once every page is on the new components.
   ============================================================================ */

:root {
  /* color */
  --bg: #0A0E17;            /* page background */
  --surface: #0E1420;       /* inputs, modals, inset panels */
  --card: #131927;          /* cards */
  --card-2: #182136;        /* raised / hover card */
  --bd: #232C40;            /* borders */
  --bd-soft: rgba(255,255,255,.07);
  --ink: #EEF2FB;           /* primary text */
  --muted: #94A2BC;         /* secondary text — do NOT go darker at <14px */
  --faint: #62708C;         /* tertiary / hints, >=12px only */
  --blue: #3F82F8;  --cyan: #62D8FF;
  --grad: linear-gradient(135deg, #62D8FF 0%, #3F82F8 50%, #2856D6 100%);
  --green: #34D399; --amber: #FBBF24; --red: #F87171;
  --green-bg: rgba(52,211,153,.12); --amber-bg: rgba(251,191,36,.10); --red-bg: rgba(248,113,113,.12);
  /* legacy aliases */
  --danger: #F87171;
  /* shape & motion */
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 20px 60px -24px rgba(0,0,0,.6);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue);
  --speed: .15s;
}

/* base ---------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; font-weight: 700; }
h2 { font-size: 24px; letter-spacing: -.4px; }
h3 { font-size: 20px; }
p { margin: 0; }
.accent, .grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.muted { color: var(--muted); font-size: 13.5px; }
.faint { color: var(--faint); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.center { text-align: center; }
svg.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

/* SVG icon set (inline, currentColor) — documented for reuse:
   #i-doc file · #i-shield seal · #i-check verify · #i-share · #i-download
   · #i-copy · #i-more ⋯ · #i-warn · #i-arrow. Defined once per page in an
   <svg style="display:none"> sprite; reference via <svg class="i"><use href="#i-x"/></svg>. */

/* layout -------------------------------------------------------------------- */
.container { max-width: 1040px; margin: 0 auto; padding: 32px 22px; width: 100%; }
.container.narrow { max-width: 560px; }
main { flex: 1 0 auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* app shell — sticky nav with tabs + mobile hamburger ----------------------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 22px; height: 60px;
  background: rgba(10,14,23,.8); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bd-soft);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand img, .brand svg.logo { width: 26px; height: 26px; display: block; }
.brand:hover { text-decoration: none; }
.nav-tabs { display: flex; align-items: center; gap: 4px; }
.nav-tabs a, a.tab {
  position: relative; color: var(--muted); font-weight: 600; font-size: 14.5px;
  padding: 8px 12px; border-radius: 8px; transition: var(--speed);
}
.nav-tabs a:hover, a.tab:hover { color: var(--ink); text-decoration: none; background: var(--bd-soft); }
a.tab.active, a.tab[aria-current="page"] { color: var(--ink); }
a.tab.active::after, a.tab[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
  border-radius: 2px; background: var(--grad);
}
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-hamb { display: none; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 5px 11px;
  border: 1px solid var(--bd); border-radius: 9px; background: var(--card);
  color: var(--muted); font-weight: 600; font-size: 13px; transition: var(--speed);
}
.lang-toggle:hover { color: var(--ink); border-color: var(--blue); text-decoration: none; }
.lang-toggle::before { content: "文"; font-size: 12px; opacity: .7; }

/* hero ---------------------------------------------------------------------- */
.hero { text-align: center; padding: 72px 22px 40px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -10% 0 auto; height: 420px; pointer-events: none;
  background: radial-gradient(58% 60% at 50% 0%, rgba(63,130,248,.18), transparent 70%);
}
.hero h1 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -1px; margin: 0 0 16px; position: relative; }
.hero .lede { color: var(--muted); font-size: 17px; max-width: 620px; margin: 0 auto 28px; position: relative; }
.hero .cta { justify-content: center; position: relative; }

/* buttons ------------------------------------------------------------------- */
.btn, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 20px; border-radius: 12px;
  font-weight: 600; font-size: 15px; cursor: pointer; border: 1px solid transparent;
  transition: var(--speed); white-space: nowrap; text-decoration: none;
}
.btn { background: var(--grad); color: #fff; box-shadow: 0 8px 26px -10px rgba(63,130,248,.6); }
.btn:hover { transform: translateY(-1px); text-decoration: none; box-shadow: 0 12px 32px -10px rgba(63,130,248,.75); }
.btn-ghost { background: var(--card); border-color: var(--bd); color: var(--ink); }
.btn-ghost:hover { border-color: var(--blue); text-decoration: none; }
.btn-danger { background: var(--red-bg); border-color: rgba(248,113,113,.4); color: var(--red); }
.btn-danger:hover { background: rgba(248,113,113,.2); text-decoration: none; }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: 13.5px; border-radius: 9px; }
.btn[disabled], .btn-ghost[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:focus-visible, .btn-ghost:focus-visible, .btn-danger:focus-visible,
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; box-shadow: var(--focus); }
.link { background: none; border: none; color: var(--cyan); cursor: pointer; font-size: 14px; padding: 0; }
.link.danger { color: var(--red); }

/* cards --------------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--bd); border-radius: var(--radius); padding: 24px; }
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h3 { font-size: 18px; }
.card-title .sub { color: var(--muted); font-size: 13.5px; }

/* badges — one language across the app -------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.bad { background: var(--red-bg); color: var(--red); }
.badge.neutral { background: var(--bd-soft); color: var(--muted); }
.badge.big { font-size: 15px; padding: 7px 16px; }
/* legacy badge names */
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-void { background: var(--red-bg); color: var(--red); }
.big-badge { font-size: 18px; padding: 8px 18px; }

/* overflow menu — CSS only -------------------------------------------------- */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--bd); background: var(--card); color: var(--muted); font-weight: 600; font-size: 14px; gap: 7px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { color: var(--ink); border-color: var(--blue); }
.menu[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: 60; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 61; min-width: 190px; background: var(--card-2); border: 1px solid var(--bd); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 8px; border: none; background: none; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--bd-soft); text-decoration: none; }
.menu-pop hr { border: none; border-top: 1px solid var(--bd); margin: 5px 4px; }
.menu-pop .danger, .menu-pop button.danger { color: var(--red); }
.menu-pop form { margin: 0; }

/* fields -------------------------------------------------------------------- */
label { display: block; margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=file], input[type=search], textarea, select {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--bd);
  background: var(--surface); color: var(--ink); font-size: 15px; font-family: inherit; transition: var(--speed);
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.field + .field { margin-top: 14px; }
.hint { color: var(--faint); font-size: 12.5px; margin-top: 5px; }

/* notices / explainers ------------------------------------------------------ */
.notice { padding: 12px 14px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 14px; }
.notice.ok { background: var(--green-bg); color: var(--green); }
.notice.err { background: var(--red-bg); color: var(--red); }
.notice.info { background: rgba(63,130,248,.1); color: #a9c6ff; }
.explainer { background: var(--surface); border: 1px solid var(--bd); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; color: var(--muted); }
.explainer summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.warnline { display: flex; gap: 9px; align-items: flex-start; background: var(--amber-bg); border: 1px solid rgba(251,191,36,.28); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13.5px; color: #f2d38a; }
.dangerzone { border: 1px solid rgba(251,191,36,.3); border-left: 3px solid var(--amber); background: var(--amber-bg); border-radius: var(--radius-sm); padding: 16px; }

/* stat ---------------------------------------------------------------------- */
.stat .num { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.stat .num .accent { font-weight: 800; }
.stat .label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.balance { font-size: 32px; font-weight: 800; letter-spacing: -1px; } /* legacy */

/* kv / chip ----------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 16px; margin-top: 14px; word-break: break-word; }
.kv .k { color: var(--muted); font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--bd-soft); border: 1px solid var(--bd); border-radius: 8px; padding: 4px 10px; min-width: 0; max-width: 100%; }
.chip .mono { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip a.mono { color: var(--cyan); }
.chip .copy { cursor: pointer; border: none; background: none; color: var(--muted); font-size: 13px; line-height: 1; flex: none; padding: 0; }
.chip .copy:hover { color: var(--ink); }

/* record list (dashboard / issue) ------------------------------------------- */
.rlist { display: flex; flex-direction: column; gap: 10px; }
.rcard { display: flex; align-items: center; gap: 14px; justify-content: space-between; background: var(--card); border: 1px solid var(--bd); border-radius: var(--radius-sm); padding: 14px 16px; transition: var(--speed); }
.rcard:hover { border-color: var(--bd); background: var(--card-2); }
.rcard .rc-main { min-width: 0; flex: 1; }
.rcard .rc-t { font-weight: 600; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.rcard .rc-t.voided { text-decoration: line-through; color: var(--muted); }
.rcard .rc-meta { color: var(--muted); font-size: 13px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; }
.rcard .rc-act { display: flex; align-items: center; gap: 8px; flex: none; }
.rc-empty { text-align: center; color: var(--muted); padding: 44px 16px; }

/* dashboard 2-col: records (left) · balance + notarize (right) --------------- */
.dash-grid { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(0,1fr) 360px; grid-template-areas: "records balance" "records notarize"; }
.dash-grid > .card { margin-top: 0; }
.dr-records { grid-area: records; }
.dr-balance { grid-area: balance; position: sticky; top: 76px; }
.dr-notarize { grid-area: notarize; }
.dr-notarize-card { margin-top: 0; }
.dr-balance .num { font-size: 32px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.dr-balance .label { color: var(--muted); font-size: 13px; margin-top: 3px; }
.nf-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--bd-soft); }
.nf-idlabel { color: var(--faint); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.menu.user > summary { border: none; background: none; padding: 6px 10px; color: var(--ink); }
.menu.user > summary:hover { background: var(--bd-soft); border-color: transparent; }
@media (max-width: 960px) { .dash-grid { grid-template-columns: 1fr; grid-template-areas: "balance" "records" "notarize"; } .dr-balance { position: static; } }

/* dropzone / file-list ------------------------------------------------------ */
.dropzone { border: 2px dashed var(--bd); border-radius: var(--radius-sm); padding: 26px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; background: rgba(255,255,255,.02); margin-top: 6px; }
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: rgba(63,130,248,.07); }
.dz-text { color: var(--muted); font-size: 14px; pointer-events: none; }
.dz-link { color: var(--blue); text-decoration: underline; }
.file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.fl-item { display: flex; align-items: center; gap: 10px; background: var(--bd-soft); border: 1px solid var(--bd); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.fl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.fl-size { color: var(--muted); font-size: 12px; white-space: nowrap; }
.fl-x { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.fl-x:hover { color: var(--red); }

/* QR / proof page ----------------------------------------------------------- */
.qr { display: flex; justify-content: center; padding: 16px; background: #fff; border-radius: 12px; width: fit-content; margin: 0 auto; }
.footnote { color: var(--muted); font-size: 13px; margin-top: 16px; line-height: 1.7; }
#status .badge { font-size: 22px; padding: 8px 18px; }
.lock { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--green-bg); border: 1px solid rgba(52,211,153,.3); }
.lock .ic { font-size: 24px; } .lock .t { font-weight: 700; color: var(--green); }
.lock.bad { background: var(--red-bg); border-color: rgba(248,113,113,.3); } .lock.bad .t { color: var(--red); }
.preview { background: var(--surface); border: 1px solid var(--bd); border-radius: 12px; padding: 14px; margin-top: 16px; min-height: 120px; }
.preview img { max-width: 100%; border-radius: 8px; display: block; margin: 0 auto; }
.preview iframe { width: 100%; height: 70vh; border: 0; border-radius: 8px; background: #fff; }
.preview pre { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--ink); margin: 0; }

/* modal (billing checkout) -------------------------------------------------- */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 60; align-items: flex-start; justify-content: center; overflow: auto; padding: 24px; }
.modal-box { background: var(--card); border: 1px solid var(--bd); border-radius: var(--radius); max-width: 560px; width: 100%; padding: 22px; position: relative; box-shadow: var(--shadow); }
.modal-x { position: absolute; top: 12px; right: 14px; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--ink); }

/* stepper (batch / onboarding) ---------------------------------------------- */
.stepper { display: flex; flex-direction: column; gap: 18px; }
.step { display: flex; gap: 14px; }
.stepnum { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.step-b { flex: 1; min-width: 0; }
.step-b h3 { font-size: 16px; margin-bottom: 4px; }
.codeblock { background: var(--surface); border: 1px solid var(--bd); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 12.5px; overflow-x: auto; font-family: ui-monospace, Menlo, monospace; white-space: pre; color: var(--ink); }
.ministeps { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; color: var(--muted); font-size: 13.5px; }
.ministeps .ms { display: inline-flex; align-items: center; gap: 8px; }
.ministeps .sep { color: var(--faint); }
.stepnum.sm { flex: 0 0 24px; width: 24px; height: 24px; font-size: 12px; }

/* packs (billing) ----------------------------------------------------------- */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.pack { position: relative; background: var(--card); border: 1px solid var(--bd); border-radius: var(--radius); padding: 22px 20px; text-align: center; }
.pack.best { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; border: 1px solid transparent; }
.pack-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 11px; border-radius: 999px; white-space: nowrap; }
.pack-label { font-weight: 600; }
.pack-price { font-size: 26px; font-weight: 800; margin: 6px 0; }
.pack .btn { margin-top: 12px; width: 100%; }

/* per-file cards (verify) — legacy, retokenized ----------------------------- */
.files { display: grid; gap: 10px; margin-top: 8px; text-align: left; }
.files .fhead { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.filecard { background: var(--surface); border: 1px solid var(--bd); border-radius: var(--radius-sm); padding: 12px 14px; }
.filecard .fn { font-weight: 600; word-break: break-word; display: flex; gap: 8px; align-items: baseline; }
.filecard .fn .ix { color: var(--muted); font-weight: 400; font-size: 12px; }
.filecard .fattr { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 6px 10px; margin-top: 10px; align-items: center; }
.filecard .fk { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }

/* table — legacy + mobile card-collapse ------------------------------------- */
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--bd); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr.voided .desc { text-decoration: line-through; color: var(--muted); }
td.actions a, td.actions button { margin-right: 12px; }

/* spinner ------------------------------------------------------------------- */
.spinner { display: inline-block; width: 13px; height: 13px; margin-right: 7px; vertical-align: -2px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: nspin .6s linear infinite; }
@keyframes nspin { to { transform: rotate(360deg); } }

/* footer -------------------------------------------------------------------- */
footer { flex-shrink: 0; text-align: center; color: var(--muted); font-size: 13px; padding: 32px 22px; border-top: 1px solid var(--bd-soft); margin-top: 40px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

/* responsive ---------------------------------------------------------------- */
@media (max-width: 960px) { .g3 { grid-template-columns: 1fr; } .g2 { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .nav-tabs, .nav-right > .menu.user > summary span.uname { display: none; }
  .nav-hamb { display: inline-block; }
  header.nav { padding: 0 16px; }
  .rcard { flex-wrap: wrap; }
  .rcard .rc-act { width: 100%; justify-content: flex-end; }
}
@media (max-width: 560px) {
  .row2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 3px 0; }
  .kv .k { margin-top: 8px; }
  .container { padding: 24px 16px; }
  .hero { padding: 48px 16px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition: none !important; scroll-behavior: auto !important; }
  .btn:hover { transform: none; }
}
