/* ═══════════════════════════════════════════════════════════════════════════
   VerifyPro — UI completeness layer
   ═══════════════════════════════════════════════════════════════════════════

   Loaded after `app.css` by `layouts/partials/head.blade.php`, and a SEPARATE
   file on purpose: `app.css` is the V5 prototype's stylesheet, converted
   verbatim, and keeping it verbatim is what makes "does this match V5?" a
   readable diff. Everything that did not exist in the prototype — the public
   marketing shell, the error pages, loading skeletons, empty states, keyset
   controls, the console search box and the accessibility layer — lands here.

   EVERY colour below is a token declared in `app.css`'s :root and re-declared by
   each of the twelve `body[data-theme=…]` blocks. There is not one literal hex
   in this file, which is the only reason a page built from these classes is
   legible on Neon and on Bright without a second palette being maintained.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ——— Keyboard access ——————————————————————————————————————————————— */

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--primary); color: #fff; font-weight: 700;
  padding: .65rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
  outline: 3px solid var(--accent); outline-offset: 2px; text-decoration: none;
}

/*
   A visible focus ring on everything focusable, rather than only on the
   components that happened to declare one. `:focus-visible` keeps it off mouse
   clicks, so this costs nothing visually and is the difference between a
   keyboard user being able to see where they are and not.
*/
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ——— Public shell ——————————————————————————————————————————————————— */

.site-shell { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--topbar-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: var(--topbar-h); flex-wrap: wrap;
}
.site-brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 800; color: var(--text); text-decoration: none; font-size: 1rem;
}
.site-brand:hover { text-decoration: none; }
.site-brand .mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  font-size: .72rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.site-nav { display: flex; align-items: center; gap: 1.15rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-muted); font-weight: 600; font-size: .88rem;
  text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--primary); }
.site-header-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

main.site-shell { padding-top: 1.75rem; padding-bottom: 2.5rem; }

.site-footer {
  border-top: 1px solid var(--border); background: var(--bg-muted);
  padding: 2.25rem 0 1.5rem; margin-top: 2rem;
}
.site-footer h4 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted);
}
.site-footer-list { list-style: none; margin: 0; padding: 0; }
.site-footer-list li { margin: .3rem 0; font-size: .87rem; }
.site-footer .footer-note { margin-top: 1.75rem; }

@media (max-width: 860px) {
  .site-header-inner { padding-top: .75rem; padding-bottom: .75rem; }
  .site-nav { order: 3; width: 100%; gap: .9rem; }
}

/* ——— Marketing blocks ——————————————————————————————————————————————— */

.hero { padding: 2.5rem 0 1.5rem; }
.hero h1 { font-size: 2.35rem; max-width: 20ch; }
.hero p.lead { font-size: 1.06rem; max-width: 64ch; color: var(--text-muted); }
.hero .btn-group { margin-top: 1.25rem; display: flex; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 720px) { .hero h1 { font-size: 1.8rem; } }

.claim-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.claim-list li {
  position: relative; padding-left: 1.4rem; margin: .45rem 0;
  font-size: .92rem; color: var(--text-muted);
}
.claim-list li::before {
  content: "\2713"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 800;
}

/* ——— Long-form documents (legal, docs) ——————————————————————————————— */

.doc-body { max-width: 76ch; }
.doc-body h2 { margin-top: 2rem; }
.doc-body h3 { margin-top: 1.35rem; }
.doc-body p, .doc-body li { color: var(--text-muted); }
.doc-body ul, .doc-body ol { padding-left: 1.25rem; }
.doc-body li { margin: .3rem 0; }
.doc-body table.data { margin: 1rem 0; }

.doc-meta {
  display: flex; flex-wrap: wrap; gap: 1.25rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem 1rem; background: var(--bg-muted); margin-bottom: 1.5rem;
  font-size: .82rem;
}
.doc-meta div span {
  display: block; color: var(--text-muted); font-size: .7rem;
  text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
}
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { margin: .3rem 0; font-size: .88rem; }

/* ——— Error pages ——————————————————————————————————————————————————— */

.error-shell {
  min-height: 100vh; display: grid; place-items: center;
  padding: 2rem 1.25rem; background: var(--bg);
}
.error-card {
  width: 100%; max-width: 560px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 2rem;
}
.error-code {
  font-family: var(--mono); font-size: 3rem; font-weight: 700;
  line-height: 1; letter-spacing: -.04em; color: var(--primary); margin-bottom: .5rem;
}
.error-ref {
  margin-top: 1.5rem; padding: .75rem .9rem; border-radius: var(--radius-sm);
  background: var(--bg-muted); border: 1px solid var(--border);
  font-size: .8rem; color: var(--text-muted);
}
.error-ref code { color: var(--text); font-weight: 600; user-select: all; }
.error-card .btn-group { margin-top: 1.25rem; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ——— Loading skeletons ————————————————————————————————————————————— */

.skeleton {
  display: block; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--row-hover) 37%, var(--bg-muted) 63%);
  background-size: 400% 100%;
  animation: skeleton-sheen 1.4s ease-in-out infinite;
  height: 1rem; margin: .45rem 0;
}
.skeleton.line-sm { width: 40%; }
.skeleton.line-md { width: 65%; }
@keyframes skeleton-sheen {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/*
   The async-region contract. A region declares `data-async-region` and toggles
   `aria-busy`; the skeleton shows while busy and the content shows when it is
   not. Screen readers get the state from `aria-busy` and the update from
   `aria-live` on the same element, so there is one source of truth rather than a
   visual state and an announced state that can disagree.
*/
[data-async-region][aria-busy="true"] .async-content { display: none; }
[data-async-region]:not([aria-busy="true"]) .async-skeleton { display: none; }

/* ——— Empty states ——————————————————————————————————————————————————— */

.empty-state {
  text-align: center; padding: 2.5rem 1.5rem;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--bg-muted);
}
.empty-state h3 { margin-bottom: .35rem; }
.empty-state p { max-width: 52ch; margin-left: auto; margin-right: auto; }
.empty-state .btn-group {
  display: flex; justify-content: center; gap: .5rem;
  margin-top: .9rem; flex-wrap: wrap;
}

/* ——— Keyset pagination ————————————————————————————————————————————— */

.keyset {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-top: 1rem; flex-wrap: wrap;
}
.keyset .hint { font-size: .8rem; color: var(--text-muted); }
.btn[aria-disabled="true"], .btn[disabled] { opacity: .5; pointer-events: none; }

/* ——— Console search box ————————————————————————————————————————————— */

.topbar-search { display: flex; align-items: center; gap: .4rem; }
.topbar-search input {
  background: var(--input-bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: .35rem .8rem; font-size: .82rem; width: 220px;
}
@media (max-width: 960px) { .topbar-search input { width: 130px; } }
@media (max-width: 640px) { .topbar-search { display: none; } }

/* ——— Inline validation ————————————————————————————————————————————— */

.field .error { color: var(--danger); font-size: .8rem; font-weight: 600; margin: 0; }
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--danger); }
.required-mark { color: var(--danger); font-weight: 800; }

/* ——— Mobile and tablet ————————————————————————————————————————————— */

@media (max-width: 720px) {
  .page { padding: 1rem .9rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: .6rem; }
  table.data { font-size: .82rem; }
  table.data th, table.data td { padding: .5rem .55rem; }
  .btn-group { flex-wrap: wrap; }
  .doc-meta { gap: .75rem; }
}
