/* Keyork Immigration Law palette and type, taken from immigrating-to-canada.com:
   navy #10244a / #1b3566, red #d4121c for the main action, Inter for text, Fraunces for headings. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/static/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/static/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/static/fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/static/fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 600; font-display: swap; src: url("/static/fonts/fraunces-600.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 700; font-display: swap; src: url("/static/fonts/fraunces-700.woff2") format("woff2"); }
@font-face { font-family: "Dancing Script"; font-weight: 700; font-display: swap; src: url("/static/fonts/DancingScript-Bold.otf"); }

:root {
  --bg: #f5f7fa; --card: #ffffff; --ink: #1a2438; --muted: #566174; --line: #e3e8ef; --field: #ffffff;
  --navy: #10244a; --navy-2: #1b3566;
  --primary: #10244a; --on-primary: #ffffff; --primary-hover: #1b3566;
  --cta: #d4121c; --cta-hover: #b00f17; --on-cta: #ffffff;
  --link: #1b3566;
  --ok: #1d7a46; --warn: #a15c00; --bad: #b00f17;
  --hot: #fdeced; --hot-line: #d4121c; --hot-ink: #8c0b12;
  --radius: 14px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 36, 74, .06), 0 10px 30px rgba(16, 36, 74, .08);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1426; --card: #131f38; --ink: #e6ebf4; --muted: #9aa7bd; --line: #25344f; --field: #0e1830;
    --navy: #9db8e8; --navy-2: #b9cdf0;
    --primary: #3b63ad; --on-primary: #ffffff; --primary-hover: #4a74c2;
    --cta: #e5303a; --cta-hover: #f0525b; --on-cta: #ffffff;
    --link: #9db8e8;
    --ok: #4cc084; --warn: #f0b24a; --bad: #ff7a82;
    --hot: #3a1a1f; --hot-line: #ff6a73; --hot-ink: #ffc4c8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--font-head); font-weight: 600; color: var(--navy); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.005em; text-wrap: balance; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; }
h3 { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 1.6em 0 .6em; }
a { color: var(--link); }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
button, .btn { font: inherit; font-weight: 600; cursor: pointer; border-radius: 999px; border: 1.5px solid var(--navy); background: transparent; color: var(--navy); padding: 8px 18px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; transition: background .15s, color .15s, border-color .15s, transform .15s; }
button:hover, .btn:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
button.primary, .btn.primary { background: var(--cta); border-color: var(--cta); color: var(--on-cta); }
button.primary:hover, .btn.primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); transform: translateY(-1px); }
button.solid, .btn.solid { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
button.solid:hover, .btn.solid:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.ghost, .btn.ghost { border-color: transparent; color: var(--link); padding-left: 12px; padding-right: 12px; }
button.ghost:hover, .btn.ghost:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--link); border-color: transparent; }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
button.danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
button.small, .btn.small { min-height: 34px; padding: 5px 14px; font-size: .86rem; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--cta) 55%, transparent); outline-offset: 2px; }

/* ---------- forms ---------- */
input, select, textarea { font: inherit; width: 100%; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--field); color: var(--ink); min-height: 42px; }
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus { border-color: var(--navy-2); }
label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
.field { margin-bottom: 14px; }
.field small { display: block; color: var(--muted); font-weight: 400; margin-top: 4px; font-size: .8rem; }
.grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.error { background: color-mix(in srgb, var(--bad) 11%, transparent); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); padding: 10px 14px; border-radius: var(--radius-sm); margin: 12px 0; font-weight: 500; }
.notice { background: color-mix(in srgb, var(--primary) 9%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); padding: 12px 14px; border-radius: var(--radius-sm); margin: 0 0 14px; }

/* ---------- brand bar ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.brand img { height: 38px; width: auto; display: block; }
.brand .sep { width: 1px; height: 26px; background: var(--line); }
.brand .title { font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login { max-width: 400px; margin: 12vh auto 0; text-align: center; }
.login .logo { height: 48px; margin: 4px auto 18px; display: block; }
.login form { text-align: left; }
.login button[type=submit] { width: 100%; }

/* ---------- dashboard ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 26px 0 16px; }
.page-head h1 { margin: 0; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { min-height: 38px; padding: 6px 16px; font-size: .9rem; border-color: var(--line); color: var(--ink); background: var(--card); }
.tabs button:hover { border-color: var(--navy-2); background: var(--card); color: var(--navy); }
.tabs button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tabs .n { opacity: .7; font-weight: 500; margin-left: 2px; }
.search { margin-left: auto; width: min(320px, 100%); }
.list { padding: 4px 0; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: pre-line; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, transparent); }
th { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding-top: 12px; padding-bottom: 12px; }
.who strong { font-size: 1rem; color: var(--ink); }
.who .muted { font-size: .85rem; word-break: break-all; }
.when { font-size: .9rem; white-space: nowrap; } .when .muted { display: block; font-size: .8rem; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }

.pill { font-family: var(--font-body); display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.pill { --c: var(--muted); }
.pill.viewed, .pill.partial { --c: var(--warn); }
.pill.signed { --c: var(--ok); }
.pill.expired, .pill.revoked { --c: var(--bad); }
.sub { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.dots { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--warn); }
.dots i.on { background: var(--ok); border-color: var(--ok); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 14, 30, .6); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 0 14px; overflow: auto; z-index: 50; }
.modal { width: 100%; max-width: 780px; padding: 26px 26px 0; margin: 4vh 0; }
.modal .sticky-actions { position: sticky; bottom: 0; background: var(--card); padding: 14px 0 18px; margin-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
.modal table th { width: 34%; text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.modal td { padding: 9px 12px; }
.linkbox { display: flex; gap: 8px; } .linkbox input { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85rem; }
details.terms { margin: 14px 0 4px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
details.terms summary { cursor: pointer; font-weight: 600; color: var(--navy); }

@media (max-width: 760px) {
  .brand .sep, .brand .title { display: none; }
  .search { margin-left: 0; width: 100%; }
  .list { background: transparent; border: 0; box-shadow: none; padding: 0; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
  td { border: 0; padding: 4px 0; }
  td.matter, td.created { display: none; }
}

/* ---------- signing page ---------- */
.sbar { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.sbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 60px; padding-top: 7px; padding-bottom: 7px; }
.sbar img.logo { height: 30px; width: auto; flex: none; }
.sbar .prog { flex: 1; font-size: .88rem; font-weight: 500; min-width: 0; }
.bar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 5px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--navy-2); border-radius: 4px; transition: width .25s; }
.intro { max-width: 860px; margin: 22px auto 14px; padding: 0 16px; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 0 0 28px; }
.page { position: relative; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); border-radius: 3px; }
.page canvas { display: block; width: 100%; height: 100%; }
.hot { position: absolute; padding: 0; min-height: 0; border: 2px dashed var(--hot-line); background: var(--hot); border-radius: 5px; color: var(--hot-ink); font-size: 11px; font-weight: 600; line-height: 1.15; text-align: center; display: flex; align-items: center; justify-content: center; }
.hot:hover { background: var(--hot); border-color: var(--hot-line); color: var(--hot-ink); transform: none; }
.hot.done { border: 2px solid var(--ok); background: #fff; }
.hot.done:hover { background: #fff; border-color: var(--ok); }
.hot img { max-width: 92%; max-height: 92%; }
.hot.pulse { animation: pulse 1s 2; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--hot-line) 40%, transparent); } }
@media (prefers-reduced-motion: reduce) { .hot.pulse { animation: none; } button, .btn { transition: none; } }
.datetxt { position: absolute; color: #000; font-family: Arial, sans-serif; white-space: nowrap; }
.submit { width: min(860px, calc(100% - 32px)); margin: 0 auto 60px; }
.pad { width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm); touch-action: none; display: block; cursor: crosshair; }
.typed { font-family: "Dancing Script", cursive; font-size: 2rem; }
.center { text-align: center; }
.msg-logo { height: 46px; width: auto; margin: 0 auto 16px; display: block; }

/* ---------- call intake console ---------- */
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .92rem; color: var(--ink); }
.nav a:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.nav a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cards h3 { margin-top: 0; }
ul.switches { list-style: none; margin: 0; padding: 0; }
ul.switches li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
ul.switches li:last-child { border-bottom: 0; }
.pill.on { --c: var(--ok); } .pill.off { --c: var(--muted); } .pill.bad { --c: var(--bad); } .pill.warnpill { --c: var(--warn); }
@media (max-width: 760px) { .nav { order: 3; width: 100%; } .topbar .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; } }
