/* nimiq.cool — collective staking dashboard composition.
   Layered on top of @nimiq/style (legacy, html{font-size:8px}). ALL custom rules
   here are written in PX so the 8px-root rem trap never doubles a value. Colors,
   radii and gradients follow the Nimiq design tokens (no off-palette hexes). */

:root {
  --nq-blue: #1f2348;
  --nq-light-blue: #0582ca;
  --nq-green: #21bca5;
  /* Green is the brand's yield/data accent. On white it reads at nimiq.com's own
     (sub-AA) contrast for the staking figures — we keep the canonical token rather
     than invent an off-palette darker green (rule 13). nq lint flags this as an
     advisory contrast warning, matching how it treats nimiq.com itself. */
  --nq-green-text: var(--nimiq-green-darkened, #20b29e);
  --nq-gold: #e9b213;
  --ink: #1f2348;
  --ink-60: rgba(31, 35, 72, 0.6);
  --ink-40: rgba(31, 35, 72, 0.4);
  --on-dark-60: rgba(255, 255, 255, 0.6);
  --hairline: rgba(31, 35, 72, 0.1);
  --page-bg: #f8f8f8;
  --card-bg: #ffffff;
  --grey-card: #f2f2f4;
  /* bottom-right radial navy gradient — the canonical Nimiq dark surface */
  --nq-blue-bg: radial-gradient(100% 100% at bottom right, #260133, #1f2348);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--ink);
  /* nimiq-style sets the deprecated Muli; force Mulish per rule 9. */
  font-family: "Mulish", "Muli", system-ui, -apple-system, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

/* ============================ HERO ============================ */

.hero {
  background-image: var(--nq-blue-bg);
  color: #fff;
  padding: 40px 24px 120px;
}

.hero__inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.hero__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
  margin-bottom: 48px;
}

.hero__logo {
  height: 24px;
  width: auto;
}

.hero__app {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.hero__headline {
  margin: 0 auto 16px;
  max-width: 18ch;
  font-size: 40px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
  color: #fff;
  text-wrap: balance;
}

.hero__tagline {
  margin: 0 auto 48px;
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.55;
  color: var(--on-dark-60);
  text-wrap: pretty;
}

.hero__total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hero__total-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--on-dark-60);
}

.hero__total-amount {
  font-family: "Fira Mono", monospace;
  font-size: 52px;
  font-weight: 500;
  color: #fff;
  line-height: 1.1;
}

.hero__total-amount .currency {
  font-size: 24px;
  font-weight: 400;
  color: var(--on-dark-60);
  margin-left: 6px;
}

.hero__total-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

/* ============================ PAGE ============================ */

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 24px;
  /* pull the stats row up so it overlaps the hero band slightly */
  margin-top: -72px;
}

/* ---- pool stats ---- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat {
  /* .nq-card has zero internal padding — pad explicitly (rule 14). */
  max-width: none;
}

.stat__body {
  padding: 24px 24px 28px;
}

.stat__label {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-60);
}

.stat__value {
  margin: 0 0 8px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.stat__value .amount {
  font-family: "Fira Mono", monospace;
  font-weight: 500;
}

.stat__value .currency {
  font-size: 17px;
  font-weight: 400;
  color: var(--ink-40);
  margin-left: 4px;
}

.stat__value--green {
  color: var(--nq-green-text);
}

.stat__note {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-60);
}

/* ---- join / deposit ---- */

.join {
  margin-top: 24px;
}

.join__card {
  max-width: none;
}

.join__header {
  padding: 32px 32px 4px;
}

.join__title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

.join__sub {
  margin: 0;
  max-width: 64ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-60);
  text-wrap: pretty;
}

.join__body {
  padding: 24px 32px 32px;
}

.deposit__field {
  margin-bottom: 20px;
}

.deposit__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-60);
}

/* The amount input + its NIM ticker, sharing one inset-border surface. */
.deposit__amount-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

/* .nq-input from nimiq-style draws an inset box-shadow border (rule 1) — we only
   size it and switch the figure to Fira Mono, never add a real border. */
.deposit__amount {
  width: 100%;
  height: 56px;
  padding: 0 64px 0 16px;
  font-family: "Fira Mono", monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
}

/* Strip the number input's spin buttons so the field reads like a clean figure. */
.deposit__amount::-webkit-outer-spin-button,
.deposit__amount::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.deposit__amount {
  appearance: textfield;
  -moz-appearance: textfield;
}

.deposit__amount::placeholder {
  color: var(--ink-40);
}

.deposit__ticker {
  position: absolute;
  right: 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-40);
  pointer-events: none;
}

.deposit__address {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font-family: "Fira Mono", monospace;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: #fff;
}

.deposit__address::placeholder {
  color: var(--ink-40);
  letter-spacing: normal;
}

.deposit__demos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* .nq-button defaults to a centered 200px-min capsule with auto side margins;
   in the card we want it left-aligned and full-bleed, not floating centered. */
.deposit__submit {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 8px 0 0;
}

.deposit__submit[disabled] {
  opacity: 0.55;
  cursor: progress;
  box-shadow: none;
  transform: none;
}

/* pending */

.deposit__pending {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.deposit__pending[hidden] {
  display: none;
}

.deposit__spin {
  color: var(--nq-light-blue);
  flex: none;
}

.deposit__pending-text {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-60);
}

/* success / error alerts — neutralise the registry's docs full-bleed quirk so the
   alert sits flush inside the card instead of bleeding 8px to the left. */
.deposit__alert {
  margin: 20px 0 0;
  transform: none;
  width: 100%;
}

.deposit__alert[hidden] {
  display: none;
}

.deposit__alert p:last-child {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

/* ---- my stake ---- */

.mine {
  margin-top: 24px;
}

.mine__card {
  max-width: none;
}

.mine__header {
  padding: 32px 32px 4px;
}

.mine__title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

.mine__sub {
  margin: 0;
  max-width: 60ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-60);
}

.mine__body {
  padding: 24px 32px 32px;
}

/* lookup form */

.lookup {
  margin-bottom: 28px;
}

.lookup__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-60);
}

/* .nq-input from nimiq-style uses an inset box-shadow border (rule 1); we only
   set sizing + Fira Mono for the address here, never a real border. */
.lookup__input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font-family: "Fira Mono", monospace;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: #fff;
}

.lookup__input::placeholder {
  color: var(--ink-40);
  letter-spacing: normal;
}

.lookup__demos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.demo-pill {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 500px;
  background: rgba(31, 35, 72, 0.06);
  color: var(--ink);
  font-family: "Mulish", sans-serif;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s var(--nimiq-ease, ease);
}

.demo-pill:hover,
.demo-pill:focus-visible {
  background: rgba(31, 35, 72, 0.12);
  outline: none;
}

.demo-pill:focus-visible {
  outline: 2px solid var(--nq-light-blue);
  outline-offset: 3px;
}

/* position grid */

.position[hidden] {
  display: none;
}

.position__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--hairline);
}

.position__cell {
  background: var(--grey-card);
  padding: 24px;
}

.position__label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-60);
}

.position__value {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.position__value .amount {
  font-family: "Fira Mono", monospace;
  font-weight: 500;
}

.position__value .currency {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-40);
  margin-left: 4px;
}

.position__value--mono {
  font-family: "Fira Mono", monospace;
  font-weight: 500;
}

.position__value--green {
  color: var(--nq-green-text);
}

.position__honest {
  margin: 24px 0 0;
  max-width: 72ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-60);
  text-wrap: pretty;
}

/* empty / loading */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0 8px;
  text-align: center;
  color: var(--ink-40);
}

/* The [hidden] attribute must win over the flex display above. */
.empty[hidden] {
  display: none;
}

.empty__spin {
  color: var(--nq-light-blue);
}

.empty[data-state="ready"] .empty__spin {
  display: none;
}

.empty__text {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-60);
}

/* ============================ FOOTER ============================ */

.footer {
  max-width: 760px;
  margin: 16px auto 0;
  padding: 32px 24px 48px;
  text-align: center;
}

.footer__copy {
  margin: 0 auto 16px;
  max-width: 60ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-60);
  text-wrap: pretty;
}

.footer__link {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s var(--nimiq-ease, ease);
}

.footer__link:hover {
  color: var(--nq-light-blue);
}

/* ============================ RESPONSIVE ============================ */

@media (max-width: 720px) {
  .hero {
    padding: 32px 20px 104px;
  }

  .hero__headline {
    font-size: 30px;
  }

  .hero__total-amount {
    font-size: 40px;
  }

  .hero__total-amount .currency {
    font-size: 20px;
  }

  .page {
    padding: 0 16px 16px;
    margin-top: -64px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat__body {
    padding: 24px;
  }

  .join__header,
  .mine__header {
    padding: 28px 24px 4px;
  }

  .join__body,
  .mine__body {
    padding: 20px 24px 28px;
  }

  .position__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner .big-hex,
  .loading-spinner .small-hex {
    animation: none;
  }
}
