@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: #eef3f5;
  background:
    radial-gradient(circle at top left, rgba(211, 159, 87, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(46, 87, 112, 0.35), transparent 32%),
    linear-gradient(145deg, #091015 0%, #0d1820 50%, #081015 100%);
  min-height: 100vh;
}

.backdrop {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
  opacity: 0.4;
}

.shell {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 18px 48px;
}

.auth-shell {
  max-width: 540px;
  padding-top: 56px;
}

.hero {
  margin-bottom: 22px;
}

.auth-shell .hero {
  text-align: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #d39f57;
  font-size: 0.74rem;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 0.98;
  max-width: 12ch;
}

.auth-shell h1 {
  max-width: none;
  font-size: clamp(2.1rem, 5vw, 3rem);
}

h2 {
  font-size: 2rem;
}

.lede,
.muted {
  color: #bdd0dd;
}

.card {
  backdrop-filter: blur(16px);
  background: rgba(14, 23, 31, 0.92);
  border: 1px solid rgba(90, 127, 153, 0.35);
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  padding: 20px;
}

.hidden {
  display: none !important;
}

.page-notice {
  margin: 0 0 18px;
}

.notice {
  color: #d8dfb8;
}

.notice.error {
  color: #ffb8a2;
}

.notice.success {
  color: #d8dfb8;
}

.auth-stage {
  display: flex;
  justify-content: center;
}

.auth-card {
  width: min(100%, 420px);
}

.auth-link-row {
  margin: 14px 0 0;
  text-align: center;
}

.auth-link-row a {
  color: #d39f57;
  text-decoration: none;
  font-size: 0.92rem;
}

.auth-link-row a:hover {
  text-decoration: underline;
}

.auth-link-row a.disabled {
  color: #70828f;
  pointer-events: none;
  text-decoration: none;
}

.auth-form-disabled {
  opacity: 0.58;
}

.auth-form-disabled input,
.auth-form-disabled button {
  background: #22323f;
  border-color: #3f5362;
  color: #94a8b6;
  cursor: not-allowed;
}

.auth-state-hint {
  margin: 12px 0 0;
  color: #ffcf9b;
  font-size: 0.9rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card.wide {
  grid-column: span 2;
}

.card.full {
  grid-column: 1 / -1;
}

form,
.inline-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.inline-form {
  grid-template-columns: 1.4fr 1fr auto;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: #d6e0e7;
  font-size: 0.92rem;
}

input {
  width: 100%;
  border: 1px solid #466278;
  background: #172430;
  color: #eef3f5;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #d39f57 0%, #f0bf74 100%);
  color: #091116;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  background: rgba(23, 36, 48, 0.88);
  color: #eef3f5;
  border: 1px solid rgba(88, 119, 142, 0.45);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stats.compact {
  margin-top: 18px;
}

.stats div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(23, 36, 48, 0.88);
  border: 1px solid rgba(88, 119, 142, 0.25);
}

.stats span {
  display: block;
  color: #8eacbd;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.stats strong {
  display: block;
  word-break: break-word;
}

.mono-block {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #101b23;
  border: 1px solid rgba(88, 119, 142, 0.25);
}

.mono-block span {
  display: block;
  color: #8eacbd;
  margin-bottom: 8px;
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  background: rgba(23, 36, 48, 0.88);
  border: 1px solid rgba(88, 119, 142, 0.25);
}

.history-copy {
  min-width: 0;
}

.history-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.history-top strong {
  font-size: 1rem;
}

.history-date,
.history-meta,
.history-note {
  color: #bdd0dd;
  font-size: 0.92rem;
}

.history-date {
  white-space: nowrap;
}

.history-meta,
.history-note {
  margin: 8px 0 0;
}

.history-txid {
  margin-top: 10px;
  font-size: 0.88rem;
  color: #8eacbd;
}

.history-amount {
  font-size: 1.05rem;
  white-space: nowrap;
}

.history-amount.positive {
  color: #7ad38d;
}

.history-amount.negative {
  color: #ff9a8b;
}

.history-empty {
  margin: 0;
  color: #bdd0dd;
}

.verified-senders {
  margin-top: 16px;
}

.verified-senders > span {
  display: block;
  color: #8eacbd;
  margin-bottom: 10px;
}

.sender-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.sender-list li {
  padding: 14px;
  border-radius: 16px;
  background: rgba(23, 36, 48, 0.88);
  border: 1px solid rgba(88, 119, 142, 0.25);
}

.sender-list-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.sender-list-copy {
  min-width: 0;
}

.sender-list-copy strong {
  display: block;
  margin-bottom: 8px;
}

.sender-list-copy code {
  font-size: 0.92rem;
}

.sender-list-empty {
  color: #bdd0dd;
}

.danger-button {
  background: rgba(90, 38, 35, 0.9);
  color: #fff4f0;
  border: 1px solid rgba(205, 111, 97, 0.45);
  white-space: nowrap;
}

code {
  display: block;
  font-family: "JetBrains Mono", "Cascadia Code", monospace;
  word-break: break-all;
  color: #eff4f7;
}

@media (max-width: 1080px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .card.wide {
    grid-column: span 1;
  }

  .card.full {
    grid-column: span 1;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sender-list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-row {
    grid-template-columns: 1fr;
  }

  .history-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 680px) {
  h1 {
    max-width: none;
  }

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

  .shell {
    padding-inline: 14px;
  }

  .auth-card {
    width: 100%;
  }
}
