:root {
  --primary: #0fb9b1;
  --primary-2: #00fff6;
  --primary-dark: #0a8f89;
  --bg: radial-gradient(circle at top, #141824, #0b0d12);

  --card: rgba(255, 255, 255, 0.04);
  --card-2: rgba(0, 0, 0, 0.25);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(15, 185, 177, 0.35);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);

  --ok: #3aff9e;
  --warn: #ffd36a;
  --err: #ff7b7b;

  --radius: 18px;
  --shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  --topbar-height: 72px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  background:
    radial-gradient(
      900px 500px at 20% 0%,
      rgba(15, 185, 177, 0.18),
      transparent 55%
    ),
    radial-gradient(
      900px 520px at 80% 15%,
      rgba(122, 162, 247, 0.12),
      transparent 60%
    ),
    radial-gradient(
      900px 520px at 50% 100%,
      rgba(255, 211, 106, 0.08),
      transparent 60%
    ),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 12px;
  line-height: 1.5;
}

.nebula {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}
.nebula1 {
  width: 520px;
  height: 520px;
  left: -160px;
  top: -160px;
  background: rgba(15, 185, 177, 0.5);
}
.nebula2 {
  width: 460px;
  height: 460px;
  right: -140px;
  top: 180px;
  background: rgba(122, 162, 247, 0.35);
}
.nebula3 {
  width: 520px;
  height: 520px;
  left: 30%;
  bottom: -260px;
  background: rgba(255, 211, 106, 0.22);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 185, 177, 0.3);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  z-index: 50;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(15, 185, 177, 0.25);
  background: rgba(255, 255, 255, 0.03);
  object-fit: cover;
}

.brand-name {
  font-weight: 900;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(15, 185, 177, 0.45);
  white-space: nowrap;
}

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

.topbar nav a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 10px;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.topbar nav a:hover,
.topbar nav a.active {
  color: var(--primary);
  background: rgba(15, 185, 177, 0.1);
  transform: translateY(-1px);
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1140px, calc(100% - 32px));
  margin: 0 auto;
  padding: calc(var(--topbar-height) + 26px) 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.3px;
}

.hero p {
  margin: 0 0 14px;
  max-width: 56ch;
  line-height: 1.6;
}

.hero p strong {
  color: var(--primary);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.badge:hover {
  border-color: var(--border-strong);
}

.hero-card {
  border: 1px solid var(--border-strong);
  background: linear-gradient(
    160deg,
    rgba(15, 185, 177, 0.14),
    rgba(0, 0, 0, 0.3)
  );
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.hero-card-title {
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--primary);
}

.hero-card ol {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.8;
  font-size: 14px;
}

.hero-card ol li::marker {
  color: var(--primary);
  font-weight: 900;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  margin-bottom: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.tab.active {
  color: #061412;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  box-shadow: 0 6px 18px rgba(15, 185, 177, 0.35);
}

.tab .count {
  font-size: 11px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
}

.tab.active .count {
  background: rgba(0, 0, 0, 0.18);
}

.panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.panel.active {
  display: block;
}

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

.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.card-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.scan-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.scan-grid .card {
  margin-bottom: 0;
}

.scan-grid + .result-card {
  margin-top: 18px;
}

.gen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.gen-grid .card {
  margin-bottom: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  font-size: 13.5px;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  color: #061412;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(15, 185, 177, 0.3);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #7bfffa, #12cdc4);
}

.btn.danger {
  color: var(--err);
  border-color: rgba(255, 123, 123, 0.35);
  background: rgba(255, 123, 123, 0.08);
}

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

.select {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  border-radius: 12px;
  padding: 10px 12px;
  max-width: 100%;
  cursor: pointer;
}

.select:focus,
textarea:focus,
input:focus-visible,
.dropzone:focus-visible {
  outline: 2px solid rgba(15, 185, 177, 0.6);
  outline-offset: 2px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field textarea,
.field input[type="text"],
.field input[type="url"] {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  border-radius: 12px;
  padding: 11px 12px;
  resize: vertical;
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

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

.color-row input[type="color"] {
  width: 46px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  padding: 2px;
  cursor: pointer;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.switch input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.02) 0 12px,
      rgba(255, 255, 255, 0.04) 12px 24px
    ),
    #05070a;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.viewer.running #video {
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: none;
}

.viewer.running .overlay {
  display: block;
}

.frame {
  position: absolute;
  inset: 12%;
  border-radius: 18px;
  pointer-events: none;
  box-shadow:
    0 0 0 2px rgba(15, 185, 177, 0.55),
    0 0 0 2000px rgba(0, 0, 0, 0.18);
  display: none;
}

.viewer.running .frame {
  display: block;
}

.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border: 3px solid var(--primary-2);
  border-radius: 6px;
}

.frame::before {
  top: -2px;
  left: -2px;
  border-right: 0;
  border-bottom: 0;
}

.frame::after {
  bottom: -2px;
  right: -2px;
  border-left: 0;
  border-top: 0;
}

.viewer.running .viewer-hint {
  display: none;
}

.viewer-hint {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  justify-items: center;
}

.hint-icon {
  font-size: 34px;
}

.scanline {
  position: absolute;
  left: 12%;
  right: 12%;
  height: 2px;
  top: 15%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-2),
    transparent
  );
  box-shadow: 0 0 14px rgba(0, 255, 246, 0.8);
  opacity: 0;
  pointer-events: none;
}

.viewer.running .scanline {
  opacity: 1;
  animation: scan 2.2s linear infinite;
}

@keyframes scan {
  0% {
    top: 15%;
  }
  50% {
    top: 84%;
  }
  100% {
    top: 15%;
  }
}

.dropzone {
  border: 2px dashed rgba(15, 185, 177, 0.35);
  background: rgba(15, 185, 177, 0.04);
  border-radius: 16px;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(15, 185, 177, 0.1);
  transform: translateY(-1px);
}

.drop-icon {
  font-size: 30px;
  margin-bottom: 6px;
}

.drop-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.drop-title .link {
  color: var(--primary);
  text-decoration: underline;
}

.preview-wrap {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--card-2);
  border-radius: 14px;
  padding: 10px;
}

#preview {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.preview-meta {
  min-width: 0;
  word-break: break-word;
}

.crop-wrap {
  margin-top: 14px;
  border: 1px solid var(--border);
  background: var(--card-2);
  border-radius: 14px;
  padding: 12px;
}

.crop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.crop-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
}

.crop-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
  touch-action: none;
}

.crop-box {
  position: absolute;
  border: 2px solid var(--primary2-light, #ff7b7b);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  border-radius: 4px;
}

.result-card {
  border-color: var(--border-strong);
}

.empty {
  text-align: center;
  padding: 34px 12px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  justify-items: center;
}

.empty-icon {
  font-size: 30px;
}

.risk {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 14px;
}

.risk.ok {
  border-color: rgba(58, 255, 158, 0.35);
  background: rgba(58, 255, 158, 0.08);
}
.risk.warn {
  border-color: rgba(255, 211, 106, 0.4);
  background: rgba(255, 211, 106, 0.08);
}
.risk.bad {
  border-color: rgba(255, 123, 123, 0.45);
  background: rgba(255, 123, 123, 0.09);
}

.risk-icon {
  font-size: 26px;
}

.risk-text {
  flex: 1;
  min-width: 0;
}

.risk-title {
  font-weight: 900;
  font-size: 15px;
}

.type-pill {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.kv-grid {
  display: grid;
  gap: 14px;
}

.kv {
  border: 1px solid var(--border);
  background: var(--card-2);
  border-radius: 14px;
  padding: 14px;
}

.kv-label {
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.content {
  margin: 0;
  font-family:
    ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow: auto;
  color: var(--text);
}

.url-parts {
  display: grid;
  gap: 8px;
}

.url-part {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 7px;
}

.url-part:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.url-part span {
  color: var(--muted);
  font-size: 12.5px;
  flex-shrink: 0;
}

.url-part strong {
  text-align: right;
  word-break: break-all;
  font-weight: 700;
}

.url-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.flag {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.flag.ok {
  color: var(--ok);
  border-color: rgba(58, 255, 158, 0.3);
}
.flag.warn {
  color: var(--warn);
  border-color: rgba(255, 211, 106, 0.3);
}
.flag.bad {
  color: var(--err);
  border-color: rgba(255, 123, 123, 0.35);
}

.warnings {
  margin-top: 14px;
  border: 1px solid rgba(255, 211, 106, 0.3);
  background: rgba(255, 211, 106, 0.06);
  border-radius: 14px;
  padding: 14px;
}

.warnings ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 13.5px;
  line-height: 1.55;
}

.warnings ul li::marker {
  color: var(--warn);
}

.meta-line {
  margin-top: 12px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.check {
  border: 1px solid var(--border);
  background: var(--card-2);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.check strong {
  color: var(--primary);
  font-size: 13.5px;
}

.qr-preview {
  display: grid;
  place-items: center;
  min-height: 300px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card-2);
  padding: 18px;
}

.qr-preview img,
.qr-preview canvas {
  width: min(100%, 420px);
  height: auto;
  image-rendering: pixelated;
  border-radius: 12px;
}

.qr-empty {
  font-size: 13px;
}

.gen-output .tiny {
  margin-top: 12px;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--card-2);
  border-radius: 14px;
  padding: 12px 14px;
}

.history-item .h-icon {
  font-size: 20px;
}

.history-item .h-main {
  flex: 1;
  min-width: 0;
}

.history-item .h-content {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item .h-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

.history-item .h-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
}

.icon-btn:hover {
  background: rgba(15, 185, 177, 0.15);
  border-color: var(--border-strong);
}

.history-empty {
  text-align: center;
  padding: 26px 12px;
  color: var(--muted);
  font-size: 14px;
}

.faq details {
  border: 1px solid var(--border);
  background: var(--card-2);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.faq details:last-child {
  margin-bottom: 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "▾";
  color: var(--primary);
  transition: transform 0.2s ease;
}

.faq details:not([open]) summary::before {
  transform: rotate(-90deg);
}

.faq p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.faq code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12.5px;
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 22px 16px 34px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

footer .sep {
  margin: 0 8px;
  opacity: 0.5;
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--primary);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  border-radius: 12px;
  background: rgba(11, 13, 18, 0.92);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

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

@media (max-width: 768px) {
  .topbar {
    padding: 10px 14px;
  }

  .brand-name {
    font-size: 14px;
  }

  .topbar nav a {
    padding: 8px 10px;
    font-size: 13.5px;
  }

  .topbar nav a:nth-child(1),
  .topbar nav a:nth-child(2) {
    display: none;
  }

  .wrap {
    width: calc(100% - 20px);
  }
}

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

  .hero-card {
    padding: 16px;
  }

  .tab {
    padding: 9px 12px;
    font-size: 13px;
  }

  .head-actions .btn {
    flex: 1;
  }

  .card-head {
    align-items: flex-start;
  }

  .row .btn {
    flex: 1 1 46%;
  }

  .history-item {
    flex-wrap: wrap;
  }
}

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


/* =========================================================
   Trasporto Commercio – Homepage Design Alignment
   QR Checker remains a standalone page and keeps its
   scanner functionality untouched.
   ========================================================= */

:root {
  --primary: #0fb9b1;
  --primary-2: rgb(185, 15, 15);
  --primary-dark: #0a8f89;
  --bg: radial-gradient(circle at top, #141824, #0b0d12);
  --text: #e6e6e6;
  --muted: #94a3b8;
  --border: rgba(0, 128, 128, 0.45);
  --border-strong: rgba(15, 185, 177, 0.35);
  --shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  --radius: 16px;
}

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

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Arial, sans-serif;
  background: none;
  color: var(--text);
  padding-top: 72px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at top, #141824, #0b0d12),
    radial-gradient(circle at bottom, rgba(0, 128, 128, 0.12), transparent 60%);
  background-repeat: no-repeat;
  background-size: cover;
}

.nebula {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(180px);
  background: radial-gradient(
    circle,
    rgba(15, 185, 177, 0.2),
    transparent 70%
  );
}

.nebula1 {
  top: -200px;
  left: -100px;
  width: 700px;
  height: 700px;
  opacity: 0.7;
}

.nebula2 {
  bottom: -250px;
  left: 50px;
  width: 600px;
  height: 600px;
  opacity: 0.6;
}

.nebula3 {
  top: 20%;
  left: 40%;
  width: 800px;
  height: 800px;
  opacity: 0.5;
}

.nebula4 {
  top: 50%;
  right: 20%;
  width: 650px;
  height: 650px;
  opacity: 0.55;
}

.nebula5 {
  bottom: 10%;
  right: 10%;
  width: 750px;
  height: 750px;
  opacity: 0.6;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  gap: 16px;
  background: rgba(11, 13, 18, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 185, 177, 0.3);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  z-index: 20;
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.25s ease;
}

.topbar:hover {
  background: rgba(11, 13, 18, 0.8);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

.topbar .brand {
  font-weight: 800;
  font-size: 20px;
  color: var(--primary);
  text-shadow: 0 0 8px rgba(15, 185, 177, 0.5);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.topbar .brand:hover {
  color: #00fff6;
  text-shadow: 0 0 12px rgba(0, 255, 246, 0.7);
}

.topbar .brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(15, 185, 177, 0.25);
  background: rgba(255, 255, 255, 0.03);
  object-fit: cover;
}

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

.topbar nav a {
  margin-left: 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.topbar nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease, left 0.3s ease;
}

.topbar nav a:hover::after,
.topbar nav a.active::after {
  width: 100%;
  left: 0;
}

.topbar nav a:hover,
.topbar nav a.active {
  color: var(--primary);
  background: rgba(15, 185, 177, 0.08);
  box-shadow: 0 4px 12px rgba(15, 185, 177, 0.2);
  transform: translateY(-2px);
}

.wrap {
  width: min(1100px, calc(100% - 56px));
  padding-top: 34px;
  padding-bottom: 48px;
}

.hero {
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(34px, 4vw, 42px);
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(15, 185, 177, 0.12);
}

.hero p {
  font-size: 16px;
  color: var(--muted);
}

.hero-card,
.card,
.tabs,
.dropzone,
.viewer,
.result,
.history-item,
.faq details {
  border-color: rgba(0, 128, 128, 0.45);
  box-shadow: var(--shadow);
}

.hero-card {
  background:
    linear-gradient(135deg, rgba(15, 185, 177, 0.12), rgba(11, 13, 18, 0.55));
}

.badge {
  border-color: rgba(0, 128, 128, 0.45);
  background: rgba(255, 255, 255, 0.035);
}

.badge:hover {
  border-color: rgba(15, 185, 177, 0.55);
  box-shadow: 0 4px 14px rgba(15, 185, 177, 0.12);
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  box-shadow: 0 10px 25px rgba(15, 185, 177, 0.35);
}

.btn.primary:hover {
  box-shadow: 0 14px 35px rgba(15, 185, 177, 0.5);
}

.btn:not(.primary) {
  border-color: rgba(0, 128, 128, 0.45);
}

.tabs {
  background: rgba(11, 13, 18, 0.58);
}

.tab.active {
  background: rgba(15, 185, 177, 0.12);
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(15, 185, 177, 0.12);
}

.card-head h2,
.hero-card-title {
  color: var(--text);
}

.card-head h2 {
  text-shadow: 0 0 10px rgba(15, 185, 177, 0.08);
}

.dropzone:hover,
.dropzone.drag {
  border-color: rgba(15, 185, 177, 0.65);
  box-shadow: 0 12px 35px rgba(15, 185, 177, 0.12);
}

.viewer {
  background:
    radial-gradient(circle at 50% 35%, rgba(15, 185, 177, 0.08), transparent 55%),
    rgba(11, 13, 18, 0.85);
}

.scanline {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 255, 246, 0.75),
    transparent
  );
  box-shadow: 0 0 18px rgba(0, 255, 246, 0.45);
}

footer {
  border-top-color: rgba(15, 185, 177, 0.3);
  background: rgba(11, 13, 18, 0.55);
}

@media (max-width: 768px) {
  body {
    padding-top: 84px;
  }

  .topbar {
    height: auto;
    min-height: 72px;
    padding: 14px 18px;
    flex-wrap: wrap;
  }

  .topbar nav {
    width: 100%;
    margin-top: 2px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topbar nav a {
    flex: 0 0 auto;
  }

  .wrap {
    width: min(100% - 28px, 1100px);
    padding-top: 22px;
  }

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