/* Signature Maker — self-hosted signature fonts + tool layout.
   Fonts are Google Fonts latin subsets (SIL OFL 1.1), self-hosted so the
   Type tab works offline and no name is ever sent to a font server. */

@font-face {
  font-family: "Great Vibes";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/great-vibes-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Alex Brush";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/alex-brush-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Allura";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/allura-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Dancing Script";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/dancing-script-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Sacramento";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/sacramento-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/caveat-latin.woff2") format("woff2");
}

.sig-font-great-vibes { font-family: "Great Vibes", cursive; }
.sig-font-alex-brush { font-family: "Alex Brush", cursive; }
.sig-font-allura { font-family: "Allura", cursive; }
.sig-font-dancing-script { font-family: "Dancing Script", cursive; }
.sig-font-sacramento { font-family: "Sacramento", cursive; }
.sig-font-caveat { font-family: "Caveat", cursive; }

/* Trust bar */
.sig-trust {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin: 0 0 16px; padding: 10px 14px;
  background: var(--ok-bg); color: var(--ok);
  border: 1px solid var(--line); border-radius: 12px;
  font-size: .92rem; font-weight: 600;
}

/* Tabs */
.sig-tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.sig-tab {
  flex: 1; appearance: none; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--ink);
  font: inherit; font-weight: 600; min-height: 48px;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
}
.sig-tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.sig-pane[hidden] { display: none !important; }

/* Draw pad: white on screen (like paper), transparent in the export */
.sig-pad-wrap {
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: #fff; overflow: hidden; line-height: 0;
}
#sig-draw-canvas {
  width: 100%; height: auto; display: block;
  touch-action: none; cursor: crosshair; background: #fff;
}
.sig-pad-guide {
  border-top: 1px dashed #cbd2e1; margin: 0 16px; position: relative; top: -64px;
  height: 0; pointer-events: none;
}
.sig-ink-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sig-swatch {
  width: 40px; height: 40px; border-radius: 999px; padding: 0; cursor: pointer;
  border: 2px solid var(--line-strong); background: #fff;
}
.sig-swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

/* Type preview cards */
.sig-type-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 10px; margin: 12px 0 4px;
}
.sig-type-card {
  appearance: none; text-align: left; cursor: pointer;
  background: #fff; color: #111; border: 1.5px solid var(--line-strong);
  border-radius: 12px; padding: 12px 14px 10px; font: inherit;
  display: flex; flex-direction: column; gap: 4px; min-height: 84px;
}
.sig-type-card:hover { border-color: var(--accent); }
.sig-type-card[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}
.sig-type-card .sig-preview-text {
  font-size: 34px; line-height: 1.25; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: var(--sig-ink-preview, #111);
}
.sig-type-card .sig-font-name { font-size: .8rem; font-weight: 600; color: #5b6577; }

/* Upload + export previews on a checkerboard so transparency is visible */
.sig-checker {
  background: repeating-conic-gradient(var(--checker-a) 0% 25%, var(--checker-b) 0% 50%) 0 0 / 20px 20px;
  border: 1px solid var(--line); border-radius: 12px;
  display: grid; place-items: center; padding: 14px; overflow: auto;
}
.sig-checker canvas, .sig-checker img { max-width: 100%; height: auto; max-height: 320px; }
.sig-checker.on-white { background: #fff; }

/* Export summary + forms success state */
.sig-export-info { font-weight: 600; margin: 10px 0 0; }
.sig-forms-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 10px 0 0; padding: 8px 14px; border-radius: 999px;
  background: var(--ok-bg); color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  font-weight: 700; font-size: .95rem;
}
.sig-forms-badge[hidden] { display: none; }
.sig-forms-badge.fail {
  background: var(--danger-bg); color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
