:root {
  --bg: #070708;
  --bg-elevated: #121214;
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --brand: #c73630;
  --brand-hot: #e23b34;
  --brand-deep: #8f221e;
  --gold: #f0b429;
  --line: rgba(255, 255, 255, 0.08);
  --glow: rgba(199, 54, 48, 0.45);
  --radius: 14px;
  --font-display: "Orbitron", sans-serif;
  --font-body: "Manrope", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Atmosphere —— */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bg-glow {
  position: absolute;
  width: 48vw;
  height: 48vw;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: drift 14s var(--ease) infinite alternate;
}

.bg-glow--a {
  top: -12%;
  left: 50%;
  translate: -50% 0;
  background: radial-gradient(circle, rgba(199, 54, 48, 0.55), transparent 68%);
}

.bg-glow--b {
  bottom: -18%;
  right: -8%;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.18), transparent 70%);
  animation-delay: -4s;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 72%);
  opacity: 0.55;
}

.bg-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 3px
  );
  opacity: 0.25;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, 28px, 0) scale(1.08); }
}

/* —— Chrome —— */
.topbar,
.stage,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 18, 20, 0.7);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.clock {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.stage {
  display: grid;
  place-items: center;
  padding: 1rem 1.25rem 2.5rem;
}

.hero {
  width: min(560px, 100%);
  text-align: center;
  position: relative;
  animation: rise 0.9s var(--ease) both;
}

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

.logo-orbit {
  position: absolute;
  left: 50%;
  top: 3.2rem;
  translate: -50% -50%;
  width: min(380px, 88vw);
  aspect-ratio: 1;
  pointer-events: none;
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(199, 54, 48, 0.18);
  animation: spin 18s linear infinite;
}

.ring--1 { inset: 8%; border-color: rgba(199, 54, 48, 0.28); }
.ring--2 {
  inset: 18%;
  border-style: dashed;
  border-color: rgba(240, 180, 41, 0.22);
  animation-direction: reverse;
  animation-duration: 26s;
}
.ring--3 {
  inset: 28%;
  border-color: rgba(255, 255, 255, 0.06);
  animation-duration: 32s;
}

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

.logo-wrap {
  margin: 1.6rem auto 0.85rem;
  position: relative;
  width: min(300px, 78vw);
  filter: drop-shadow(0 0 28px rgba(199, 54, 48, 0.35));
  animation: logoIn 1.1s var(--ease) both;
}

.logo {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

@keyframes logoIn {
  from {
    opacity: 0;
    transform: scale(0.92);
    filter: drop-shadow(0 0 0 rgba(199, 54, 48, 0));
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 28px rgba(199, 54, 48, 0.35));
  }
}

.page-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 4.2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.tagline {
  margin: 0 0 1.45rem;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.query-form {
  display: grid;
  gap: 0.85rem;
  width: min(420px, 100%);
  margin: 0 auto;
  text-align: left;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(240, 180, 41, 0.35);
  background:
    linear-gradient(180deg, rgba(240, 180, 41, 0.06), transparent 60%),
    rgba(10, 10, 12, 0.92);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder {
  color: #71717a;
  font-weight: 500;
}

.field input:focus {
  border-color: rgba(199, 54, 48, 0.85);
  box-shadow: 0 0 0 3px rgba(199, 54, 48, 0.2);
}

.field input.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.btn-check {
  position: relative;
  isolation: isolate;
  border: 0;
  cursor: pointer;
  width: 100%;
  min-height: 58px;
  margin-top: 0.25rem;
  padding: 0.95rem 1.4rem;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(180deg, var(--brand-hot), var(--brand-deep));
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s;
  box-shadow:
    0 10px 30px var(--glow),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.btn-check:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 16px 40px rgba(199, 54, 48, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  filter: brightness(1.05);
}

.btn-check:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.btn-check:disabled {
  cursor: wait;
  filter: saturate(0.9);
}

.btn-check__glow {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 180deg, transparent, rgba(255, 255, 255, 0.25), transparent 30%);
  animation: sweep 3.2s linear infinite;
  opacity: 0.35;
  z-index: -1;
}

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

.btn-check__content {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  z-index: 1;
}

.btn-check__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), #fff);
  transition: width 0.2s linear;
  z-index: 2;
}

.btn-check.is-checking .btn-check__progress {
  width: 100%;
  transition: width 1.4s linear;
}

.btn-check.is-success {
  background: linear-gradient(180deg, #1f9d55, #14663a);
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.35);
}

button[hidden],
.status-panel[hidden] {
  display: none !important;
}

.status-panel.is-visible {
  display: block !important;
}

.connect-button.btn-check {
  width: 100%;
}

.connect-button--active .btn-check__label,
.connect-button.is-checking .btn-check__label {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  line-height: 1.35;
  text-transform: none;
}

.status-panel {
  width: min(420px, 100%);
  margin: 1.15rem auto 0;
  padding: 1.2rem 1.1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(240, 180, 41, 0.35);
  background:
    linear-gradient(180deg, rgba(240, 180, 41, 0.07), transparent 55%),
    rgba(12, 12, 14, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  text-align: center;
  animation: rise 0.45s var(--ease) both;
}

.status-panel__spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--brand);
  border-right-color: var(--gold);
  animation: spin 0.9s linear infinite;
}

.status-panel__user {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.status-panel__msg {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.45;
}

.status-panel__bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.status-panel__bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  box-shadow: 0 0 16px rgba(199, 54, 48, 0.45);
}

.result {
  width: min(420px, 100%);
  margin: 1.15rem auto 0;
  padding: 1.05rem 1.1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(12, 12, 14, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  text-align: left;
  animation: rise 0.45s var(--ease) both;
}

.result__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.result__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result__badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.result__badge[data-status="pending"] {
  color: #f0b429;
  background: rgba(240, 180, 41, 0.12);
  border: 1px solid rgba(240, 180, 41, 0.35);
}

.result__badge[data-status="review"] {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.result__badge[data-status="approved"] {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.result__badge[data-status="paid"] {
  color: #34d399;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.result__badge[data-status="rejected"] {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.result__badge[data-status="notfound"] {
  color: #a1a1aa;
  background: rgba(161, 161, 170, 0.1);
  border: 1px solid rgba(161, 161, 170, 0.3);
}

.result__id {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
}

.timeline__step {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 0.65rem;
  align-items: start;
  font-size: 0.86rem;
  color: var(--muted);
}

.timeline__step span:first-child {
  width: 10px;
  height: 10px;
  margin-top: 0.3rem;
  border-radius: 50%;
  background: #3f3f46;
  box-shadow: 0 0 0 3px rgba(63, 63, 70, 0.35);
}

.timeline__step.is-done {
  color: var(--ink);
}

.timeline__step.is-done span:first-child {
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(199, 54, 48, 0.25);
}

.timeline__step.is-current {
  color: var(--gold);
  font-weight: 600;
}

.timeline__step.is-current span:first-child {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.25);
  animation: pulse 1.8s ease-out infinite;
}

.result__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin: 0 0 0.9rem;
}

.result__grid div {
  min-width: 0;
}

.result__grid dt {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #71717a;
}

.result__grid dd {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  word-break: break-word;
}

.result__note {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.meta-row {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.meta-row strong {
  color: var(--ink);
  font-weight: 600;
}

.footer {
  padding: 1.25rem;
  text-align: center;
  color: #71717a;
  font-size: 0.8rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  translate: -50% 0;
  z-index: 20;
  padding: 0.85rem 1.15rem;
  border-radius: 10px;
  background: rgba(18, 18, 20, 0.95);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.35s var(--ease);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding-inline: 1rem;
  }

  .logo-wrap {
    margin-top: 1.4rem;
  }

  .meta-row {
    gap: 0.5rem 0.85rem;
  }
}
