:root {
  --bg: #080B14;
  --bg-secondary: #0D1220;
  --card: #111827;
  --elevated: #151E30;
  --primary: #3B82F6;
  --accent: #60A5FA;
  --glow: rgba(59, 130, 246, 0.20);
  --text: #F8FAFC;
  --muted: #94A3B8;
  --border: #243047;
  --success: #22C55E;
  --error: #EF4444;
  --radius: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(600px 280px at 90% 20%, rgba(96, 165, 250, 0.08), transparent 55%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input {
  font: inherit;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(8, 11, 20, 0.82);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  box-shadow: 0 0 24px var(--glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--border);
  background: var(--elevated);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

.hero, .stage, .steps, .footer, .receiver {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero {
  text-align: center;
  padding-top: 64px;
  padding-bottom: 28px;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin: 0 0 16px;
}

.lede {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
}

.card {
  background: linear-gradient(180deg, #151E30 0%, #111827 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px rgba(59, 130, 246, 0.04);
  padding: 28px;
}

.upload-card[data-state="drag"] .dropzone,
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  padding: 36px 20px;
  text-align: center;
  background: rgba(13, 18, 32, 0.7);
  transition: border-color 160ms ease, background 160ms ease;
  cursor: pointer;
}

.dropzone h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.dropzone p {
  margin: 0 0 18px;
  color: var(--muted);
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--elevated);
  border: 1px solid var(--border);
  box-shadow: 0 0 32px var(--glow);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

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

.hint strong {
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

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

.btn:focus-visible,
.icon-btn:focus-visible,
.dropzone:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.btn-primary,
.btn-accent {
  background: var(--primary);
  color: white;
  box-shadow: 0 8px 24px var(--glow);
}

.btn-ghost {
  background: var(--elevated);
  color: var(--text);
  border-color: var(--border);
}

.btn.full {
  width: 100%;
  margin-top: 20px;
}

.upload-form {
  display: grid;
  gap: 16px;
}

.selected-file, .progress-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

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

.file-chip.compact {
  margin: 12px 0 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.file-type-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--elevated);
  color: var(--accent);
  flex-shrink: 0;
}

.file-name {
  margin: 0;
  font-weight: 600;
  word-break: break-all;
}

.file-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.icon-btn {
  margin-left: auto;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
}

.progress-track {
  height: 10px;
  background: #0D1220;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 160ms linear;
}

.alert {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.result-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}

.qr-panel {
  text-align: center;
}

.qr-panel img {
  width: 100%;
  max-width: 220px;
  border-radius: 16px;
  background: #F8FAFC;
  padding: 12px;
  border: 1px solid var(--border);
}

.qr-panel .btn {
  margin-top: 14px;
  width: 100%;
}

.result-kicker {
  color: var(--success);
  font-weight: 600;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.result-details h2,
.expired-inline h2 {
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.url-row {
  display: flex;
  gap: 8px;
}

.url-row input {
  flex: 1;
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.countdown {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 22px;
}

.countdown-ring {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.countdown-ring svg {
  width: 96px;
  height: 96px;
  transform: rotate(-90deg);
}

.ring-bg, .ring-fg {
  fill: none;
  stroke-width: 8;
}

.ring-bg {
  stroke: #243047;
}

.ring-fg {
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-dasharray: 263.9;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 300ms linear;
}

.countdown-time {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--accent);
}

.countdown-time strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text);
}

.expired-inline,
.expired-card {
  text-align: center;
}

.expired-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.expired-icon.large {
  width: 88px;
  height: 88px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 36px;
  padding-bottom: 48px;
}

.steps article {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.steps span {
  color: var(--accent);
  font-weight: 700;
}

.steps h3 {
  margin: 8px 0 6px;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

.footer {
  text-align: center;
  padding-bottom: 40px;
  color: var(--text);
}

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

.receiver {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  padding-top: 48px;
  padding-bottom: 48px;
}

.receiver-card {
  width: min(520px, 100%);
  text-align: center;
}

.receiver-card h1 {
  font-size: 1.8rem;
  word-break: break-word;
}

.status-line {
  color: var(--accent);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

@media (max-width: 800px) {
  .result-grid,
  .steps,
  .url-row,
  .countdown {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .badge {
    display: none;
  }

  .hero {
    padding-top: 36px;
  }
}
