/*
 * The signer's own look (design tokens, doc 01 / 11, design/handoff-onboarding README §7).
 * Self-hosted fonts only: the CSP allows style-src and font-src 'self' and nothing else.
 * Frame = the prompt inside the app's signer frame (the app draws the frame); window =
 * confirm.html, the top-level signer window for high-risk prompts.
 */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./schibsted-grotesk-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./schibsted-grotesk-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Chivo Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./chivo-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Chivo Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./chivo-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  --bg-page: #0a0a0a;
  --bg-panel: #111111;
  --bg-raised-2: #1f1f1f;
  --text-1: #f4f4f2;
  --text-2: #a3a3a3;
  --text-3: #6e6e6e;
  /* monochrome brand (design/handoff-brand): the signer places no trade, so its primary
     buttons are paper, not gain green; focus rings are live blue */
  --paper: #f4f4f2;
  --paper-hover: #ffffff;
  --on-paper: #0a0a0a;
  --live: #5b8cff;
  --warn: #f2b543;
  --font-ui: "Schibsted Grotesk", system-ui, sans-serif;
  --font-num: "Chivo Mono", monospace;
  color-scheme: dark;
  background: transparent;
}
/* the signer window (confirm.html): the modal surface */
:root[data-surface="window"] {
  background: var(--bg-panel);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: transparent;
  color: var(--text-1);
  font: 400 13px / 1.4 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
:root[data-surface="window"] body {
  overflow: auto;
}

/*
 * Frame: content only, on a transparent background. The parent draws the dashed border, its
 * 4% tint and the origin legend around the iframe, with no padding of its own: the padding
 * below is the frame's inner padding from the designs.
 */
.prompt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px; /* specs/Capabilities 02, trade ticket */
}
/* onboarding "You're all set" / "Welcome back" (SCREENS §10): padding 20 14 14, gap 10 */
.prompt[data-look="start"],
.prompt[data-look="resume"] {
  padding: 20px 14px 14px;
}
.text {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
}
.title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
/* design state "covered" / "Window blocked": warn, 13px, centred in the onboarding looks */
.msg {
  font-size: 13px;
  line-height: 1.45;
}
.msg:empty {
  display: none;
}
.msg[data-tone="warn"] {
  color: var(--warn);
}
.prompt[data-look="start"] .msg,
.prompt[data-look="resume"] .msg {
  text-align: center;
}
/* the wallet-bridge window's label / value grid (Capabilities 02) */
.rows {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 10px;
  font-size: 12px;
  line-height: 1.45;
}
.label {
  color: var(--text-3);
}
.sep {
  grid-column: 1 / -1;
  height: 1px;
  margin: 4px 0;
  background: var(--bg-raised-2);
}
.value {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.actions {
  display: flex;
  gap: 8px;
}

/* Capabilities 02 "Unlock trading": 46px, radius 10, 15/600, paper (brand update) */
.btn {
  height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  font: 600 15px / 1 var(--font-ui);
  cursor: pointer;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn:focus-visible {
  outline: 2px solid var(--live);
  outline-offset: 2px;
}
.primary {
  background: var(--paper);
  color: var(--on-paper);
}
.actions > .primary {
  flex: 1;
  min-width: 0;
}
.primary:enabled:hover {
  background: var(--paper-hover);
}
.secondary {
  flex: 0 0 auto;
  background: var(--bg-raised-2);
  color: var(--text-2);
}
.secondary:enabled:hover {
  color: var(--text-1);
}
/* SCREENS §10: the signer button, 56px, radius 12, 16/600 */
.prompt[data-look="start"] .btn,
.prompt[data-look="resume"] .btn {
  height: 56px;
  border-radius: 12px;
  font-size: 16px;
}

/*
 * Window (confirm.html): laid out like the onboarding modal (SCREENS §0): body padding 28,
 * title 24/600, buttons stacked at the bottom, 52px radius 12 (primary paper, secondary
 * transparent text-2).
 */
:root[data-surface="window"] .prompt {
  min-height: 100vh;
  gap: 20px;
  padding: 24px 28px;
}
:root[data-surface="window"] .mark {
  color: var(--paper);
  font: 400 10px / 13px var(--font-num);
}
:root[data-surface="window"] .title {
  font-size: 24px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
}
:root[data-surface="window"] .rows,
:root[data-surface="window"] .text {
  font-size: 13px;
}
:root[data-surface="window"] .actions {
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}
:root[data-surface="window"] .btn {
  flex: 0 0 auto;
  width: 100%;
  height: 52px;
  border-radius: 12px;
}
:root[data-surface="window"] .secondary {
  background: transparent;
}
