/*
 * LabelCheck — TTB Compliance Checker.
 * Clean, modern interface: indigo/blue brand, slate neutrals, soft shadows
 * and generous rounding. Professional and trustworthy without imitating an
 * official government website.
 */

:root {
  --brand:       #005ea2; /* USWDS federal blue */
  --brand-dark:  #1a4480;
  --brand-50:    #eaf1f8; /* light tint */
  --brand-100:   #cfe0ef;
  --gold:        #f5b50a;
  --green:       #15803d;
  --green-50:    #ecfdf3;
  --amber:       #b45309;
  --amber-50:    #fff8eb;
  --red:         #c0362c;
  --red-50:      #fdf0ef;
  --ink:         #0f172a; /* slate-900 */
  --slate-700:   #334155;
  --slate-600:   #475569;
  --slate-500:   #64748b;
  --slate-300:   #cbd5e1;
  --slate-200:   #e2e8f0;
  --slate-100:   #f1f5f9;
  --slate-50:    #f8fafc;
  --bg:          #f5f7fb;
  --white:       #ffffff;
  --radius:      14px;
  --radius-sm:   10px;
  --radius-xs:   8px;
  --shadow:      0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 20px rgba(15, 23, 42, 0.06);
  --shadow-sm:   0 1px 2px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

/* ---------- Top bar ---------- */
.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand .logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1a4480 0%, #005ea2 100%);
  color: var(--white);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 4px 10px rgba(0, 94, 162, 0.32);
}
.brand .logo svg { width: 22px; height: 22px; }
.brand .brand-text { line-height: 1.15; }
.brand .brand-text strong { display: block; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.brand .brand-text span { font-size: 12px; color: var(--slate-500); font-weight: 500; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav a, .nav button {
  color: var(--slate-600);
  font-size: 14.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.nav a:hover, .nav button:hover { background: var(--slate-100); color: var(--ink); }
.nav a.active { background: var(--brand-50); color: var(--brand-dark); font-weight: 600; }
.nav form { margin: 0; display: inline; }

/* ---------- Layout ---------- */
.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 20px 72px;
}
.page-title { font-size: 30px; margin: 0 0 6px; color: var(--ink); letter-spacing: -0.02em; font-weight: 700; }
.page-sub { color: var(--slate-600); margin: 0 0 26px; font-size: 16px; max-width: 64ch; }

.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 22px;
}
.card h2 { margin-top: 0; color: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Forms ---------- */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14.5px;
  color: var(--slate-700);
}
.field .hint { font-weight: 400; color: var(--slate-500); font-size: 13px; }
.field input[type="text"],
.field input[type="password"],
.field input[type="file"] {
  width: 100%;
  padding: 11px 13px;
  font-size: 15.5px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.optional { color: var(--slate-500); font-weight: 400; font-size: 13px; }

/* ---------- Dropzone ---------- */
.dropzone { position: relative; }
/* Real input hidden but kept in the layout so HTML5 validation can anchor. */
.dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
.dropzone-ui {
  display: block;
  width: 100%;
  border: 2px dashed var(--slate-300);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.dropzone-ui:hover {
  border-color: var(--brand);
  background: var(--brand-50);
}
.dropzone.is-dragging .dropzone-ui {
  border-color: var(--brand);
  border-style: solid;
  background: var(--brand-50);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.dropzone.has-files .dropzone-ui {
  padding: 16px 20px;
}
.dropzone-icon {
  width: 30px;
  height: 30px;
  color: var(--slate-500);
}
.dropzone-ui:hover .dropzone-icon,
.dropzone.is-dragging .dropzone-icon { color: var(--brand); }
.dropzone-text { margin: 8px 0 2px; font-size: 15px; color: var(--slate-700); }
.dropzone-text strong { font-weight: 600; color: var(--ink); }
.dropzone-link { color: var(--brand); font-weight: 600; text-decoration: underline; }
.dropzone-hint { margin: 0; font-size: 13px; color: var(--slate-500); }

.dropzone-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.dropzone-previews:empty { display: none; }
.dropzone-thumb {
  position: relative;
  margin: 0;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  overflow: hidden;
}
.dropzone-thumb img {
  display: block;
  width: 100%;
  height: 80px;
  object-fit: cover;
  background: var(--slate-50);
}
.dropzone-thumb-file {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  background: var(--slate-50);
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-500);
}
.dropzone-thumb figcaption {
  padding: 4px 6px;
  font-size: 11px;
  color: var(--slate-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropzone-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.6);
  color: var(--white);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.dropzone-remove:hover { background: rgba(15, 23, 42, 0.85); }

.btn {
  display: inline-block;
  background: var(--brand);
  color: var(--white);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0, 94, 162, 0.3);
  transition: background 0.12s, transform 0.04s;
}
.btn:hover { background: var(--brand-dark); color: var(--white); }
.btn:active { transform: translateY(1px); }
.btn-secondary {
  background: var(--white);
  color: var(--brand);
  border: 1px solid var(--slate-300);
  box-shadow: none;
}
.btn-secondary:hover { background: var(--slate-50); color: var(--brand-dark); }
.btn-block { width: 100%; text-align: center; }

/* ---------- Flash ---------- */
.flash {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
  border: 1px solid;
  font-size: 15px;
}
.flash-notice { background: var(--green-50); border-color: #b7e4c7; color: #14532d; }
.flash-alert  { background: var(--red-50); border-color: #f3c2bd; color: #7f1d1d; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-pending, .badge-processing { background: var(--slate-100); color: var(--slate-600); }
.badge-complete { background: var(--green-50); color: var(--green); }
.badge-failed   { background: var(--red-50); color: var(--red); }
.badge-partial  { background: var(--amber-50); color: var(--amber); }

/* Verdict badges */
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
  font-size: 14px;
  border: 1px solid transparent;
}
.verdict-lg { font-size: 19px; padding: 10px 24px; border-radius: var(--radius-sm); }
.verdict-approve { background: var(--green-50); color: var(--green); border-color: #b7e4c7; }
.verdict-reject  { background: var(--red-50); color: var(--red); border-color: #f3c2bd; }
.verdict-needs_review { background: var(--amber-50); color: var(--amber); border-color: #f5d9a3; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--slate-200);
  vertical-align: top;
}
table.data thead th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--slate-200);
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tr.row-fail td { background: var(--red-50); }
table.data tr.row-fuzzy td { background: var(--amber-50); }

.match-icon { font-weight: 700; font-size: 17px; }
.match-true  { color: var(--green); }
.match-fuzzy { color: var(--amber); }
.match-false { color: var(--red); }
.field-name { font-weight: 600; text-transform: capitalize; }
.note { color: var(--slate-600); font-size: 13.5px; }

/* ---------- Misc ---------- */
.thumb {
  max-width: 320px;
  width: 100%;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
}
.meta-list { list-style: none; padding: 0; margin: 0; }
.meta-list li { padding: 7px 0; border-bottom: 1px solid var(--slate-100); }
.meta-list li:last-child { border-bottom: 0; }
.meta-list strong { color: var(--slate-600); font-weight: 600; }

.spinner {
  width: 44px; height: 44px;
  border: 5px solid var(--slate-200);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.muted { color: var(--slate-500); font-size: 14px; }
.code-block {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  overflow-x: auto;
  white-space: pre;
}

footer.site {
  background: var(--white);
  border-top: 1px solid var(--slate-200);
  color: var(--slate-500);
  font-size: 13px;
  padding: 24px 0;
  margin-top: 48px;
}
footer.site .inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
footer.site .footer-brand { font-weight: 700; color: var(--slate-700); }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .page-title { font-size: 24px; }
  .card { padding: 20px; }
  .brand .brand-text strong { font-size: 16px; }
}
