/* The QR code checker (/qr-code-checker/), on the generator's layout (generator.css): the ways in on the
   left, the verdict on the right from 60rem up. */

/* A picture: one big target to tap, or to drop a file on */
.drop {
  display: grid;
  justify-items: center;
  gap: 0.375rem;
  padding: 1.75rem 1.25rem;
  border: 2px dashed var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.drop .icon {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--accent-text);
}

.drop-main {
  font-weight: 600;
}

.drop-more {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* A phone drops no file */
@media (pointer: coarse) {
  .drop-more {
    display: none;
  }
}

.drop:hover,
.drop.is-over {
  border-color: var(--accent-text);
}

/* The file field is unseen: its focus shows on the drop zone */
[data-for="photo"]:has(#file:focus-visible) .drop {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* The camera */
.cam {
  overflow: hidden;
  margin-bottom: 0.75rem;
  border-radius: var(--r-panel);
  background: #000;
}

.cam video {
  display: block;
  width: 100%;
  max-height: 60dvh;
  object-fit: cover;
}

.cam-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* The verdict: one at a time */
.verdict {
  display: grid;
  gap: 0.5rem;
  padding: 1.5rem;
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.verdict .icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--muted);
}

.verdict h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

.verdict p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.verdict b {
  color: var(--ink);
}

.verdict.is-good .icon {
  color: var(--good);
}

.verdict.is-warn .icon {
  color: var(--warn);
}

.verdict.is-bad .icon {
  color: var(--danger);
}

.stage[data-state="busy"] .verdict .icon {
  animation: checker-pulse 1.2s ease-in-out infinite;
}

@keyframes checker-pulse {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage[data-state="busy"] .verdict .icon {
    animation: none;
  }
}

.result-buttons {
  display: grid;
  gap: 0.5rem;
}

.result-buttons .btn {
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  padding-block: 0.625rem;
}

/* The details, folded */
.details {
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
}

.details summary {
  font-weight: 600;
  cursor: pointer;
}

.detail-label {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.raw {
  max-height: 8rem;
  overflow: auto;
  margin-top: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-input);
  background: var(--tint);
  font-size: 0.875rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hops {
  display: grid;
  gap: 0.375rem;
  margin-top: 0.375rem;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
}

.hops li,
.final {
  overflow-wrap: anywhere;
}

.hops b {
  margin-right: 0.25rem;
}
