:root {
  --bg: #06101a;
  --bg-soft: #0f1e30;
  --card: rgba(7, 19, 34, 0.8);
  --text: #f1f5ff;
  --muted: #9bb0d0;
  --line: rgba(158, 183, 223, 0.2);
  --accent: #46d4ff;
  --accent-2: #76ffb7;
  --danger: #ff7373;
  --mono: "IBM Plex Mono", monospace;
  --display: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 20% 10%, #113259, transparent 40%),
    radial-gradient(circle at 80% 20%, #24496d, transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: var(--display);
}

.bg-aurora {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(70, 212, 255, 0.08),
    rgba(118, 255, 183, 0.08),
    rgba(70, 212, 255, 0.04)
  );
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1200px, 92vw);
  margin: 2.5rem auto;
  display: grid;
  gap: 1.2rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 21, 38, 0.72);
  backdrop-filter: blur(8px);
}

.overline {
  margin: 0;
  font-size: 0.74rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0.3rem 0 0.4rem;
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.lead {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

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

.card {
  padding: 1rem 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 0.8rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: var(--muted);
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(169, 194, 231, 0.25);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: rgba(5, 14, 27, 0.82);
  color: var(--text);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(70, 212, 255, 0.2);
}

.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

button {
  border: none;
  border-radius: 11px;
  padding: 0.55rem 0.9rem;
  background: linear-gradient(120deg, #2fc7f8, #6bfcb5);
  color: #07131f;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.18s ease;
}

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

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.code {
  margin: 0;
  min-height: 72px;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(178, 203, 239, 0.24);
  background: rgba(3, 10, 20, 0.85);
  color: #b9ffe2;
  font-family: var(--mono);
  overflow-x: auto;
  white-space: pre-wrap;
}

.qr-wrap {
  display: grid;
  justify-content: center;
  padding: 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(178, 203, 239, 0.24);
  background: rgba(3, 10, 20, 0.85);
}

.qr-box {
  width: 256px;
  min-height: 256px;
}

.qr-wrap img,
.qr-wrap canvas,
.qr-wrap table {
  width: 100%;
  max-width: 256px;
  height: auto;
  border-radius: 8px;
  background: #fff;
  padding: 0.35rem;
}

.inline-fields {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: rgba(8, 19, 35, 0.65);
}

.list button {
  font-size: 0.8rem;
  padding: 0.35rem 0.55rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid rgba(168, 192, 226, 0.2);
  padding: 0.5rem 0.3rem;
}

th {
  color: var(--muted);
  font-weight: 500;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  background: rgba(8, 21, 37, 0.85);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.ok {
  color: var(--accent-2);
}

.error {
  color: var(--danger);
}

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

  .hero {
    flex-direction: column;
  }

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