/* digid web demo: the chrome around the SDK's drop-in flow (the look switcher, the step toggles,
   the "returned to the app" line). Scoped to the mount point (`.digid-demo`, added by
   digid-demo.js); every class is `dd-` prefixed and every rule sits under `.digid-demo`, so the
   demo can live inside the public site's pages without fighting site.css. The flow itself
   (`.digid-flow`, `df-` classes) brings its own stylesheet through @digid/sdk/ui. Colours
   read the site's custom properties when the host page defines them, with the same values as
   fallbacks for the standalone page. No inline styles anywhere (`style-src 'self'`). */

.digid-demo {
  --dd-ube: var(--ube, #3f48fd);
  --dd-card: var(--card, #ffffff);
  --dd-ink: var(--ink, #000000);
  --dd-muted: var(--muted, #5a5a5a);
  --dd-hairline: var(--hairline, #d4d4d4);
  --dd-track: #ececec;
  display: block;
  color: var(--dd-ink);
  font-size: 16px;
  line-height: 24px;
  text-align: left;
}
.digid-demo *, .digid-demo *::before, .digid-demo *::after { box-sizing: border-box; }
.digid-demo [hidden] { display: none !important; }
.digid-demo p { margin: 0; }
.digid-demo button, .digid-demo input { font: inherit; color: inherit; margin: 0; }
.digid-demo :focus { outline: none; }
.digid-demo :focus-visible { outline: 2px solid var(--dd-ube); outline-offset: 3px; border-radius: 6px; }

/* The loading screen: a count to 100 while the engine and the card models download. */
.digid-demo .dd-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; min-height: min(560px, 70svh); padding: 48px 24px; border-radius: 32px; background: var(--dd-card); text-align: center; }
.digid-demo .dd-loader-pct { font-size: clamp(64px, 9vw, 112px); line-height: 1; font-weight: 300; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.digid-demo .dd-loader-pct small { font-size: .42em; margin-left: .06em; color: var(--dd-muted); letter-spacing: 0; }
.digid-demo .dd-loader-bar { width: min(360px, 80%); height: 4px; border-radius: 4px; background: var(--dd-track); overflow: hidden; }
.digid-demo .dd-loader-bar i { display: block; height: 100%; width: var(--dd-pct, 0%); background: var(--dd-ube); transition: width .25s ease-out; }
.digid-demo .dd-loader-text { font-size: 15px; color: var(--dd-muted); }
.digid-demo .dd-loader.is-error .dd-loader-pct, .digid-demo .dd-loader.is-error .dd-loader-bar { display: none; }
@media (prefers-reduced-motion: reduce) { .digid-demo .dd-loader-bar i { transition: none; } }

.digid-demo .dd-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.digid-demo .dd-seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 999px; background: var(--dd-track); }
.digid-demo .dd-seg button { border: 0; background: transparent; padding: 0 14px; height: 32px; border-radius: 999px; font-size: 14px; color: var(--dd-muted); cursor: pointer; }
.digid-demo .dd-seg button[aria-pressed="true"] { background: var(--dd-card); color: var(--dd-ink); }
.digid-demo .dd-toggles { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.digid-demo .dd-toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--dd-ink); cursor: pointer; }
.digid-demo .dd-switch { appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--dd-hairline); position: relative; cursor: pointer; transition: background-color .15s ease; }
.digid-demo .dd-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.digid-demo .dd-switch:checked { background: var(--dd-ube); }
.digid-demo .dd-switch:checked::after { transform: translateX(16px); }

.digid-demo .dd-outcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-top: 16px; padding: 12px 20px; border-radius: 16px; background: var(--dd-card); }
.digid-demo .dd-outcome-text { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; }
.digid-demo .dd-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dd-muted); flex: none; }
.digid-demo .dd-dot-pass { background: #15803d; }
.digid-demo .dd-dot-review { background: #b45309; }
.digid-demo .dd-dot-fail { background: #b42318; }
.digid-demo .dd-link { display: inline-flex; align-items: center; gap: .3em; padding: 6px 0; border: 0; background: none; font-size: 15px; color: var(--dd-ink); cursor: pointer; }
.digid-demo .dd-link:hover { color: var(--dd-ube); }

.digid-demo .dd-config { margin-top: 16px; font-size: 14px; color: var(--dd-muted); }
.digid-demo .dd-config summary { cursor: pointer; width: max-content; }
.digid-demo .dd-config pre { margin: 8px 0 0; padding: 12px 16px; border-radius: 16px; background: var(--dd-card); color: var(--dd-ink); font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }

@media (max-width: 520px) {
  .digid-demo .dd-toolbar { flex-direction: column; align-items: flex-start; }
}
