/*
 * Junipero brand layer for DocuSeal.
 *
 * Loaded from the shared head template on every page. It is linked BEFORE
 * DocuSeal's own compiled stylesheet, so every rule here is prefixed with
 * html[data-theme="docuseal"] to win on specificity instead of order.
 *
 * Values come from the Junipero design system (tokens.json). The mid teal
 * (#029fb8) is 3.2:1 on white, so it is used for fills only, never small text.
 *
 * DocuSeal's "Powered by DocuSeal" attribution must stay visible (AGPL
 * additional term). Do not hide it here.
 */

@font-face {
  font-family: "Archivo";
  src: url("/brand/fonts/Archivo-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Archivo Black";
  src: url("/brand/fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

/* daisyUI v3 theme slots, as "H S% L%" triples. */
html[data-theme="docuseal"] {
  --p: 194 58% 92%;   /* primary: panel #ddf0f6 (DocuSeal's primary is a pale fill) */
  --pf: 194 53% 85%;
  --pc: 193 79% 13%;  /* teal-dark text on it */

  --s: 321 100% 36%;  /* secondary: magenta #b90078 */
  --sf: 321 100% 30%;
  --sc: 0 0% 100%;

  --a: 188 98% 36%;   /* accent: teal #029fb8, fills only */
  --af: 188 98% 30%;
  --ac: 193 82% 11%;  /* teal-darker text on it, 4.9:1 */

  --n: 191 92% 25%;   /* neutral: teal-deep #056278, the main button fill (white on it is 6.9:1) */
  --nf: 193 79% 13%;  /* hover and focus: teal-dark #07313d */
  --nc: 0 0% 100%;

  --b1: 0 0% 100%;    /* page: white */
  --b2: 195 55% 96%;  /* #eef7fa */
  --b3: 194 58% 92%;  /* panel #ddf0f6 */
  --bc: 195 60% 12%;  /* ink #0c2730 */

  --rounded-btn: 999px;     /* every button is a pill */
  --rounded-box: 1.125rem;  /* radius-card 18px */
  --rounded-badge: 999px;
}

html[data-theme="docuseal"],
html[data-theme="docuseal"] body {
  font-family: "Archivo", system-ui, sans-serif;
}

html[data-theme="docuseal"] h1,
html[data-theme="docuseal"] h2 {
  font-family: "Archivo Black", "Archivo", sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #07313d;
}

html[data-theme="docuseal"] .btn {
  font-weight: 600;
}

/* Inline links: magenta signal colour (6.3:1 on white). */
html[data-theme="docuseal"] main a.link {
  color: #b90078;
}

/* "Powered by DocuSeal" footer on staff pages (added in the Dockerfile). */
html[data-theme="docuseal"] .jx-attribution {
  margin: 2rem auto 1.5rem;
  font-size: 0.8125rem;
  color: #496872;
}

/* The brand gradient as a thin bar across the top of every page. */
html[data-theme="docuseal"] body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #56c8da 0%, #029fb8 50%, #b90078 100%);
}

/* DocuSeal hard-codes a cream background (#faf7f5) on the template builder's
   sticky bars, which shows as a tinted band on a white page. */
html[data-theme="docuseal"] #title_container,
html[data-theme="docuseal"] template-builder [style*="250, 247, 245"],
html[data-theme="docuseal"] template-builder [style*="faf7f5"] {
  background-color: #ffffff !important;
}

/* Text areas take the card radius. The pill radius set for buttons would
   otherwise turn a multi-line box (the decline reason) into a lozenge. */
html[data-theme="docuseal"] textarea,
html[data-theme="docuseal"] .textarea,
html[data-theme="docuseal"] .base-textarea {
  border-radius: 1.125rem !important;
}

/* The square +J photo mark. */
html[data-theme="docuseal"] .jx-mark {
  border-radius: 22%;
  object-fit: cover;
  flex: none;
}

html[data-theme="docuseal"] .jx-product {
  font-family: "Archivo", system-ui, sans-serif;
  font-style: italic;
  font-weight: 600;
  color: #07313d;
  letter-spacing: -0.01em;
}

/* The template builder draws DocuSeal's logo from compiled code, so it cannot
   be replaced by a template override. Paint the +J mark over it instead. */
html[data-theme="docuseal"] template-builder a > svg[style*="233, 122, 66"],
html[data-theme="docuseal"] template-builder a > svg[style*="e97a42"] {
  background: url("/brand/junipero-icon-photo.png") center / cover no-repeat;
  border-radius: 22%;
}

html[data-theme="docuseal"] template-builder a > svg[style*="233, 122, 66"] > *,
html[data-theme="docuseal"] template-builder a > svg[style*="e97a42"] > * {
  visibility: hidden;
}
