/* BeamField embeddable UI. Scoped to bf-* selectors so nothing leaks into the host form.
   Host pages may theme the trigger with --bf-trigger-bg, --bf-trigger-fg, --bf-trigger-border and --bf-trigger-hover. */
/* Display face: D-DIN Bold, served beside this stylesheet (SIL Open Font License 1.1). If the host page
   blocks it, the stack below falls back to the platform DIN faces. */
@font-face { font-family: "D-DIN"; src: url("fonts/D-DIN-Bold.woff2") format("woff2"); font-weight: 600 900; font-style: normal; font-display: swap; }

:root.bf-modal-open,
:root.bf-modal-open body { overflow: hidden !important; }

.bf-trigger,
.bf-backdrop {
  --bf-ink: #0c0c0d;
  --bf-ink-hover: #26262a;
  --bf-muted: #55555b;
  --bf-faint: #66666c;
  --bf-line: #dcdcdf;
  --bf-paper: #ffffff;
  --bf-soft: #f4f4f5;
  --bf-signal: #ffd60a;
  --bf-signal-wash: #fff5bf;
  --bf-accent: #0c0c0d;
  --bf-success: #0a7a43;
  --bf-danger: #c0271c;
  --bf-font-micro: 14px;
  --bf-font-caption: 15px;
  --bf-font-small: 16px;
  --bf-font-body: 17px;
  --bf-sans: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --bf-display: "D-DIN", "DIN Alternate", "Bahnschrift", "DIN 2014", "Roboto Condensed", "Segoe UI Variable Display", system-ui, sans-serif;
  --bf-ease-out: cubic-bezier(.16, 1, .3, 1);
  --bf-ease-snap: cubic-bezier(.22, 1, .36, 1);
}

.bf-trigger {
  position: relative;
  min-height: 52px;
  padding: 0 18px;
  border: 2px solid var(--bf-trigger-border, var(--bf-ink));
  border-radius: 4px;
  background: var(--bf-trigger-bg, var(--bf-ink));
  color: var(--bf-trigger-fg, #fff) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-family: var(--bf-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  /* The label never gets cropped: in a column narrower than the button it wraps onto two lines. */
  box-sizing: border-box;
  max-width: 100%;
  text-align: center;
  transition: background-color .14s ease, transform .14s var(--bf-ease-out);
}
/* On its own line, the width of the field or drop zone above it. */
.bf-trigger.bf-trigger-block { display: flex; width: 100%; margin: 10px 0 0; }
.bf-trigger[hidden] { display: none !important; }
.bf-trigger svg { width: 20px; height: 20px; flex: 0 0 20px; }
.bf-trigger:hover { background: var(--bf-trigger-hover, var(--bf-ink-hover)); }
.bf-trigger:hover svg { animation: bf-nudge .5s var(--bf-ease-snap); }
.bf-trigger:active { transform: scale(.97); }
.bf-trigger:focus-visible { outline: 2px solid var(--bf-ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--bf-signal); }
.bf-trigger[aria-busy="true"] { opacity: .6; cursor: progress; }

.bf-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 20px;
  overflow: auto;
  display: grid;
  place-items: center;
  background: rgba(12,12,13,.62);
  color: var(--bf-ink);
  font-family: var(--bf-sans);
  font-size: var(--bf-font-body);
  line-height: 1.45;
  animation: bf-fade .2s ease both;
}
.bf-backdrop *, .bf-backdrop *::before, .bf-backdrop *::after { box-sizing: border-box; }
.bf-backdrop ::selection { background: var(--bf-signal); color: var(--bf-ink); }

.bf-dialog {
  width: min(100%, 720px);
  padding: 24px;
  border: 2px solid var(--bf-ink);
  border-radius: 8px;
  background: var(--bf-paper);
  box-shadow: 0 2px 4px rgba(12,12,13,.08), 0 32px 64px -20px rgba(12,12,13,.5);
  animation: bf-rise .42s var(--bf-ease-out) both;
}
.bf-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.bf-title-wrap { min-width: 0; flex: 1; }
.bf-brandline { margin: 0 0 12px; display: inline-flex; align-items: center; gap: 10px; color: var(--bf-muted); font-size: var(--bf-font-small); font-weight: 650; }
.bf-brandline-mark { width: 36px; height: 36px; flex: 0 0 36px; overflow: hidden; border-radius: 11px; background: var(--bf-accent); color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 700; }
.bf-brandline-mark img { width: 100%; height: 100%; object-fit: cover; }
.bf-top h2, .bf-success h2 { margin: 0; font-family: var(--bf-display); font-size: clamp(30px, 4vw, 40px); line-height: 1; letter-spacing: -.015em; font-weight: 700; text-wrap: balance; }
.bf-subtitle { max-width: 470px; margin: 8px 0 0; color: var(--bf-muted); font-size: var(--bf-font-small); }
.bf-close { width: 44px; height: 44px; flex: 0 0 44px; padding: 10px; border: 2px solid var(--bf-ink); border-radius: 4px; background: var(--bf-paper); color: var(--bf-ink) !important; display: grid; place-items: center; cursor: pointer; transition: background-color .14s ease, transform .14s var(--bf-ease-out); }
.bf-close svg { width: 100%; height: 100%; }
.bf-close:hover { background: var(--bf-soft); }
.bf-close:active, .bf-copy:active, .bf-done:active { transform: scale(.96); }
.bf-close:focus-visible, .bf-copy:focus-visible, .bf-done:focus-visible { outline: 2px solid var(--bf-ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--bf-signal); }

.bf-body { margin-top: 22px; display: grid; grid-template-columns: 236px minmax(0,1fr); gap: 28px; align-items: center; }

/* The code sits inside viewfinder brackets. They tighten once a phone has it. */
.bf-qr-shell { --bf-gap: 0px; position: relative; width: 236px; max-width: 100%; margin: 0; padding: 10px; background: var(--bf-paper); }
.bf-qr-shell::before, .bf-qr-shell::after { content: ""; position: absolute; inset: var(--bf-gap); border: 4px solid var(--bf-signal); pointer-events: none; transition: inset .5s var(--bf-ease-snap), border-color .2s ease; }
.bf-qr-shell::before { clip-path: polygon(0 0, 30px 0, 30px 30px, 0 30px, 0 calc(100% - 30px), 30px calc(100% - 30px), 30px 100%, 0 100%); }
.bf-qr-shell::after { clip-path: polygon(100% 0, calc(100% - 30px) 0, calc(100% - 30px) 30px, 100% 30px, 100% calc(100% - 30px), calc(100% - 30px) calc(100% - 30px), calc(100% - 30px) 100%, 100% 100%); }
.bf-dialog:not([data-state="waiting"]) .bf-qr-shell { --bf-gap: 8px; }
.bf-dialog:not([data-state="waiting"]) .bf-qr-shell::before, .bf-dialog:not([data-state="waiting"]) .bf-qr-shell::after { border-color: var(--bf-ink); }
.bf-qr { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.bf-qr-brand { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; transform: translate(-50%,-50%); border: 4px solid var(--bf-paper); border-radius: 11px; background: var(--bf-accent); color: #fff; display: grid; place-items: center; overflow: hidden; font-size: 14px; font-weight: 700; box-sizing: content-box !important; }
.bf-qr-brand img { width: 100%; height: 100%; object-fit: cover; }
/* Modules print in, a few at a time. */
.bf-qr-tiles { position: absolute; inset: 10px; display: grid; grid-template-columns: repeat(8, 1fr); pointer-events: none; }
.bf-qr-tiles i { background: var(--bf-paper); animation: bf-tile .01s linear both; }
.bf-qr-linked { position: absolute; inset: 10px; padding: 12px; border-radius: 13px; background: var(--bf-signal); display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; font-family: var(--bf-display); font-size: 20px; font-weight: 700; line-height: 1.1; opacity: 0; transform: scale(.92); pointer-events: none; transition: opacity .2s ease, transform .5s var(--bf-ease-snap); }
.bf-qr-linked svg { width: 48px; height: 48px; padding: 9px; border-radius: 15px; background: var(--bf-ink); color: var(--bf-signal); }
.bf-qr-linked path, .bf-success-mark path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.bf-dialog:not([data-state="waiting"]) .bf-qr-linked { opacity: 1; transform: none; }
.bf-dialog:not([data-state="waiting"]) .bf-qr-linked path { stroke-dashoffset: 0; transition: stroke-dashoffset .5s var(--bf-ease-out) .15s; }
.bf-dialog[data-state="failed"] .bf-qr-linked { opacity: 0; }

.bf-side { min-width: 0; display: grid; gap: 16px; }
.bf-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.bf-steps li { position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; color: var(--bf-faint); font-size: var(--bf-font-small); transition: color .24s ease; }
.bf-steps li::before { content: ""; width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%; background: var(--bf-paper); box-shadow: inset 0 0 0 2px var(--bf-line); transition: background-color .24s ease, box-shadow .24s ease, transform .5s var(--bf-ease-snap); }
.bf-steps li + li::after { content: ""; position: absolute; left: 6px; top: -13px; height: 26px; border-left: 2px dotted var(--bf-line); }
.bf-dialog[data-state="waiting"] .bf-steps li:nth-child(1),
.bf-dialog:is([data-state="connecting"], [data-state="handshaking"], [data-state="connected"]) .bf-steps li:nth-child(2),
.bf-dialog:is([data-state="receiving"], [data-state="complete"]) .bf-steps li:nth-child(3) { color: var(--bf-ink); font-weight: 650; }
.bf-dialog[data-state="waiting"] .bf-steps li:nth-child(1)::before,
.bf-dialog:is([data-state="connecting"], [data-state="handshaking"], [data-state="connected"]) .bf-steps li:nth-child(2)::before,
.bf-dialog:is([data-state="receiving"], [data-state="complete"]) .bf-steps li:nth-child(3)::before { background: var(--bf-signal); box-shadow: inset 0 0 0 2px var(--bf-ink); transform: scale(1.25); }
.bf-dialog:not([data-state="waiting"], [data-state="failed"]) .bf-steps li:nth-child(1)::before,
.bf-dialog:is([data-state="receiving"], [data-state="complete"]) .bf-steps li:nth-child(2)::before { background: var(--bf-ink); box-shadow: none; }
.bf-dialog:not([data-state="waiting"], [data-state="failed"]) .bf-steps li:nth-child(1),
.bf-dialog:is([data-state="receiving"], [data-state="complete"]) .bf-steps li:nth-child(2) { color: var(--bf-ink); }

.bf-status-panel { padding: 14px 16px; background: var(--bf-soft); display: grid; gap: 10px; }
.bf-status { min-height: 24px; display: flex; align-items: center; gap: 10px; font-size: var(--bf-font-small); font-weight: 650; }
.bf-status-text { min-width: 0; overflow-wrap: anywhere; }
.bf-status-text.is-error { color: var(--bf-danger); }
.bf-dot { width: 12px; height: 12px; flex: 0 0 12px; border-radius: 50%; background: var(--bf-signal); box-shadow: inset 0 0 0 1.5px var(--bf-ink); animation: bf-blink 1.2s steps(2, jump-none) infinite; }
.bf-dot[data-live="true"] { background: var(--bf-success); box-shadow: none; animation: none; }
.bf-progress { height: 8px; overflow: hidden; background: var(--bf-line); }
.bf-progress span { display: block; width: 0; height: 100%; background: var(--bf-ink); transition: width .12s linear; }
.bf-progress.is-hidden { display: none; }
/* The promise the visitor needs before pointing a camera at a code: what protects the file, in a
   bold line, and where it goes, in plain words. A frame of its own, not a grey footnote. */
.bf-trust-line { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--bf-ink); border-radius: 4px; color: var(--bf-ink); font-size: var(--bf-font-caption); line-height: 1.35; }
.bf-trust-line svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.bf-trust-line strong { display: block; font-weight: 700; }
.bf-trust-line small { display: block; font-size: inherit; color: var(--bf-muted); }
/* The visitor sees the customer's brand at the top of the dialog; this is where they learn who
   protects the file. The mark and the name never break apart. */
.bf-by { white-space: nowrap; }
.bf-trust-line .bf-mark { display: inline-block; width: 20px; height: 20px; margin: 0 6px 0 3px; vertical-align: -4px; flex: none; }
/* The name is set as on the site: the display face, bold, a little larger than the sentence. */
.bf-wordmark { font-family: var(--bf-display); font-size: 1.15em; font-weight: 700; letter-spacing: -.01em; }
/* A logo is shown whole, on white, with a hairline so a white-edged logo still has an outline. */
.bf-brandline-mark.bf-has-logo, .bf-qr-brand.bf-has-logo { background: #fff; color: var(--bf-ink); }
.bf-brandline-mark.bf-has-logo { outline: 1px solid var(--bf-line); outline-offset: -1px; }
.bf-brandline-mark.bf-has-logo img, .bf-qr-brand.bf-has-logo img { object-fit: contain; }
.bf-backdrop, .bf-trigger { text-wrap: pretty; }
.bf-side-footer { min-height: 44px; padding-top: 12px; border-top: 1px solid var(--bf-line); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; color: var(--bf-faint); font-size: var(--bf-font-micro); font-variant-numeric: tabular-nums; }
.bf-copy { min-height: 40px; padding: 0 14px; border: 2px solid var(--bf-ink); border-radius: 4px; background: var(--bf-paper); color: var(--bf-ink) !important; cursor: pointer; font-family: var(--bf-display); font-size: var(--bf-font-small); font-weight: 700; line-height: 1; transition: background-color .14s ease, transform .14s var(--bf-ease-out); }
.bf-copy:hover { background: var(--bf-soft); }

.bf-success { max-width: 460px; margin: 0 auto; padding: 16px 0 0; text-align: center; display: grid; justify-items: center; gap: 0; }
.bf-success-mark { width: 64px; height: 64px; margin: 0 0 18px; padding: 13px; background: var(--bf-signal); color: var(--bf-ink); box-shadow: inset 0 0 0 2px var(--bf-ink); animation: bf-pop .5s var(--bf-ease-snap) both; }
.bf-success-mark svg { width: 100%; height: 100%; }
.bf-success-mark path { animation: bf-draw .5s var(--bf-ease-out) .2s both; }
.bf-success-file { width: min(100%, 360px); margin: 20px 0 0; padding: 10px; box-shadow: inset 0 0 0 2px var(--bf-ink); background: var(--bf-signal-wash); display: flex; align-items: center; gap: 12px; text-align: left; animation: bf-rise .5s var(--bf-ease-out) .12s both; }
.bf-success-file > span { min-width: 56px; height: 44px; padding: 0 10px; background: var(--bf-ink); color: var(--bf-paper); display: inline-flex; align-items: center; justify-content: center; font-family: var(--bf-display); font-size: var(--bf-font-micro); font-weight: 700; }
.bf-success-file > div { min-width: 0; display: grid; gap: 2px; }
.bf-success-file strong { font-size: var(--bf-font-small); }
.bf-success-file small { color: var(--bf-muted); font-size: var(--bf-font-micro); }
.bf-note { margin: 14px 0 0; color: var(--bf-muted); font-size: var(--bf-font-caption); }
.bf-done { width: 100%; min-height: 54px; margin-top: 20px; border: 2px solid var(--bf-ink); border-radius: 4px; background: var(--bf-ink); color: #fff !important; cursor: pointer; font-family: var(--bf-display); font-size: 19px; font-weight: 700; line-height: 1; transition: background-color .14s ease, transform .14s var(--bf-ease-out); }
.bf-done:hover { background: var(--bf-ink-hover); }

@keyframes bf-fade { from { opacity: 0; } }
@keyframes bf-rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes bf-tile { to { opacity: 0; } }
@keyframes bf-blink { 50% { opacity: .3; } }
@keyframes bf-pop { from { opacity: 0; transform: scale(.5); } }
@keyframes bf-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes bf-nudge { 40% { transform: rotate(-12deg); } 70% { transform: rotate(8deg); } }

@media (max-width: 760px) {
  .bf-backdrop { padding: 0; place-items: end center; }
  .bf-dialog { width: 100%; padding: 20px 16px max(18px,env(safe-area-inset-bottom)); border-width: 2px 0 0; border-radius: 12px 12px 0 0; animation-name: bf-sheet; }
  .bf-top h2, .bf-success h2 { font-size: 30px; }
  .bf-body { grid-template-columns: 1fr; gap: 16px; }
  .bf-qr-shell { width: min(62vw,220px); margin-inline: auto; }
  .bf-steps { display: none; }
  .bf-side { gap: 12px; }
}
@keyframes bf-sheet { from { transform: translateY(100%); } }

@media (max-width: 600px) {
  .bf-backdrop { --bf-font-micro: 15px; --bf-font-caption: 16px; --bf-font-small: 17px; --bf-font-body: 18px; }
  .bf-qr-shell { width: min(60vw,204px); }
  .bf-copy { flex: 1 1 100%; min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .bf-backdrop, .bf-dialog, .bf-success-mark, .bf-success-mark path, .bf-success-file, .bf-dot, .bf-trigger:hover svg { animation: none !important; }
  .bf-qr-tiles { display: none; }
  .bf-trigger, .bf-progress span, .bf-qr-shell::before, .bf-qr-shell::after, .bf-qr-linked, .bf-steps li, .bf-steps li::before { transition: none !important; }
}
