/* nimiq.cards — app layout on top of the Nimiq legacy design system.
 * nimiq-style sets html{font-size:8px}, so custom values here are in px (or rem x2). */

body {
  font-family: 'Mulish', 'Muli', system-ui, sans-serif !important;
  font-size: 16px;
  margin: 0;
  min-height: 100vh;
  background: #F8F8F8;
  color: #1F2348;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

.app {
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---------- header / footer ---------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 6px 0 20px;
}
.app-hex { display: block; }
.app-name { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  color: rgba(31, 35, 72, 0.4);
}
.app-footer a {
  color: rgba(31, 35, 72, 0.5);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: color 0.2s var(--nimiq-ease);
}
.app-footer a:hover { color: #1F2348; }
.app-footer svg { color: rgba(31, 35, 72, 0.4); }

/* ---------- nav (slider-toggle) ---------- */

.app-nav { width: 100%; margin: 0 0 20px; }
.app-nav label { flex: 1; }
.app-nav label span { font-size: 16px; }

/* ---------- views & cards ---------- */

.view { width: 100%; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

.app .nq-card { width: 100%; max-width: none; margin: 0 0 16px; box-sizing: border-box; }
.app .nq-card:last-child { margin-bottom: 0; }
.nq-card-header .nq-h1 { font-size: 26px; }
.nq-card-header .nq-h2 { font-size: 20px; }

.nq-label { display: block; }
.nq-input.full, .full { width: 100%; box-sizing: border-box; }
input.nq-input { display: block; margin-bottom: 14px; }
.nq-button.full { width: 100%; min-width: 0; margin: 4px 0 0; }
.nq-button-s.full {
  display: block; width: 100%; height: auto;
  padding: 9px 0; line-height: 1.4; text-align: center; margin: 10px 0 0;
  background-color: rgba(31, 35, 72, 0.06);
}
.nq-button-s.full:hover { background-color: rgba(31, 35, 72, 0.12); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row input { margin-bottom: 0; }

.app .nq-status-alert { margin: 0 0 12px; }
.app .nq-status-alert a { text-decoration: none; font-weight: 700; }
.muted { color: rgba(31, 35, 72, 0.5); }

.section-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.11em; color: rgba(31, 35, 72, 0.4);
  margin: 8px 2px 12px;
}

/* ---------- card detail ---------- */

.card-merchant { margin: 6px 0 0; color: rgba(31, 35, 72, 0.5); font-size: 15px; }
.progress-line { text-align: center; margin: 14px 0 22px; color: rgba(31, 35, 72, 0.6); font-size: 15px; font-weight: 600; }
.progress-line span { color: #1F2348; }

.stamp-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin: 6px 0 2px;
}
.stamp {
  width: 44px; height: 44px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(31, 35, 72, 0.12);
  position: relative;
}
.stamp.on {
  background-image: var(--nimiq-light-blue-bg);
  box-shadow: 0 4px 10px rgba(5, 130, 202, 0.28);
}
.stamp.on::after {
  content: ''; position: absolute; left: 16px; top: 12px;
  width: 8px; height: 15px; border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
/* welcome-gift stamps: same fill, a soft white inner ring marks them as on-the-house */
.stamp.on.gift { box-shadow: 0 4px 10px rgba(5, 130, 202, 0.28), inset 0 0 0 2.5px rgba(255, 255, 255, 0.65); }

.headstart-note {
  text-align: center; margin: -8px 0 18px;
  font-size: 14px; font-weight: 600; color: var(--nimiq-light-blue);
}
.hh-note {
  text-align: center; margin: -8px 0 16px;
  font-size: 13.5px; font-weight: 600; color: rgba(31, 35, 72, 0.55);
}
.hh-note.live { color: var(--nimiq-light-blue); }
.field-hint { font-size: 12.5px; line-height: 1.4; margin: -6px 0 16px; }

/* KC Passport banner on the card */
.net-banner {
  background: rgba(31, 35, 72, 0.04); border-radius: 10px;
  padding: 14px 16px; margin: 12px 0 4px; text-align: center;
}
.net-title { font-size: 14px; font-weight: 700; color: var(--nimiq-light-blue); margin: 0 0 6px; }
.net-collect { font-size: 13px; color: rgba(31, 35, 72, 0.7); margin: 0; line-height: 1.45; }
.net-rule { font-size: 12.5px; font-weight: 600; color: var(--nimiq-light-blue); margin: 8px 0 0; line-height: 1.4; }
.net-visited { font-size: 12.5px; color: rgba(31, 35, 72, 0.5); margin: 8px 0 0; line-height: 1.45; }
.net-members-input { min-height: 64px; margin-bottom: 4px; }

.card-share { text-align: center; margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(31, 35, 72, 0.08); }
.share-label { color: rgba(31, 35, 72, 0.5); font-size: 14px; margin: 0 0 14px; }
.qr-wrap { display: flex; justify-content: center; }
.qr-wrap canvas { width: 196px; height: 196px; }

.code-display, .tx-line { font-size: 13px; color: rgba(31, 35, 72, 0.5); margin: 12px 0 0; }
.mono { font-family: 'Fira Mono', monospace; color: #1F2348; letter-spacing: 0.04em; }
code.mono { font-size: 13px; }

.back-link { display: block; text-align: center; margin-top: 18px; font-weight: 600; }

/* invite a friend (referral) */
.invite { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(31, 35, 72, 0.08); }
.invite summary {
  cursor: pointer; color: var(--nimiq-light-blue); font-weight: 600;
  font-size: 14px; text-align: center; list-style: none; padding: 6px 0;
}
.invite summary::-webkit-details-marker { display: none; }
.invite-text { text-align: center; color: rgba(31, 35, 72, 0.6); font-size: 13.5px; margin: 8px 0 12px; }
.invite-link { font-size: 12px; text-align: center; margin: 12px 0 10px; }

.payout { margin: 4px 0 8px; }
.mode-toggle { width: 100%; margin: 2px 0 16px; }
.mode-toggle label { flex: 1; }
.mode-toggle label span { font-size: 15px; }
.stake-pitch { font-size: 14px; line-height: 1.5; color: rgba(31, 35, 72, 0.7); margin: 0 0 14px; }
.stake-pitch strong { color: #1F2348; font-weight: 700; }
.stake-line { font-size: 13px; opacity: 0.9; }
.direct-send { margin-top: 12px; }
.direct-send summary,
.gift-send summary,
.transfer summary {
  cursor: pointer; color: var(--nimiq-light-blue); font-weight: 600;
  font-size: 14px; text-align: center; list-style: none; padding: 6px 0;
}
.direct-send summary::-webkit-details-marker,
.gift-send summary::-webkit-details-marker,
.transfer summary::-webkit-details-marker { display: none; }
.direct-address { margin: 12px auto; }
.direct-address textarea { min-height: 88px; }
.gift-send { margin-top: 6px; }
.gift-send #gift-message { margin: 10px 0; }
.transfer { margin-top: 14px; }

/* ---------- row cards (wall / programs) ---------- */

.row-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; cursor: pointer;
  transition: transform 0.2s var(--nimiq-ease), box-shadow 0.2s var(--nimiq-ease);
}
a.row-card { text-decoration: none; color: inherit; }
.row-card:hover { transform: translateY(-1px); box-shadow: 0 0.75rem 4rem rgba(0, 0, 0, 0.14); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { display: block; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: block; font-size: 13px; color: rgba(31, 35, 72, 0.5); margin-top: 3px; }
.row-progress { font-size: 13px; font-weight: 700; color: var(--nimiq-light-blue); white-space: nowrap; }
.row-card .nq-button-s { flex-shrink: 0; }

.issued-open { margin-top: 4px; }

/* ---------- wow screen (the loop payoff) ---------- */

.wow-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; padding: 16px;
  box-sizing: border-box;
}
.wow-overlay[hidden] { display: none; } /* class display:flex would otherwise defeat [hidden] */
.wow-card {
  flex: 1; border-radius: 16px; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 36px 28px calc(28px + env(safe-area-inset-bottom));
}
.wow-check { width: 76px; height: 76px; color: #fff; margin-bottom: 10px; }
.wow-title { color: #fff; font-size: 30px; margin: 6px 0 4px; }
.wow-sub { color: rgba(255, 255, 255, 0.85); font-size: 16px; margin: 0 0 30px; }
.wow-steps {
  list-style: none; padding: 0; margin: 0 0 32px;
  display: flex; flex-direction: column; gap: 14px;
  text-align: left; width: 100%; max-width: 290px;
}
.wow-steps li { display: flex; align-items: center; gap: 14px; font-size: 17px; color: #fff; font-weight: 600; }
.wow-step-n {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.wow-card .nq-button.inverse.full { width: 100%; max-width: 290px; }

/* one-shot entrance — the single calculated bright moment */
.wow-overlay { opacity: 0; }
.wow-overlay.show { opacity: 1; transition: opacity 0.3s var(--nimiq-ease); }
.wow-overlay.show .wow-check { animation: wow-pop 0.5s var(--nimiq-ease) both; }
.wow-overlay.show .wow-title { animation: wow-rise 0.5s 0.08s var(--nimiq-ease) both; }
.wow-overlay.show .wow-sub { animation: wow-rise 0.5s 0.14s var(--nimiq-ease) both; }
.wow-overlay.show .wow-steps li { animation: wow-rise 0.5s var(--nimiq-ease) both; }
.wow-overlay.show .wow-steps li:nth-child(1) { animation-delay: 0.20s; }
.wow-overlay.show .wow-steps li:nth-child(2) { animation-delay: 0.28s; }
.wow-overlay.show .wow-steps li:nth-child(3) { animation-delay: 0.36s; }
.wow-overlay.show .nq-button { animation: wow-rise 0.5s 0.44s var(--nimiq-ease) both; }

@keyframes wow-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes wow-rise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .wow-overlay, .wow-overlay.show * { transition: none !important; animation: none !important; }
}
