/* ============================================================================
   Veri5 Passport — design system (UI redesign 2026-08). Shares the notary dark
   cyan→blue identity: same tokens + components, plus auth-card / account patterns.
   Link with ?v={{V}}. Replaces the per-view <style> blocks + hp-* (passport.css).
   ============================================================================ */
:root {
  --bg: #0A0E17; --surface: #0E1420; --card: #131927; --card-2: #182136;
  --bd: #232C40; --bd-soft: rgba(255,255,255,.07);
  --ink: #EEF2FB; --muted: #94A2BC; --faint: #62708C;
  --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);
  --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;
}
* { 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, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--cyan); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 700; }
h2 { font-size: 24px; letter-spacing: -.4px; } h3 { font-size: 20px; }
.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; } .accent, .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* auth layout --------------------------------------------------------------- */
.auth-top { position: fixed; top: 16px; right: 16px; z-index: 10; }
.auth { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--bd); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.auth-logo { display: block; width: 52px; height: 52px; margin: 0 auto 16px; filter: drop-shadow(0 8px 24px rgba(63,130,248,.4)); }
.auth-title { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin: 0 0 4px; }
.auth-title.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.auth-row { display: flex; justify-content: space-between; margin-top: 18px; font-size: 13.5px; gap: 12px; flex-wrap: wrap; }
/* WeChat sign-in (zh) */
.wx-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 0 0 4px; padding: 13px; min-height: 44px; border: 0; border-radius: 12px; background: #07C160; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; }
.wx-btn:hover { text-decoration: none; filter: brightness(1.06); }
.wx-btn svg { width: 22px; height: 22px; }
.email-toggle { display: inline-block; margin-top: 18px; color: var(--muted); font-size: 13px; border-bottom: 1px dashed rgba(255,255,255,.22); padding-bottom: 1px; }
.email-toggle:hover { text-decoration: none; color: var(--ink); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0 4px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--bd); }

/* fields --------------------------------------------------------------------- */
label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 14px 0 6px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--bd);
  border-radius: var(--radius-sm); color: var(--ink); font-size: 15px; font-family: inherit; transition: var(--speed);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
input::placeholder { color: var(--faint); }
input[type=file] { padding: 9px 12px; }

/* issuer-apply bespoke bits */
.lead { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0 0 6px; }
.note { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 10px; }
.warn { background: var(--amber-bg); border: 1px solid rgba(251,191,36,.25); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; color: #fde68a; margin-top: 6px; }
.classrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.classrow label { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 9px 13px; border: 1px solid var(--bd); border-radius: 9px; font-size: 13px; color: var(--ink); cursor: pointer; background: var(--surface); font-weight: 500; text-transform: none; letter-spacing: 0; }
.classrow label:has(input:checked) { border-color: var(--blue); background: rgba(63,130,248,.14); }
.classrow input { width: auto; }
.hide { display: none; }
.hint { color: var(--faint); font-size: 12.5px; margin-top: 5px; }
.pw-wrap { position: relative; } .pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 0; height: 100%; width: auto; margin: 0; padding: 0 10px; background: none; border: 0; color: var(--faint); cursor: pointer; display: flex; align-items: center; box-shadow: none; }
.pw-toggle:hover { color: var(--muted); transform: none; box-shadow: none; }
.pw-toggle svg { width: 20px; height: 20px; display: block; }
.pw-toggle .off { display: none; } .pw-toggle.show .on { display: none; } .pw-toggle.show .off { display: block; }

/* buttons -------------------------------------------------------------------- */
/* Primary = submit buttons in an auth card (+ the recovery "done" button) + .btn. */
.btn, .auth-card button[type=submit], #done, #submitBtn, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 12px 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; font-family: inherit; width: 100%;
}
.btn, .auth-card button[type=submit], #done, #submitBtn { background: var(--grad); color: #fff; box-shadow: 0 8px 26px -10px rgba(63,130,248,.6); margin-top: 20px; }
.btn:hover, .auth-card button[type=submit]:hover, #done:hover { transform: translateY(-1px); text-decoration: none; }
.btn:disabled, .auth-card button[type=submit]:disabled, #done:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sec { flex: 1; width: auto; margin-top: 0; background: transparent; border: 1px solid var(--bd); color: var(--ink); font-size: 13px; padding: 10px; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; min-height: auto; font-family: inherit; }
.btn-sec:hover { border-color: var(--blue); }
.tabs { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--bd); border-radius: 11px; padding: 4px; margin-bottom: 6px; }
.tabs button { flex: 1; margin: 0; padding: 9px; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; box-shadow: none; min-height: auto; border: 0; cursor: pointer; font-family: inherit; width: auto; }
.tabs button.active { background: var(--grad); color: #fff; }
.tabs button:not(.active):hover { color: var(--ink); }
.btn-ghost { background: var(--card); border-color: var(--bd); color: var(--ink); width: auto; }
.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); width: auto; }
.btn-danger:hover { background: rgba(248,113,113,.2); }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: 13.5px; border-radius: 9px; width: auto; margin-top: 0; }
.pw-toggle, .link { width: auto; }
.link { background: none; border: 0; color: var(--cyan); cursor: pointer; font-size: 14px; padding: 0; min-height: auto; margin: 0; box-shadow: none; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* messages ------------------------------------------------------------------- */
.msg { margin-top: 16px; font-size: 13.5px; padding: 11px 13px; border-radius: var(--radius-sm); display: none; }
.msg.err, .err { background: var(--red-bg); border: 1px solid rgba(248,113,113,.3); color: #fca5a5; }
.msg.ok, .ok { background: var(--green-bg); border: 1px solid rgba(52,211,153,.3); color: #86efac; }
.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); }

/* register: step dots + strength meter + recovery phrase (exact JS contract) - */
.step-dots { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 20px; }
.step-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bd); transition: var(--speed); }
.step-dots .dot.on { background: var(--grad); width: 22px; border-radius: 5px; }
.mobrow { display: flex; gap: 8px; } .mobrow select { flex: 0 0 44%; } .mobrow input { flex: 1; min-width: 0; }
.hint { font-size: 12px; color: var(--faint); margin-top: 4px; }
.hidden { display: none; }
.meter { height: 6px; border-radius: 99px; background: var(--bd-soft); margin-top: 10px; overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; transition: .25s; border-radius: 99px; background: var(--red); }
.slabel { margin-top: 6px; font-size: 12px; color: var(--faint); }
.reqs { margin-top: 8px; font-size: 12px; color: var(--faint); line-height: 1.8; }
.reqs b { color: var(--muted); font-weight: 600; }
.reqs span.met { color: #86efac; } .reqs span.met::before { content: "✓ "; }
.phrase { margin-top: 12px; padding: 14px; background: var(--amber-bg); border: 1px solid rgba(251,191,36,.28); border-radius: var(--radius-sm); font-family: ui-monospace, Menlo, monospace; font-size: 14px; line-height: 1.7; color: #fde68a; word-spacing: 4px; }
.phrase-actions { display: flex; gap: 10px; margin-top: 12px; }
.ack { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; font-size: 13px; color: var(--muted); line-height: 1.45; cursor: pointer; }
.ack input { width: auto; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.row { display: flex; justify-content: center; gap: 6px; margin-top: 16px; font-size: 13px; color: var(--muted); }

/* account: identity block, pills, avatar ------------------------------------ */
.pill { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 99px; background: rgba(63,130,248,.15); color: var(--cyan); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.pill.active { background: var(--green-bg); color: var(--green); }
.pill.revoked { background: var(--red-bg); color: var(--red); }
.pill.pending { background: var(--amber-bg); color: var(--amber); }
.pill.none, .pill.unknown { background: var(--bd-soft); color: var(--muted); }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; font-size: 22px; display: grid; place-items: center; flex: none; }
.id-head { display: flex; gap: 16px; align-items: flex-start; }
.id-info { flex: 1; min-width: 0; }
.id-info .mono { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.id-name { display: flex; align-items: center; gap: 9px; margin-top: 4px; font-weight: 600; font-size: 16px; }
.id-qr { text-align: center; flex: none; }
.id-qr #qrcode { line-height: 0; }
.qrcap { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.id-num { margin-top: 18px; } .id-num label { margin: 0 0 6px; }
.id-status { margin-top: 14px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .id-head { flex-direction: column; align-items: stretch; } .id-qr { align-self: center; } }

/* reveal / danger (account) ------------------------------------------------- */
.reveal { background: var(--amber-bg); border: 1px solid rgba(251,191,36,.3); border-radius: var(--radius-sm); padding: 16px; margin-top: 6px; }
.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; margin-top: 14px; }

/* shared components (account/vault reuse notary's) --------------------------- */
.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; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.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); }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--bd-soft); border: 1px solid var(--bd); border-radius: 8px; padding: 4px 10px; max-width: 100%; }
.chip .mono { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .copy { cursor: pointer; border: none; background: none; color: var(--muted); font-size: 13px; padding: 0; width: auto; min-height: auto; margin: 0; }
.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; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* app shell (account/vault) ------------------------------------------------- */
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 svg, .brand img { width: 26px; height: 26px; }
.nav-tabs { display: flex; 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); background: var(--bd-soft); text-decoration: none; }
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; }
.container { max-width: 760px; margin: 0 auto; padding: 32px 22px; width: 100%; }
main { flex: 1 0 auto; }

/* menu (account) ------------------------------------------------------------ */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 10px; border-radius: 9px; color: var(--ink); font-weight: 600; font-size: 14px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--bd-soft); }
.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; 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; min-height: auto; margin: 0; box-shadow: none; 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 form { margin: 0; }

/* language toggle ----------------------------------------------------------- */
.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); width: auto; }
.lang-toggle:hover { color: var(--ink); border-color: var(--blue); text-decoration: none; }
.lang-toggle::before { content: "文"; font-size: 12px; opacity: .7; }

/* vault items --------------------------------------------------------------- */
.item { padding: 14px 0; border-top: 1px solid var(--bd-soft); } .item:first-child { border-top: 0; }
.item-main { font-weight: 600; font-size: 14px; }
.item-sub { font-size: 12.5px; color: var(--muted); margin: 5px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item-actions { font-size: 13px; }
.vault-name { font-size: 18px; font-weight: 700; }
.vault-status { font-size: 13px; color: var(--muted); margin: 8px 0; }
.soon { opacity: .65; }

/* consent scope list -------------------------------------------------------- */
.scope-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.scope-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: var(--ink); }
.scope-list li::before { content: "✓"; color: var(--green); font-weight: 700; flex: none; }
.consent-app { text-align: center; margin: 6px 0 16px; }
.consent-app .app-name { font-size: 17px; font-weight: 700; }
.consent-app .app-desc { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

/* account picker ------------------------------------------------------------ */
.acct-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--bd); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; font-size: 14px; margin-bottom: 10px; transition: var(--speed); }
.acct-btn:hover { background: var(--card-2); border-color: var(--blue); text-decoration: none; }
.acct-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff; flex: none; }
.acct-info .name { font-weight: 600; } .acct-info .email { font-size: 12px; color: var(--muted); }
.acct-switch { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--bd-soft); background: transparent; color: var(--cyan); text-decoration: none; font-size: 14px; }
.acct-switch:hover { background: rgba(63,130,248,.06); text-decoration: none; }
.acct-switch-icon { width: 40px; height: 40px; border-radius: 50%; border: 2px dashed rgba(63,130,248,.3); display: grid; place-items: center; font-size: 20px; color: var(--cyan); flex: none; }

/* verify (public identity) — big status badge + kv rows --------------------- */
.badge.active { background: var(--green-bg); color: var(--green); }
.badge.revoked { background: var(--red-bg); color: var(--red); }
.badge.none, .badge.unknown { background: var(--bd-soft); color: var(--muted); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
#content .badge { font-size: 16px; padding: 9px 20px; margin-bottom: 18px; }
#content .name { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
#content .lvl { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
#content .row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--bd-soft); font-size: 13px; }
#content .row .k { color: var(--muted); } #content .row .v { font-family: ui-monospace, Menlo, monospace; color: var(--ink); word-break: break-all; text-align: right; }
#content .foot { margin-top: 20px; font-size: 12px; color: var(--faint); line-height: 1.6; }
#content .spin { color: var(--muted); font-size: 14px; padding: 20px; }

/* footer (static — never fixed) --------------------------------------------- */
footer { flex-shrink: 0; text-align: center; color: var(--muted); font-size: 12.5px; padding: 24px 16px; border-top: 1px solid var(--bd-soft); }
footer a { color: var(--muted); } footer a:hover { color: var(--ink); }

@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv .k { margin-top: 8px; } .auth-card { padding: 26px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
