/* Page styles for /create and /p/:slug. Pairs with tokens.css (base + chrome).
   px units throughout — @nimiq/style sets html{font-size:8px}, so custom rem would halve. */

.page-card {
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 8px 56px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 540px;
  margin: 24px auto 0;
  padding: 36px 32px;
  box-sizing: border-box;
}
.page-card h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 6px;
  text-wrap: balance;
}
.page-card__lead {
  font-size: 15px;
  color: var(--ink-60);
  margin: 0 0 28px;
  line-height: 1.5;
}

/* ── Form fields ── */
.field {
  margin-bottom: 22px;
}
.field > label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-60);
  margin-bottom: 8px;
}
.nq-input {
  width: 100%;
  box-sizing: border-box;
}
.help {
  font-size: 13px;
  color: var(--ink-40);
  margin: 8px 0 0;
  line-height: 1.45;
}

/* ── Option rows ── */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.option-row .emoji-input {
  width: 52px;
  text-align: center;
  flex-shrink: 0;
}
.option-row .label-input {
  flex: 1;
  min-width: 0;
}
.option-remove {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(31, 35, 72, 0.06);
  color: var(--ink-60);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s cubic-bezier(0.25, 0, 0, 1);
}
.option-remove:hover {
  background: rgba(217, 68, 50, 0.12);
  color: var(--nimiq-red, #d94432);
}
.option-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.add-option {
  margin-top: 12px;
  border: none;
  background: rgba(31, 35, 72, 0.06);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition:
    background 0.2s cubic-bezier(0.25, 0, 0, 1),
    transform 0.2s cubic-bezier(0.25, 0, 0, 1);
}
.add-option:hover {
  background: rgba(31, 35, 72, 0.1);
  transform: translateY(-1px);
}
.add-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ── Segmented method toggle ── */
.seg {
  display: inline-flex;
  background: rgba(31, 35, 72, 0.06);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.seg__btn {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: 'Mulish', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-60);
  cursor: pointer;
  transition: color 0.2s cubic-bezier(0.25, 0, 0, 1);
}
.seg__btn.is-active {
  background-image: radial-gradient(100% 100% at bottom right, #265dd7, #0582ca);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31, 35, 72, 0.15);
}

/* ── Submit + errors ── */
.form-actions {
  margin-top: 28px;
}
.form-actions .nq-button {
  width: 100%;
}
.form-error {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--nimiq-red, #d94432);
  min-height: 18px;
}

/* ── Poll page: vote cards + result bars ── */
.option-list {
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 8px;
  background: var(--bg-secondary, #f8f8f8);
  padding: 0;
  overflow: hidden;
  font-family: 'Mulish', system-ui, sans-serif;
  box-shadow: inset 0 0 0 2px transparent;
  transition:
    box-shadow 0.2s cubic-bezier(0.25, 0, 0, 1),
    transform 0.15s cubic-bezier(0.25, 0, 0, 1);
}
button.opt-card {
  cursor: pointer;
}
button.opt-card:hover {
  transform: translateY(-1px);
}
.opt-card.is-selected {
  box-shadow: inset 0 0 0 2px var(--nimiq-light-blue, #0582ca);
}
.opt-card.is-voted .opt-label {
  font-weight: 700;
}
/* result bar sits behind the row */
.opt-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(5, 130, 202, 0.12);
  z-index: 0;
  transition: width 0.5s cubic-bezier(0.25, 0, 0, 1);
}
.opt-card.is-voted .opt-bar {
  background: rgba(5, 130, 202, 0.22);
}
.opt-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.opt-emoji {
  font-size: 22px;
  line-height: 1;
}
.opt-label {
  flex: 1;
  min-width: 0;
}
.opt-stat {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-60);
}
.opt-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background-image: radial-gradient(100% 100% at bottom right, #265dd7, #0582ca);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.vote-actions .nq-button {
  width: 100%;
}
.post-vote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.voted-note {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--nimiq-green, #21bca5);
}
.creator-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(233, 178, 19, 0.1);
}
.creator-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-60);
}
.share-box {
  border-radius: 8px;
  background: var(--bg-secondary, #f8f8f8);
  padding: 16px 18px;
}
.share-box label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-60);
  margin-bottom: 8px;
}
.share-grid {
  display: flex;
  align-items: center;
  gap: 18px;
}
.qr-code {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
}
.share-controls {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.share-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.share-row input {
  flex: 1;
  min-width: 0;
}
#share-btn {
  align-self: flex-start;
}
@media (max-width: 460px) {
  .share-grid {
    flex-direction: column;
    align-items: stretch;
  }
  .qr-code {
    align-self: center;
  }
}
.poll-status {
  font-size: 14px;
  color: var(--ink-40);
  margin: 0 0 24px;
}

@media (max-width: 520px) {
  .page-card {
    padding: 28px 22px;
    margin-top: 16px;
  }
  .page-card h1 {
    font-size: 24px;
  }
}

/* ── Governance index ── */
.gov-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 760px;
  margin: 8px auto 0;
}
.gov-card {
  display: block;
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(31, 35, 72, 0.06);
  padding: 24px 22px;
  text-decoration: none;
  color: var(--ink);
  transition:
    transform 0.15s cubic-bezier(0.25, 0, 0, 1),
    box-shadow 0.2s cubic-bezier(0.25, 0, 0, 1);
}
.gov-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(31, 35, 72, 0.1);
}
.gov-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.25;
}
.gov-card__meta {
  font-size: 13px;
  color: var(--ink-60);
  margin: 0 0 14px;
}
.gov-card__cta {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.2s cubic-bezier(0.25, 0, 0, 1);
}
.gov-card:hover .gov-card__cta {
  color: var(--nimiq-light-blue, #0582ca);
}

/* ── Coin-weighted governance page ── */
.cast {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-10);
}
.cast__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
}
.cast__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-60);
  margin: 20px 0 8px;
}
.cast__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cast-choice {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: 'Mulish', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(31, 35, 72, 0.06);
  cursor: pointer;
  box-shadow: inset 0 0 0 2px transparent;
  transition:
    box-shadow 0.2s cubic-bezier(0.25, 0, 0, 1),
    transform 0.15s cubic-bezier(0.25, 0, 0, 1);
}
.cast-choice:hover {
  transform: translateY(-1px);
}
.cast-choice.is-selected {
  background: rgba(5, 130, 202, 0.1);
  color: var(--nimiq-light-blue, #0582ca);
  box-shadow: inset 0 0 0 2px var(--nimiq-light-blue, #0582ca);
}
.cast__qr {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.cast__qr .qr-code {
  width: 160px;
  height: 160px;
}

/* Address display (Nimiq registry: Fira Mono, 3x3 grid; assumes 8px root). */
.address-display {
  display: grid;
  justify-items: center;
  width: 100%;
  box-sizing: content-box;
  color: var(--ink);
  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;
}
.address-display .chunk {
  margin: 0.875rem 0;
  line-height: 1.11;
  text-align: center;
  box-sizing: border-box;
  white-space: nowrap;
  text-transform: uppercase;
}
.address-display .space {
  font-size: 0;
}
