/* ── Reset & Base ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface-hover: #1a1a24;
  --border: rgba(255, 255, 255, 0.06);
  --border-active: rgba(255, 255, 255, 0.12);
  --text: #e4e4e7;
  --text-dim: #71717a;
  --text-muted: #52525b;
  --accent: #a78bfa;
  --accent-dim: rgba(167, 139, 250, 0.12);
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 60px 20px 80px;
}

/* ── Container ─────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
}

/* ── Header ────────────────────────────────────────────────────────── */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.87rem;
  font-weight: 400;
}

/* ── Search ────────────────────────────────────────────────────────── */
.search-box {
  margin-bottom: 32px;
}

.input-wrapper {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  transition: border-color 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

#tx-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 10px 12px;
  min-width: 0;
}

#tx-input::placeholder {
  color: var(--text-muted);
}

#search-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

#search-btn:hover {
  opacity: 0.88;
}

#search-btn:active {
  transform: scale(0.97);
}

#search-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loader spinner in button */
.btn-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 10, 15, 0.25);
  border-top-color: #0a0a0f;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

.btn-loader.visible {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error */
.error {
  color: var(--error);
  background: var(--error-bg);
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

/* ── Result Card ───────────────────────────────────────────────────── */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  animation: fadeSlideUp 0.35s ease-out;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-section {
  padding: 4px 0;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 14px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}

.field:last-child {
  margin-bottom: 0;
}

.label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.value {
  font-size: 0.9rem;
  color: var(--text);
  word-break: break-all;
}

.value.mono {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Country flag ──────────────────────────────────────────────────── */
.country-flag {
  font-size: 1.1rem;
  margin-right: 6px;
}


/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body {
    padding: 32px 14px 60px;
  }

  .result-card {
    padding: 20px;
  }

  .fields-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .input-wrapper {
    flex-direction: column;
  }

  #search-btn {
    width: 100%;
  }
}
