:root {
  --bg: #0b0f14;
  --card: rgba(18, 26, 34, 0.92);
  --card-border: rgba(130, 150, 170, 0.2);
  --text: #e9eef4;
  --muted: #a0adba;
  --accent: #ff8a3d;
  --accent-2: #56d4c7;
  --danger: #ff5d5d;
  --shadow: 0 24px 60px rgba(5, 8, 12, 0.5);
  --mono: "Space Mono", "IBM Plex Mono", monospace;
  --sans: "Space Grotesk", "Sora", "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: radial-gradient(circle at top, #132030, #0b0f14 55%);
  min-height: 100vh;
  padding: 32px 6vw 80px;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.35;
  z-index: 0;
}

.orb-1 {
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(86, 212, 199, 0.7), transparent 60%);
}

.orb-2 {
  bottom: -160px;
  left: -120px;
  background: radial-gradient(circle, rgba(255, 138, 61, 0.6), transparent 65%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 90px 90px;
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
}

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--text);
}

.brand:hover {
  opacity: 0.9;
}

.logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(86, 212, 199, 0.2), rgba(255, 138, 61, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.logo svg {
  width: 30px;
  height: 30px;
  stroke: var(--accent);
  stroke-width: 2.4;
  fill: none;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav a:hover {
  border-color: var(--card-border);
  background: rgba(255, 255, 255, 0.05);
}

.btn,
.btn-outline {
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b0f14;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 14px 30px rgba(255, 138, 61, 0.25);
}

.btn-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.alt {
  background: linear-gradient(120deg, #91a4ff, #7ee8fa);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.meta {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--muted);
}

.meta span {
  color: var(--accent);
}

.hero-auth h2 {
  margin-bottom: 8px;
}

.hint {
  color: var(--muted);
  margin-bottom: 16px;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty {
  border: 1px dashed var(--card-border);
  padding: 16px;
  border-radius: 12px;
  color: var(--muted);
}

.flash {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text);
  display: inline-block;
}

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

.qr-card {
  background: rgba(9, 14, 20, 0.88);
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  align-items: start;
}

.qr-grid textarea {
  min-height: 140px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 18, 0.6);
  color: var(--text);
  font-family: var(--sans);
}

.qr-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.qr-tab.active {
  border-color: var(--accent);
  color: var(--accent);
}

.qr-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.qr-row select {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 18, 0.6);
  color: var(--text);
}

.qr-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.hidden {
  display: none;
}

.qr-preview {
  display: grid;
  gap: 16px;
  justify-items: center;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.qr-box {
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  background: #f2f6fb;
  border-radius: 16px;
  overflow: hidden;
  padding: 10px;
  box-shadow: inset 0 0 0 4px #ffffff;
}

.qr-box img,
.qr-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.qr-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(86, 212, 199, 0.15);
  color: var(--accent-2);
  border: 1px solid rgba(86, 212, 199, 0.4);
  font-size: 0.85rem;
}

.link-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 0.9rem;
  color: var(--muted);
}

.field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 18, 0.6);
  color: var(--text);
  font-family: var(--sans);
}

.field small {
  color: var(--muted);
  font-size: 0.8rem;
}

.table-card {
  background: rgba(8, 12, 18, 0.8);
  border-radius: 24px;
  border: 1px solid var(--card-border);
  padding: 24px;
  box-shadow: var(--shadow);
}

.table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.table {
  display: grid;
  gap: 10px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 2.2fr 0.8fr 1.2fr 1.2fr;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  align-items: center;
}

.table-header {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
}

.table-row:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.table-row a {
  color: var(--accent-2);
  text-decoration: none;
  font-family: var(--mono);
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy {
  margin-left: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.label {
  color: var(--muted);
  font-size: 0.85rem;
}

.value {
  font-size: 1.1rem;
  margin-top: 6px;
}

.table-row.empty {
  grid-template-columns: 1fr;
  justify-items: center;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions > * {
  flex: 0 0 120px;
}

.actions .btn-outline {
  width: 100%;
  text-align: center;
}

.actions a.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 10px 18px;
}

.actions form .btn-outline {
  width: 100%;
  height: 36px;
  padding: 10px 18px;
}

.actions form {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 14, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 24px;
}

.modal.open {
  display: flex;
}

.modal-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  width: min(520px, 90vw);
  box-shadow: var(--shadow);
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-sub {
  color: var(--muted);
  font-size: 0.9rem;
  word-break: break-all;
}

.modal-body {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.strong {
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .table-row {
    grid-template-columns: 1fr;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav {
    flex-wrap: wrap;
  }
}
