/* The signer page's frame, cards, buttons and portal views, on the GATE ID tokens of /assets/auth/auth.css (no copy of them here).
   Every class is sg- prefixed so auth.css's own components (.card, .btn, .row...) never restyle this page by accident. */

/* --brand is the org's validated accent (core.mjs applyBranding); without one it is the ink. */
:root { --brand: var(--ink); }
body { font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

.sg-shell { container-type: inline-size; min-height: 100vh; display: flex; flex-direction: column; }
.sg-app { flex: 1; width: 100%; }

/* header: transparent, no bar */
.sg-top { display: flex; align-items: center; gap: 12px; padding: 14px 20px; min-height: 56px; }
.sg-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.sg-brand-logo { height: 28px; width: auto; max-width: 9rem; display: block; }
.sg-brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.sg-select { height: 30px; padding: 0 28px 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center; appearance: none; font-size: 13px; cursor: pointer; }
.sg-signed-with { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); text-decoration: none; }
.sg-wordmark { height: 12px; width: auto; opacity: .6; }

/* footer: (c) year org, then GATE's legal pages */
.sg-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 18px 24px; font-size: 12.5px; color: var(--muted-2); }
.sg-legal { display: flex; flex-wrap: wrap; gap: 14px; }
.sg-legal a { text-decoration: none; }
.sg-legal a:hover { color: var(--ink); text-decoration: underline; }

/* type */
.sg-title { font-family: var(--display); font-weight: 500; font-size: 16px; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: anywhere; }
.sg-title-lg { font-size: 18px; margin-top: 4px; }
.sg-h1 { font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -.02em; }
.sg-hero { font-family: var(--display); font-weight: 500; font-size: 32px; letter-spacing: -.03em; line-height: 1.1; margin: 8px 0 6px; }
.sg-label, .sg-sub-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sg-sub-label { margin-bottom: 10px; }
.eyebrow { font-size: 10.5px; }
.sg-small { font-size: 12.5px; }
.sg-muted { color: var(--muted); }
.sg-strong { font-weight: 500; }
.sg-num { font-variant-numeric: tabular-nums; }
.sg-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-pre { white-space: pre-wrap; }
.sg-grow { flex: 1; min-width: 0; }
.sg-push { margin-left: auto; }
.sg-center { align-items: center; text-align: center; }
.sg-stack { display: flex; flex-direction: column; gap: 12px; }
.sg-stack[hidden] { display: none; }
.sg-row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.sg-kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.sg-ic { width: 16px; height: 16px; flex: none; }

/* cards */
.sg-card { display: flex; flex-direction: column; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 24px 60px -28px oklch(30% .03 60 / .22); min-width: 0; }
.sg-card-title { font-family: var(--display); font-weight: 500; font-size: 16px; letter-spacing: -.02em; }
.sg-card-head { display: flex; align-items: flex-start; gap: 8px; }
.sg-docmeta { margin-top: -6px; }
[data-err]:empty { display: none; }
.sg-note { background: var(--card); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }

/* buttons: pills */
.sg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); font-family: var(--display); font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .12s ease; }
.sg-btn:hover { background: var(--panel-2); border-color: var(--muted-2); }
.sg-btn:active { transform: translateY(1px); }
.sg-btn:disabled { opacity: .5; cursor: default; transform: none; }
.sg-btn[hidden] { display: none; }
.sg-btn.primary { background: var(--brand); border-color: var(--brand); color: var(--bg); }
.sg-btn.primary:hover { filter: brightness(1.15); }
.sg-btn.danger { background: var(--danger); border-color: var(--danger); color: var(--bg); }
.sg-btn.ghost { background: transparent; border-color: transparent; }
.sg-btn.ghost:hover { background: var(--card); }
.sg-btn.wide { width: 100%; }
.sg-btn.sm { height: 30px; padding: 0 12px; font-size: 13px; gap: 6px; }
.sg-btn.icon { width: 36px; height: 36px; padding: 0; }
.sg-btn:focus-visible, .sg-select:focus-visible, .sg-input:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* status dots, avatars, the people list and the activity timeline */
.sg-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted-2); }
.sg-dot.ok { background: var(--ok); }
.sg-dot.wait { background: var(--gold-dp); }
.sg-dot.bad { background: var(--danger); }
.sg-avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--card); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.sg-people { display: flex; flex-direction: column; gap: 12px; }
.sg-person { display: flex; align-items: center; gap: 12px; }
.sg-tl { position: relative; display: flex; flex-direction: column; gap: 12px; padding-left: 20px; }
.sg-tl::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.sg-tl-row { position: relative; display: flex; flex-direction: column; }
.sg-tl-row::before { content: ""; position: absolute; left: -20px; top: 5px; width: 11px; height: 11px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--panel); background: var(--muted); }
.sg-tl-row.ok::before { background: var(--ok); }
.sg-tl-row.bad::before { background: var(--danger); }

/* a state's status card, and the message-only and loading views */
.sg-status { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 6px 0; }
.sg-status .sg-btn { margin-top: 6px; }
.sg-chip { width: 40px; height: 40px; border-radius: 50%; background: var(--card); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.sg-chip .sg-ic { width: 20px; height: 20px; }
.sg-chip.ok { background: color-mix(in oklch, var(--ok) 16%, var(--panel)); color: var(--ok-ink); }
.sg-chip.bad { background: color-mix(in oklch, var(--danger) 12%, var(--panel)); color: var(--danger); }
.sg-narrow-view { max-width: 440px; margin: 0 auto; padding: 64px 20px 24px; }
.sg-skel { background: var(--card); border-radius: 16px; animation: sg-pulse 1.6s ease-in-out infinite; }
.sg-skel-page { aspect-ratio: 1 / 1.414; width: 100%; }
@keyframes sg-pulse { 50% { opacity: .55; } }

/* alerts and inputs */
.sg-alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-size: 14px; line-height: 1.45; }
.sg-alert .sg-ic { margin-top: 2px; }
.sg-alert .sg-btn { margin-top: 8px; }
.sg-alert.bad { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 30%, transparent); background: color-mix(in oklch, var(--danger) 6%, var(--panel)); }
.sg-input { display: block; width: 100%; height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); font-size: 16px; outline: none; }
.sg-input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px oklch(52% .11 65 / .16); }
.sg-textarea { height: auto; min-height: 88px; padding: 12px 16px; resize: vertical; }
.sg-error-line { color: var(--danger); font-size: 12.5px; }
.sg-field-label { font-size: 13px; font-weight: 500; }

/* portal: sign in */
.sg-login { padding: 30px 26px 26px; gap: 14px; }
.sg-login-head { text-align: center; margin-bottom: 6px; }
.sg-login .number { margin: 4px 0; }
.sg-login .number.sg-bad > input { border-color: var(--danger); }

/* portal: the document list */
.sg-docs-view { max-width: 48rem; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.sg-docs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tabs.sg-tabs-fit { display: inline-flex; align-self: flex-start; margin: 0; }
.sg-tabs-fit .tab { flex: none; padding: 7px 14px; display: inline-flex; align-items: center; gap: 8px; }
.sg-count { font-family: var(--sans); font-size: 12px; background: var(--card); border-radius: 999px; padding: 0 7px; }
.tab.active .sg-count { background: var(--card); }
.sg-doc-list { padding: 0; gap: 0; overflow: hidden; }
.sg-doc-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.sg-doc-row + .sg-doc-row { border-top: 1px solid var(--line); }
.sg-row-pad { width: 60px; flex: none; }

@container (max-width: 560px) {
  .sg-docs-view { padding: 16px 12px; }
  .sg-doc-row { padding: 12px; gap: 10px; }
  .sg-narrow-view { padding: 32px 12px 16px; }
  .sg-hero { font-size: 28px; }
}

/* touch targets: 44px is the smallest a thumb hits reliably, on any width tapped with one */
@media (pointer: coarse) {
  .sg-btn.sm, .sg-select { min-height: 44px; }
  .sg-btn.icon { width: 44px; height: 44px; }
}
