/* Landing page QR checker (Views/Home/Landing/_QrCheck.cshtml, js/qr-check.js). Uses the landing page's tokens. */
.qr-check-section {
  --qr-pass: #0d7a52;
  --qr-warn: #9a5800;
  --qr-fail: #b3261e;
  --qr-info: var(--accent);
  --qr-panel: var(--surface);
  --qr-soft: var(--section-alternate, #edf2f7);
  background: var(--section-surface);
}

.qr-check-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 72px; align-items: start; }
.qr-check-intro { position: sticky; top: 32px; }

/* The tool itself: one bordered surface, sections divided by lines rather than nested cards. */
.qr-checker { background: var(--qr-panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; min-width: 0; }
.qr-checker-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.qr-checker .qr-action { gap: 12px; min-height: 50px; padding: 12px 20px; font-size: .86rem; }
.qr-checker .qr-action .icon { width: 20px; height: 20px; }
.qr-checker .qr-action-secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.qr-checker .qr-action-secondary:hover { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.qr-checker .qr-action-paste { font-size: .84rem; padding-inline: 6px; color: var(--muted); }
.qr-checker .qr-action-paste[aria-expanded="true"] { color: var(--accent); }
.qr-checker [hidden] { display: none !important; }

/* Camera */
.qr-camera { position: relative; margin-top: 22px; width: 100%; max-width: 460px; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #0b1622; }
.qr-camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-camera-frame { position: absolute; inset: 14%; border-radius: 14px; box-shadow: 0 0 0 999px rgb(5 14 24 / .42); outline: 2px solid rgb(255 255 255 / .92); outline-offset: 0; pointer-events: none; transition: outline-color .2s; }
.qr-camera.is-reading .qr-camera-frame { outline-color: #7ee2b8; }
.qr-camera-hint { position: absolute; left: 16px; right: 16px; bottom: 14px; margin: 0; text-align: center; color: #fff; font-size: .82rem; line-height: 1.5; text-shadow: 0 1px 3px rgb(0 0 0 / .6); }
.qr-camera-stop { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 13px; border: 0; border-radius: 7px; background: rgb(8 20 32 / .72); color: #fff; font-size: .76rem; font-weight: 600; }
.qr-camera-stop:hover { background: rgb(8 20 32 / .92); }
.qr-camera-stop .icon { width: 16px; height: 16px; }

/* Paste */
.qr-paste { margin-top: 22px; display: grid; gap: 10px; }
.qr-paste label { font-size: .8rem; font-weight: 600; }
.qr-paste textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 104px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--qr-panel); color: var(--ink); font: .8rem/1.6 "Cascadia Code", Consolas, monospace; overflow-wrap: anywhere; transition: border-color .2s, box-shadow .2s; }
.qr-paste textarea::placeholder { color: var(--muted); opacity: .8; font-family: var(--font); }
.qr-paste textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.qr-paste .button { justify-self: start; }

.qr-security:not(:empty) { margin-top: 18px; }
.qr-check-message { margin: 0; font-size: .82rem; line-height: 1.6; color: var(--muted); }
.qr-check-message:not(:empty) { margin-top: 14px; }
.qr-check-message.is-problem { color: var(--qr-fail); margin-top: 14px; }

/* Result */
.qr-result { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line); }
.qr-result:focus { outline: none; }
.qr-result-art { max-width: 120px; margin: 0 0 14px; }
/* Who checked it and when: the top line of every result, so a screenshot carries it. */
.qr-result-by { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.qr-result-by .avtax-identity { color: var(--ink); gap: 9px; }
.qr-result-by .avtax-identity__mark { width: 38px; height: 30px; }
.qr-result-by .avtax-identity__copy strong { font-size: .96rem; }
.qr-result-by .avtax-identity__copy small { font-size: .42rem; color: var(--accent); }
.qr-result-by-text { margin: 0; display: grid; justify-items: end; text-align: right; font-size: .74rem; line-height: 1.5; color: var(--muted); }
.qr-result-by-text span { font-weight: 600; color: var(--ink); }
.qr-result-head { display: flex; gap: 20px; align-items: flex-start; }
.qr-result-head .fold-art { flex: 0 0 96px; width: 96px; min-width: 0; height: auto; margin: 0; }
.qr-result-title { font-size: 1.22rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.35; }
.qr-result-title:focus { outline: none; }
.qr-result-title:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
.qr-result-summary { color: var(--muted); font-size: .9rem; line-height: 1.75; margin-top: 8px; max-width: 60ch; }

.qr-fields { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 10px 22px; margin-top: 24px; padding: 18px 20px; background: var(--qr-soft); border-radius: 8px; font-size: .86rem; }
.qr-fields dt { color: var(--muted); }
.qr-fields dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.qr-field-line { display: block; text-align: left; }
.qr-field-line + .qr-field-line { margin-top: 2px; }

.qr-checks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; }
.qr-checks li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.qr-checks li:first-child { border-top: 1px solid var(--line); }
.qr-check-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; color: #fff; background: var(--qr-info); }
.qr-check-mark .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.qr-checks .is-pass .qr-check-mark { background: var(--qr-pass); }
.qr-checks .is-warn .qr-check-mark { background: var(--qr-warn); }
.qr-checks .is-fail .qr-check-mark { background: var(--qr-fail); }
.qr-checks .is-info .qr-check-mark { background: transparent; color: var(--qr-info); box-shadow: inset 0 0 0 1.5px currentColor; }
.qr-checks strong { display: block; font-size: .9rem; font-weight: 600; line-height: 1.5; }
.qr-checks .is-fail strong { color: var(--qr-fail); }
.qr-checks .is-warn strong { color: var(--qr-warn); }
.qr-checks p { color: var(--muted); font-size: .84rem; line-height: 1.7; margin-top: 3px; }

.qr-limits { margin-top: 18px; font-size: .8rem; line-height: 1.7; color: var(--muted); }
.qr-limits strong { color: var(--ink); font-weight: 600; }

.qr-result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.qr-result-actions .button { min-height: 46px; padding: 11px 18px; gap: 10px; font-size: .82rem; }
.qr-result-actions .qr-action-secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.qr-result-actions .qr-action-secondary:hover { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Loading: Fold's own loop plus placeholder lines where the details will appear. */
.qr-skeleton { display: grid; gap: 10px; margin-top: 22px; }
.qr-skeleton span { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--qr-soft) 25%, color-mix(in srgb, var(--qr-soft) 55%, var(--qr-panel)) 50%, var(--qr-soft) 75%); background-size: 200% 100%; animation: qr-shimmer 1.4s linear infinite; }
.qr-skeleton span:nth-child(1) { width: 72%; }
.qr-skeleton span:nth-child(2) { width: 54%; }
.qr-skeleton span:nth-child(3) { width: 63%; }
@keyframes qr-shimmer { to { background-position: -200% 0; } }

.qr-result.is-entering > * { animation: qr-enter .22s var(--ease) both; }
@keyframes qr-enter { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  .qr-skeleton span, .qr-result.is-entering > * { animation: none; }
}

/* The dark landing design. */
body[data-concept="gateway"] .qr-check-section { --qr-pass: #5fd8a6; --qr-warn: #f2b45c; --qr-fail: #ff8f86; --qr-soft: #13243a; }
body[data-concept="gateway"] .qr-check-mark { color: #071622; }

@media (max-width: 1200px) { .qr-check-layout { gap: 48px; } }
@media (max-width: 920px) {
  .qr-check-layout { grid-template-columns: 1fr; gap: 36px; }
  .qr-check-intro { position: static; }
}
@media (max-width: 680px) {
  .qr-checker { padding: 20px 16px; border-radius: 8px; }
  .qr-checker-actions { display: grid; grid-template-columns: 1fr; }
  .qr-checker .qr-action { width: 100%; justify-content: center; }
  .qr-checker .qr-action-paste { justify-self: center; }
  .qr-camera { max-width: none; }
  .qr-result-head { flex-direction: column; gap: 12px; }
  .qr-result-head .fold-art { flex-basis: auto; width: 84px; }
  .qr-fields { grid-template-columns: 1fr; gap: 2px; padding: 14px 16px; }
  .qr-fields dd { margin-bottom: 10px; }
  .qr-fields dd:last-child { margin-bottom: 0; }
  .qr-result-actions .button { width: 100%; justify-content: center; }
}
/* Phones too narrow for logo and time side by side: stack them, both left-aligned. */
@media (max-width: 420px) {
  .qr-result-by { flex-direction: column; align-items: flex-start; gap: 8px; }
  .qr-result-by-text { justify-items: start; text-align: left; }
}

@media (forced-colors: active) {
  .qr-check-mark { forced-color-adjust: none; background: CanvasText; color: Canvas; }
  .qr-camera-frame { outline-color: Highlight; }
}
