:root {
  --ink: #14212b;
  --ink-soft: #3d4f5c;
  --mist: #e7eef3;
  --paper: #f7fafc;
  --line: #c5d2dc;
  --accent: #0f766e;
  --accent-deep: #0b5c56;
  --error: #b42318;
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Sora", "Segoe UI", sans-serif;
}

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

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

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--mist);
  line-height: 1.5;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 60% at 10% -10%, rgba(15, 118, 110, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(20, 33, 43, 0.12), transparent 50%),
    linear-gradient(165deg, #d9e5ee 0%, #f3f7fa 48%, #e8f1f0 100%);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  from {
    transform: scale(1) translate(0, 0);
  }
  to {
    transform: scale(1.04) translate(-1%, 1%);
  }
}

.shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5rem) 0 3rem;
}

.brand-block {
  max-width: 36rem;
  margin-bottom: clamp(2rem, 5vh, 3.25rem);
  animation: rise 0.7s ease both;
}

.brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.brand-block h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-ui);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: 500;
  color: var(--ink-soft);
}

.lede {
  margin: 0;
  max-width: 32rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

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

.workspace {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1.5rem, 4vw, 2.75rem);
  align-items: start;
  animation: rise 0.7s ease 0.12s both;
}

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

.form {
  display: grid;
  gap: 1rem;
}

.dropzone {
  position: relative;
  display: grid;
  gap: 0.35rem;
  justify-items: start;
  border: 1px dashed var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: rgba(247, 250, 252, 0.88);
  padding: 1.35rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.dropzone:hover,
.dropzone:focus-within {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title {
  font-weight: 600;
  color: var(--ink);
}

.dropzone-hint {
  font-size: 0.9rem;
  color: #7d8f9e;
  word-break: break-all;
}

.force-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.force-option input {
  margin-top: 0.2rem;
}

.error {
  margin: 0;
  color: var(--error);
  font-size: 0.9rem;
}

.cta,
.ghost {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.cta {
  margin-top: 0.15rem;
  justify-self: start;
  padding: 0.9rem 1.45rem;
  background: var(--accent);
  color: #fff;
}

.cta:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

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

.cta:disabled,
.ghost:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.status-panel {
  padding: 1.25rem 0;
}

.status-text {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--ink);
}

.status-meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.scan-url-box {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: calc(var(--radius) + 2px);
  background: rgba(247, 250, 252, 0.95);
}

.scan-url-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.scan-url-link {
  display: block;
  word-break: break-all;
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: none;
}

.scan-url-link:hover {
  text-decoration: underline;
}

.scan-url-hint {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.results {
  margin-top: clamp(2rem, 5vh, 3rem);
  animation: rise 0.55s ease both;
}

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

.results-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
}

.results-summary {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.ghost {
  padding: 0.65rem 1.1rem;
  background: transparent;
  color: var(--accent-deep);
  border: 1px solid rgba(15, 118, 110, 0.35);
}

.ghost:hover {
  background: rgba(15, 118, 110, 0.08);
}

.ghost-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.qr-card {
  display: grid;
  gap: 0.65rem;
  justify-items: center;
  animation: pop 0.35s ease both;
}

@keyframes pop {
  from {
    opacity: 0.4;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.qr-frame {
  display: grid;
  place-items: center;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: calc(var(--radius) + 2px);
  background: #fff;
  padding: 0.75rem;
}

.qr-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.view-page {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  color: #111111;
}

.view-shell {
  width: min(420px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 12vh, 5rem) 0 2rem;
}

.view-card {
  background: #ffffff;
  border: 2px solid #111111;
  border-radius: 18px;
  padding: 1.35rem 1.4rem 1.5rem;
}

.view-card h1 {
  margin: 0 0 1.1rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.55rem, 5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  color: #111111;
}

.view-content {
  color: #111111;
  font-size: clamp(1rem, 3.5vw, 1.12rem);
  line-height: 1.55;
}

.view-content p {
  margin: 0 0 0.45rem;
  font-weight: 400;
}

.view-content p:last-child {
  margin-bottom: 0;
}

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

  .cta {
    width: 100%;
    text-align: center;
  }

  .results-head {
    flex-direction: column;
    align-items: stretch;
  }
}
