/* nimiq.ninja wallet (/app). Built on @nimiq/style tokens (loaded first).
 * Light page + centered white card, the Nimiq app surface. px values are
 * independent of @nimiq/style's 8px root; nq-* classes keep their rem sizing. */

:root {
  --navy: var(--nimiq-blue);
  --green: var(--nimiq-green);
  --text-muted: rgba(31, 35, 72, 0.6);
  --hairline: rgba(31, 35, 72, 0.1);
  --ease: var(--nimiq-ease);
}

* { box-sizing: border-box; }

/* The [hidden] attribute must win over component display rules (.scanner/.inbox
 * set display, which would otherwise override the UA hidden=none). */
[hidden] { display: none !important; }

body {
  font-family: 'Mulish', 'Muli', system-ui, sans-serif !important;
  background: var(--nimiq-light-gray);
  color: var(--navy);
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid rgba(31, 35, 72, 0.08);
  background: rgba(250, 250, 250, 0.92);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.hexmark { display: block; flex-shrink: 0; }
.wordmark { font-weight: 800; font-size: 19px; color: var(--navy); letter-spacing: -0.01em; }
.dot { color: inherit; }
.green { color: var(--green); }
.net-pill {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Page + card ---------- */
.page {
  padding-top: clamp(28px, 6vw, 56px);
  padding-bottom: 48px;
}
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.111);
  padding: clamp(24px, 5vw, 36px);
}
.card-title {
  font-size: clamp(26px, 5vw, 32px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
  color: var(--navy);
  text-wrap: balance;
  margin: 0 0 12px;
}
.card-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-muted);
  text-wrap: pretty;
  margin: 0 0 22px;
}

/* ---------- Notes (uniform-bordered; no one-sided accent stripe) ---------- */
.note {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 13px 15px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--navy);
  margin: 18px 0;
}
.note strong { font-weight: 700; }
.note-info { background: rgba(31, 35, 72, 0.04); }
.note-warn {
  background: rgba(252, 135, 2, 0.07);
  border-color: rgba(252, 135, 2, 0.4);
}

/* ---------- Phrase input ---------- */
.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  margin: 4px 0 8px;
}
.phrase-input {
  width: 100%;
  font-family: 'Mulish', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--navy);
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px var(--hairline);
  padding: 13px 15px;
  resize: vertical;
  transition: box-shadow 0.2s var(--ease);
}
.phrase-input::placeholder { color: rgba(31, 35, 72, 0.35); }
.phrase-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--nimiq-light-blue);
}

.form-error {
  color: var(--nimiq-red);
  font-size: 14.5px;
  font-weight: 600;
  margin: 14px 0 0;
}

/* ---------- Actions ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}
/* nq-button / nq-button-s come from @nimiq/style; just let them sit inline. */
.actions .nq-button { margin: 0; }

/* ---------- Receive: QR + key boxes ---------- */
.qr-wrap { display: flex; justify-content: center; margin: 4px 0 24px; }
.qr {
  width: clamp(160px, 50vw, 208px);
  background: #fff;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.qr svg { display: block; width: 100%; height: auto; }

.block-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--navy);
  margin: 20px 0 4px;
}
.block-sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.block-sub em { font-style: italic; }

.keybox {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(31, 35, 72, 0.03);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--hairline);
  padding: 12px 12px 12px 14px;
}
.mono {
  flex: 1;
  min-width: 0;
  font-family: 'Fira Mono', 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--navy);
  word-break: break-all;
}
.copy-btn {
  flex-shrink: 0;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background-image: var(--nimiq-light-blue-bg);
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.copy-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); }
.copy-btn:active { transform: translateY(1px); }
.copy-btn:focus-visible { outline: 2px solid var(--nimiq-light-blue); outline-offset: 3px; }

/* ---------- Inbox ---------- */
.scan-status {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 12px 0 0;
}
.scan-status.ok { color: var(--nimiq-green); font-weight: 600; }
.scan-status.error { color: var(--nimiq-red); font-weight: 600; }

.inbox {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.inbox-item {
  background: rgba(31, 35, 72, 0.03);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--hairline);
  padding: 12px 14px;
}
.inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.inbox-head-left { display: flex; align-items: baseline; gap: 10px; }
.amt-in {
  font-weight: 700;
  font-size: 15px;
  color: var(--nimiq-green); /* incoming = green (semantic) */
}
.inbox-meta {
  font-size: 12.5px;
  color: var(--text-muted);
}
.inbox-action { flex-shrink: 0; }
.inbox-action .nq-button-s { margin: 0; }
.swept-link {
  font-weight: 700;
  font-size: 13px;
  color: var(--nimiq-green);
  text-decoration: none;
}
.swept-link:hover { color: var(--navy); }
.inbox-item .addr {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  word-break: break-all;
}

/* ---------- Sweep form (inline, per item) ---------- */
.sweep-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}
.dest-input {
  width: 100%;
  font-family: 'Fira Mono', 'Courier New', monospace;
  font-size: 12.5px;
  color: var(--navy);
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px var(--hairline);
  padding: 11px 13px;
  margin-bottom: 10px;
}
.dest-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--nimiq-light-blue); }
.amount-input {
  width: 100%;
  font-family: 'Mulish', system-ui, sans-serif;
  font-size: 16px;
  color: var(--navy);
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px var(--hairline);
  padding: 11px 13px;
  margin-bottom: 10px;
}
.amount-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--nimiq-light-blue); }
.pay-onetime {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
  word-break: break-all;
}
.scan-row { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.scan-row .nq-button-s { margin: 0; }
.scanner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.scan-video {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  background: #000;
  box-shadow: inset 0 0 0 1px var(--hairline);
}
#sender-addr { font-size: 12.5px; color: var(--navy); }

/* ---------- Encrypted device session (G8) ---------- */
.unlock-card .unlock-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 6px 0 12px;
}
.unlock-card .amount-input { margin-bottom: 12px; }
.remember-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-muted);
  margin: 16px 0 8px;
  cursor: pointer;
}
.remember-row input { margin-top: 2px; flex-shrink: 0; accent-color: var(--nimiq-light-blue); }

/* ---------- Address book (G10) ---------- */
.book-row { margin-bottom: 8px; }
.book-select {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  font-family: 'Mulish', system-ui, sans-serif;
  cursor: pointer;
}
.save-recipient { margin-top: 14px; }
.save-recipient .amount-input { margin-bottom: 8px; }
.sweep-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sweep-row .nq-button { margin: 0; }
.sweep-status { font-size: 13px; color: var(--text-muted); }
.sweep-status.error { color: var(--nimiq-red); font-weight: 600; }
.tx-state { color: var(--text-muted); font-weight: 600; }
.opsec {
  font-size: 13px;
  line-height: 1.45;
  color: var(--nimiq-orange);
  font-weight: 600;
  margin: 0 0 10px;
}
.opsec-note {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 10px 0 0;
}

/* ---------- Footnote ---------- */
.footnote {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 22px auto 0;
}
.footnote a { color: var(--navy); font-weight: 700; text-decoration: none; }
.footnote a:hover { color: var(--green); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
