/* nimiq.name custom tokens + layout.
   NOTE: @nimiq/style sets html { font-size: 8px } (1rem = 8px). Custom values are
   in px to avoid the half-size trap; the .address-display block keeps the registry's
   rem values, which are correct under the 8px root. */
:root {
  --ink: #1f2348;
  --ink-60: rgba(31, 35, 72, 0.6);
  --ink-40: rgba(31, 35, 72, 0.4);
  --bg: #f8f8f8;
  --card: #ffffff;
  --light-blue: #0582ca;
  --green: #21bca5;
}

/* The flag-hex language switcher's hexagons overflow:visible by design (their
   points overscan the box); clip that decorative bleed at the root so the
   top-right switcher never adds a horizontal scrollbar. */
html {
  overflow-x: hidden;
}

body {
  font-family: "Mulish", "Muli", system-ui, sans-serif !important;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.page {
  position: relative;
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 48px 16px;
}

.lang-slot {
  position: absolute;
  top: 16px;
  right: 16px;
  /* contain the flag hexagons' decorative horizontal overscan (overflow:visible)
     within a padded clip box so it never extends the document width */
  padding: 2px 14px;
  overflow: hidden;
}
.lang-slot:empty {
  display: none;
}

.topnav-link {
  position: absolute;
  top: 22px;
  left: 18px;
  z-index: 1;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.nq-style .topnav-link {
  color: var(--ink);
}
.nq-style .topnav-link:hover {
  color: var(--light-blue);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand .hex {
  width: 34px;
  height: auto;
  display: block;
}
.brand .wordmark {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0;
}

.hero {
  width: 100%;
  max-width: 560px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.hero h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
  text-wrap: balance;
}
.hero .lede {
  margin: 0;
  max-width: 46ch;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-60);
  text-wrap: pretty;
}

/* search */
.search {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}
.search-field {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.search-field .nq-input {
  width: 100%;
  font-size: 16px;
  padding-right: 52px;
}
.search-suffix {
  position: absolute;
  right: 18px;
  font-size: 16px;
  color: var(--ink-40);
  pointer-events: none;
}

/* result + cards */
.result {
  width: 100%;
  max-width: 480px;
}
.card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 56px rgba(0, 0, 0, 0.111);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.identicon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: #eceef2;
  background-size: cover;
  background-position: center;
}

.resolved-name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}
.resolved-label {
  margin: 0;
  font-size: 14px;
  color: var(--ink-40);
}
.state-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.state-msg {
  margin: 0;
  font-size: 16px;
  color: var(--ink-60);
}
.meta {
  margin: 0;
  font-size: 14px;
  color: var(--ink-60);
}
.row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.price {
  margin: 4px 0 0;
  font-size: 30px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.price .per {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-40);
}

.prepared:empty {
  display: none;
}
.prepared {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(31, 35, 72, 0.08);
  width: 100%;
  text-align: center;
}
.prepared-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(31, 35, 72, 0.12);
  border-top-color: var(--light-blue);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
}

/* address-display — registry grid build; rem values assume the 8px root */
.address-display {
  display: grid;
  justify-items: center;
  width: 100%;
  box-sizing: content-box;
  color: var(--ink-60);
  font-size: 3rem;
  font-family: "Fira Mono", monospace;
}
.format-nimiq {
  grid-template-columns: repeat(3, 33%);
  justify-content: space-between;
  max-width: 28.25rem;
  margin: 0 auto;
}
.chunk {
  margin: 0.875rem 0;
  line-height: 1.11;
  text-align: center;
  box-sizing: border-box;
  white-space: nowrap;
  text-transform: uppercase;
}
.space {
  font-size: 0;
}

/* detail page */
.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
/* beat @nimiq/style's `.nq-style a` (0,1,1) so brand/nav links stay navy, not blue */
.nq-style .brand-link .wordmark {
  color: var(--ink);
}
.detail-wrap {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.nq-style .back {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.nq-style .back:hover {
  color: var(--light-blue);
}
.history {
  width: 100%;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(31, 35, 72, 0.08);
}
.history-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-60);
}
.events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.event {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
}
.event-kind {
  font-weight: 600;
}
.event-date {
  color: var(--ink-60);
}

/* register flow */
.tx-summary {
  width: 100%;
  margin: 4px 0 2px;
  padding: 14px 16px;
  background: #f4f5f8;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tx-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
}
.tx-row span:first-child {
  color: var(--ink-60);
}
.tx-row .mono {
  font-family: "Fira Mono", monospace;
}

/* manage / account */
.account-card {
  align-items: stretch;
}
.mono-addr {
  font-family: "Fira Mono", monospace;
  font-size: 18px;
  text-align: center;
}
.name-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}
.name-card {
  border: 1px solid rgba(31, 35, 72, 0.1);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.name-card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.nq-style .name-link {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.nq-style .name-link:hover {
  color: var(--light-blue);
}
.primary-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-40);
}
.name-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.name-flow:empty {
  display: none;
}
.flow-form {
  display: flex;
  gap: 8px;
  width: 100%;
}
.flow-form .nq-input {
  flex: 1;
  font-size: 14px;
}
.nq-style .inline-link {
  font-weight: 600;
  color: var(--ink);
}

/* footer */
.foot a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.foot a:hover {
  color: var(--light-blue);
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 30px;
  }
  .search {
    flex-direction: column;
  }
}
