/* Design tokens lifted from references/prototype/project/logviq.dc.html —
   same token names, same values, so the login screen and the rest of the app
   share one visual language. Accent swapped to RNFI blue (#0077AC) per the
   Relipay design system (references/.../colors_and_type.css). */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  background: var(--s0);
  color: var(--tp);
}

:root {
  --s0: #fafafa; --s1: #ffffff; --s2: #f4f4f5;
  --tp: #18181b; --ts: #52525b; --tm: #9d9da8;
  --bd: rgba(17, 17, 20, .14);
  --ok-bg: #e7f6ee; --ok-tx: #0e7a45;
  --warn-bg: #fdf3dd; --warn-tx: #96660a;
  --dng-bg: #fdecec; --dng-tx: #c22a2a;
  --acc-bg: #e9effc; --acc-tx: #0077AC; --acc: #0077AC;
}
[data-theme="dark"] {
  --s0: #0b0b0d; --s1: #141418; --s2: #1e1e24;
  --tp: #f0f0f3; --ts: #a3a3af; --tm: #64646f;
  --bd: rgba(255, 255, 255, .15);
  --ok-bg: #10301f; --ok-tx: #4ade80;
  --warn-bg: #2e2308; --warn-tx: #fbbf24;
  --dng-bg: #331313; --dng-tx: #f87171;
  --acc-bg: #16223e; --acc-tx: #5b9fe8; --acc: #2f7cc7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --s0: #0b0b0d; --s1: #141418; --s2: #1e1e24;
    --tp: #f0f0f3; --ts: #a3a3af; --tm: #64646f;
    --bd: rgba(255, 255, 255, .15);
    --ok-bg: #10301f; --ok-tx: #4ade80;
    --warn-bg: #2e2308; --warn-tx: #fbbf24;
    --dng-bg: #331313; --dng-tx: #f87171;
    --acc-bg: #16223e; --acc-tx: #5b9fe8; --acc: #2f7cc7;
  }
}

a { color: var(--acc-tx); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, button, textarea { font-family: inherit; font-size: 13px; color: var(--tp); }
input, select, textarea {
  background: var(--s1); border: 0.5px solid var(--bd); border-radius: 8px;
  padding: 7px 10px; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--acc); }

.container { max-width: 1080px; margin: 0 auto; padding: 28px 32px 64px; }
.card { background: var(--s1); border: 0.5px solid var(--bd); border-radius: 12px; }
.card-link { cursor: pointer; transition: background-color .12s ease; }
.card-link:hover { background: var(--s2); }
.card-link:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: var(--s1); border: 0.5px solid var(--bd);
  border-radius: 8px; cursor: pointer; color: var(--ts);
}
.icon-btn:hover { background: var(--s2); }
.btn-primary {
  background: var(--tp); color: var(--s1); border: none; border-radius: 8px;
  padding: 9px 14px; font-weight: 500; cursor: pointer;
}
.btn-outline {
  background: transparent; border: 0.5px solid var(--bd); border-radius: 8px;
  padding: 8px 14px; font-weight: 500; cursor: pointer; color: var(--ts);
}
.btn-outline:hover { background: var(--s2); }
.badge {
  border-radius: 5px; padding: 2px 8px; font-size: 11px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); color: var(--ok-tx); }
.badge-warn { background: var(--warn-bg); color: var(--warn-tx); }
.badge-dng { background: var(--dng-bg); color: var(--dng-tx); }
.badge-acc { background: var(--acc-bg); color: var(--acc-tx); }
.badge-muted { background: var(--s2); color: var(--tm); }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  min-width: 210px; background: var(--s1); border: 0.5px solid var(--bd);
  border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.14); overflow: hidden;
}
.menu-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  font-size: 12.5px; color: var(--tp); text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: var(--s2); }

/* Retry buttons (Check now / retry-verify on the person page): htmx adds
   .htmx-request to the form carrying the hx-post attribute for the
   duration of the request — swap the icon for a spinner purely in CSS,
   no JS needed to know when a request is in flight. */
.icon-loading { display: none; }
.retry-form.htmx-request .icon-normal { display: none; }
.retry-form.htmx-request .icon-loading { display: inline-block; }
.spinner {
  width: 13px; height: 13px; border: 1.6px solid var(--bd); border-top-color: var(--tp);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Double-click-to-edit OCR fields (person page) */
.ocr-field { cursor: text; border-bottom: 1px dashed var(--bd); }
.ocr-field:hover { border-bottom-color: var(--acc); }
.ocr-field input {
  font: inherit; color: inherit; border: 1px solid var(--acc); border-radius: 4px;
  padding: 1px 4px; width: 160px; background: var(--s1);
}

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--bd); border-radius: 12px; padding: 36px 20px;
  cursor: pointer; text-align: center; background: var(--s1);
  transition: background-color .12s ease, border-color .12s ease;
}
.dropzone input[type="file"] { display: none; }
.dropzone:hover { background: var(--s2); }
.dropzone.dropzone-active { background: var(--acc-bg); border-color: var(--acc); border-style: solid; }
.dropzone-icon { color: var(--tm); }
.dropzone-title { font-weight: 500; font-size: 13px; }
.dropzone-title u { color: var(--acc-tx); text-decoration: underline; }
.dropzone-sub { color: var(--tm); font-size: 11px; }
.dropzone.dropzone-has-file { border-style: solid; border-color: var(--ok-tx); }
.dropzone.dropzone-has-file .dropzone-icon { color: var(--ok-tx); }
.dropzone.dropzone-has-file .dropzone-title { color: var(--ok-tx); }
.dropzone-sm { padding: 18px 12px; border-radius: 10px; gap: 6px; }

.dropzone-summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 12px 16px; font-weight: 500; font-size: 13px;
  display: flex; align-items: center; gap: 8px; color: var(--ts);
}
.dropzone-summary::-webkit-details-marker { display: none; }
.dropzone-summary:hover { background: var(--s2); }
.dropzone-summary .chevron { transition: transform .15s ease; flex: none; }
details[open] > .dropzone-summary .chevron { transform: rotate(90deg); }

table.rows { width: 100%; border-collapse: collapse; }
table.rows th {
  text-align: left; font-weight: 500; color: var(--ts); font-size: 11px;
  text-transform: uppercase; letter-spacing: .03em;
  padding: 8px 12px; border-bottom: 0.5px solid var(--bd);
}
table.rows td { padding: 8px 12px; border-bottom: 0.5px solid var(--bd); vertical-align: middle; }
table.rows tr:last-child td { border-bottom: none; }
table.rows tr:hover td { background: var(--s2); }
