/* AG-APP-MATCH-1: the account holder theme layer. Loaded last, only on the account holder's pages (dashboard, account, studio, white label setup,
 * sign-in and the other front-door pages, Help). It is never loaded on a signer page. Tokens come from /canon.css (lifted from the marketing site).
 *
 * The gold rule: OLD GOLD is the account holder's actions only (primary buttons, calls to action). Bright gold, for the signing process, has no
 * value in the site's stylesheet and is not used. Flat straight-on panels, hairline lines, no gradients, no glows, no rotation. */

/* ---- the app header: neutral charcoal, the wordmark and the account actions ---- */
.bar,
.topbar {
  background: var(--canon-header);
  border-bottom: 1px solid var(--canon-border);
}
.bar { position: sticky; top: 0; z-index: 50; padding: 12px 24px; }
.bar-actions { align-items: center; }
.bar .btn,
.topbar .btn-outline {
  background: transparent;
  border-color: var(--canon-border-strong);
  color: var(--canon-text);
}
.bar .btn:hover,
.topbar .btn-outline:hover { background: var(--canon-raised); border-color: var(--canon-border-strong); }
.bar .btn[aria-current="page"],
.topbar .btn[aria-current="page"] { border-color: var(--canon-text); }
.topbar .account-name { color: var(--canon-muted); font-weight: 500; }

/* ---- old gold: the account holder's actions ---- */
.btn-primary:not(#btnApplySig):not(:disabled),
.btn-secondary:not(#btnExecuteSign):not(:disabled),
.btn.primary,
.canon-btn:not(.quiet):not(:disabled) {
  background: var(--site-gold);
  border-color: var(--site-gold);
  color: var(--site-on-gold);
}
.btn-primary:not(#btnApplySig):not(:disabled):hover,
.btn-secondary:not(#btnExecuteSign):not(:disabled):hover,
.btn.primary:hover:not(:disabled),
.canon-btn:not(.quiet):not(:disabled):hover {
  background: var(--site-gold-hover);
  border-color: var(--site-gold-hover);
}
/* the signature a person draws for themselves is the signing act, not an account action: it keeps the neutral light button */
#btnApplySig,
#btnExecuteSign:not(:disabled) {
  background: var(--canon-text);
  border-color: var(--canon-text);
  color: var(--canon-on-light);
}
.btn.primary { font-weight: 500; }

/* ---- hover and focus ---- */
.btn:hover,
.btn-outline:hover { border-color: var(--canon-border-strong); }
:focus-visible { outline: 2px solid var(--canon-text); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--canon-text); outline-offset: 0; border-color: var(--canon-border-strong); }

/* ---- plain headings: no capitals, no tracking ---- */
.panel-header h2,
.status-pill,
.meta-label,
.form-label {
  text-transform: none;
  letter-spacing: 0;
}
.panel-header h2 { font-size: 14px; font-weight: 500; color: var(--canon-text); }

/* ---- flat panels, tables and the page ground ---- */
.card, .panel { border-color: var(--canon-border); box-shadow: none; }
.card { border-radius: var(--radius-lg); }
th { font-weight: 500; color: var(--site-text-3); }
th, td { border-bottom-color: var(--canon-border); }
.empty { border-color: var(--canon-border-strong); }

/* ---- the nav entry for Help ---- */
.nav-help { white-space: nowrap; }

/* ---- Help (account holder surface) ---- */
.help-wrap { max-width: 720px; margin: 0 auto; padding: 48px 24px 96px; }
.help-wrap h1 { font-size: 32px; line-height: 1.2; font-weight: 500; letter-spacing: -0.02em; color: var(--canon-text); margin: 0 0 8px; }
.help-wrap .help-lede { color: var(--canon-muted); font-size: 17px; margin: 0 0 32px; }
.help-search { display: block; margin: 0 0 40px; }
.help-search label { display: block; font-size: 14px; font-weight: 500; color: var(--canon-text); margin: 0 0 8px; }
.help-search input { width: 100%; padding: 12px 16px; font-size: 16px; }
.help-cat { margin: 0 0 40px; }
.help-cat h2, .help-article h2 { font-size: 20px; line-height: 1.3; font-weight: 500; color: var(--canon-text); margin: 0 0 8px; }
.help-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--canon-border); }
.help-list li { border-bottom: 1px solid var(--canon-border); }
.help-list a { display: block; padding: 16px 0; text-decoration: none; color: var(--canon-text); }
.help-list a:hover .help-title { text-decoration: underline; text-decoration-color: var(--canon-border-strong); text-underline-offset: 4px; }
.help-title { display: block; font-weight: 500; font-size: 16px; }
.help-summary { display: block; color: var(--canon-muted); font-size: 15px; margin-top: 4px; }
.help-count, .help-none { color: var(--canon-muted); font-size: 15px; margin: 0 0 16px; }
.crumbs { font-size: 14px; color: var(--site-text-3); margin: 0 0 24px; }
.crumbs a { color: var(--canon-muted); }
.help-article .help-lead { color: var(--canon-muted); font-size: 17px; margin: 0 0 32px; }
.help-article h2 { margin-top: 32px; }
.help-article p, .help-article li { color: var(--canon-muted); font-size: 16px; line-height: 1.6; margin: 8px 0 0; }
.help-article ul { margin: 8px 0 0; padding-left: 20px; }
.help-article a, .help-wrap a.text-link { color: var(--canon-text); text-decoration: underline; text-decoration-color: var(--canon-border-strong); text-underline-offset: 4px; }
.help-article a:hover { text-decoration-color: var(--canon-text); }

/* ---- small screens ---- */
@media (max-width: 720px) {
  .bar { padding: 12px 16px; }
  .bar-actions { flex-wrap: wrap; }
  .help-wrap { padding: 32px 16px 64px; }
  .help-wrap h1 { font-size: 28px; }
}

/* ---- AG-WALK-FIX-1 item 1: values entered into placed fields read in clear dark ink, the way they appear in the final PDF.
   The field body is paper (white, like the document), so its text must be paper ink: it was the page's light text color on white, which is nearly invisible. */
.field-tag-input {
  color: var(--site-paper-ink);
  font-size: 12px;
  font-weight: 500;
}
.field-tag-input::placeholder { color: var(--site-paper-2); opacity: 1; }

/* ---- AG-WALK-FIX-1 item 3: one size standard for every button in the app header, buttons and links alike: same height, same padding, same text baseline. */
.bar .btn,
.topbar .btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.topbar .action-group { align-items: center; gap: 6px; padding-right: 10px; }
.topbar .topbar-actions { gap: 10px; }
.topbar { padding-left: 16px; padding-right: 16px; }

/* ---- AG-WALK-FIX-1 item 4: the document history dialog (proof and history of the open document) */
.history-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.history-dialog .modal-card { max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
.history-dialog-body { overflow-y: auto; display: grid; gap: 16px; padding-right: 4px; }
.history-dialog-body .panel { margin: 0; }

/* Narrow windows: the header grows a second row instead of squeezing a button until its words wrap (that is what made some buttons taller than others). */
.topbar { height: auto; min-height: 58px; flex-wrap: wrap; row-gap: 8px; padding-top: 8px; padding-bottom: 8px; }
.topbar .topbar-actions { flex-wrap: wrap; row-gap: 8px; justify-content: flex-end; }
.topbar .action-group { flex-wrap: wrap; row-gap: 8px; }

/* ---- AG-ADMIN-2 item 4: the account name is not a button. It sits centered in the header: the first row of the header is the wordmark on the left and
   the account name in the exact middle; the buttons are the second row, so the name never shares a row with a button. */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "brand name ." "actions actions actions";
  align-items: center;
  row-gap: 6px;
}
.topbar .brand-group { grid-area: brand; }
.topbar .topbar-actions { grid-area: actions; }
.topbar .account-name {
  grid-area: name;
  min-width: 0;
  max-width: 50vw;
  margin: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  user-select: text;
}

/* ---- AG-ADMIN-2 item 1: reminders in the Send panel */
.reminder-box { display: grid; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--canon-border); }
.reminder-box[hidden] { display: none; }
.reminder-box .check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.reminder-box .check-row input { width: 16px; height: 16px; }
.reminder-fields { display: grid; gap: 8px; }
.reminder-field { display: grid; gap: 4px; font-size: 12px; color: var(--canon-muted); }
.reminder-field input { width: 100%; }

/* ---- AG-ADMIN-2 item 2: a signed recipient says why they cannot be corrected; the others get a Correct button */
.signer-locked-note { font-size: 10.5px; color: var(--canon-muted); margin-top: 2px; }
.signer-correct { margin-top: 4px; }
