/* Returned Check Registry - single stylesheet.
   Phone first: large tap targets, readable text, tables that stack. */

:root {
  --navy: #12324f;
  --navy-light: #1d5480;
  --bg: #f4f6f9;
  --white: #ffffff;
  --ink: #1f2937;
  --ink-soft: #667085;
  --line: #dfe4ec;
  --red: #b42318;
  --red-bg: #fdecea;
  --amber: #b54708;
  --amber-bg: #fef4e6;
  --green: #027a48;
  --green-bg: #e8f6ef;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

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

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

/* -------------------------------------------------- top bar */

.topbar { background: var(--navy); color: #fff; padding: 12px 0; }

.topbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .15);
  font-size: 13px;
  letter-spacing: .5px;
}

.brand-text { font-size: 16px; }

.menu { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.menu > a {
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 15px;
}

.menu > a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.menu > a.on { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 600; }

.menu a.menu-cta { background: #fff; color: var(--navy); font-weight: 600; }

.lang-switch {
  display: inline-flex;
  margin-left: 4px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 8px;
  overflow: hidden;
}

.lang-switch a {
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  color: rgba(255, 255, 255, .8);
  text-decoration: none;
}

.lang-switch a + a { border-left: 1px solid rgba(255, 255, 255, .25); }
.lang-switch a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.lang-switch a.on { background: #fff; color: var(--navy); }

/* -------------------------------------------------- text */

main { padding: 24px 0 48px; }

h1 { font-size: 26px; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 10px; }
h3 { font-size: 17px; margin: 0 0 6px; }

.lead { color: var(--ink-soft); margin: 0 0 20px; }
.muted { color: var(--ink-soft); font-size: 14px; }
.center { text-align: center; margin-top: 20px; }
.opt { color: var(--ink-soft); font-weight: 400; font-size: 13px; }
.req { color: var(--red); }
.hint { color: var(--ink-soft); font-size: 14px; margin: 0 0 12px; }

a { color: var(--navy-light); }
.link { font-weight: 600; text-decoration: none; white-space: nowrap; }
.link:hover { text-decoration: underline; }

/* -------------------------------------------------- search hero */

.hero {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  margin-bottom: 24px;
  text-align: center;
}

.searchbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 640px;
  margin: 20px auto 12px;
}

.searchbar input {
  flex: 1 1 240px;
  padding: 14px 16px;
  font-size: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.searchbar button {
  flex: 0 0 auto;
  padding: 14px 26px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.searchbar button:hover { background: var(--navy-light); }

.counters { color: var(--ink-soft); font-size: 14px; margin: 0; }

/* -------------------------------------------------- cards */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.card.warn { border-left: 4px solid var(--amber); }
.card.empty { text-align: center; padding: 36px 20px; }

.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.card-head h1, .card-head h2 { margin: 0; }

.ident {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* Owner name, shown under the company printed on the check. */
.sub-ident {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 600;
}

/* Small explanation printed under a single input. */
.field-hint {
  display: block;
  margin-top: 6px;
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-soft);
}

.risk-note { margin: 0 0 16px; font-weight: 600; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-head h1 { margin: 0; }

/* -------------------------------------------------- badges and pills */

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-high   { background: var(--red-bg);   color: var(--red); }
.badge-medium { background: var(--amber-bg); color: var(--amber); }
.badge-low    { background: var(--green-bg); color: var(--green); }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-open         { background: var(--red-bg);   color: var(--red); }
.pill-payment_plan { background: var(--amber-bg); color: var(--amber); }
.pill-disputed     { background: var(--amber-bg); color: var(--amber); }
.pill-paid         { background: var(--green-bg); color: var(--green); }

/* -------------------------------------------------- tables */

.table-scroll { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }

.table th {
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px 10px 0;
  white-space: nowrap;
}

.table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }

/* -------------------------------------------------- record facts */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 0;
}

.facts dt {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--ink-soft);
}

.facts dd { margin: 2px 0 0; font-weight: 600; }
.big { font-size: 20px; }

.note-block {
  margin: 18px 0 0;
  padding: 14px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 15px;
}

/* -------------------------------------------------- forms */

.form-narrow { max-width: 480px; margin: 0 auto; }
.form-wide { max-width: 820px; margin: 0 auto; }

fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 18px 0 0;
  margin: 0 0 8px;
}

fieldset:first-of-type { border-top: 0; padding-top: 0; }

legend { font-weight: 700; font-size: 15px; color: var(--navy); padding: 0 8px 0 0; }

label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 15px; }
label.tight { margin-bottom: 0; }

input[type=text], input[type=email], input[type=password], input[type=search],
input[type=date], input[type=file], select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--navy-light);
  outline-offset: 1px;
  border-color: var(--navy-light);
}

textarea { resize: vertical; }

.two, .three { display: grid; gap: 0 14px; }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  font-size: 15px;
  background: var(--bg);
  padding: 14px;
  border-radius: 10px;
}

.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.row-actions input[type=file] { flex: 1 1 220px; width: auto; }


/* -------------------------------------------------- read-the-photo box */

.ocr-box {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.ocr-box .hint { margin: 10px 0 0; }

#ocr-message:not(:empty) { margin-top: 12px; }

.field-filled {
  background: #fffbea;
  border-color: #e6c200;
}

/* -------------------------------------------------- buttons */

.btn {
  display: inline-block;
  padding: 13px 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--navy);
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { background: var(--navy-light); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-wide { display: block; width: 100%; margin-top: 8px; }

.btn-alt { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-alt:hover { background: var(--bg); }

.btn-danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover { background: var(--red-bg); }

/* -------------------------------------------------- notices */

.notice {
  padding: 13px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 500;
}

.notice-error   { background: var(--red-bg);   color: var(--red); }
.notice-success { background: var(--green-bg); color: var(--green); }
.notice-warn    { background: var(--amber-bg); color: var(--amber); }

/* -------------------------------------------------- photos */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.gallery img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.thumbs img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

/* -------------------------------------------------- misc */

.steps {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.step {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.step-n {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}

.step p { color: var(--ink-soft); margin: 0; font-size: 15px; }

.stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 20px;
}

.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat-v { display: block; font-size: 24px; font-weight: 700; color: var(--navy); }
.stat-l { display: block; font-size: 14px; color: var(--ink-soft); }

.plain-list { margin: 0 0 12px; padding-left: 18px; }
.plain-list li { margin-bottom: 6px; }

.footer { border-top: 1px solid var(--line); padding: 20px 0; background: #fff; }
.footer p { margin: 0; color: var(--ink-soft); font-size: 13px; text-align: center; }

/* -------------------------------------------------- wider screens */

@media (min-width: 700px) {
  h1 { font-size: 30px; }
  .two   { grid-template-columns: 1fr 1fr; }
  .three { grid-template-columns: 1fr 1fr 1fr; }
}

/* -------------------------------------------------- phones: stacked tables */

@media (max-width: 640px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }

  .table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 12px;
  }

  .table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border-bottom: 1px dashed var(--line);
    padding: 9px 0;
    text-align: right;
  }

  .table td:last-child { border-bottom: 0; }

  .table td::before {
    content: attr(data-label);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    text-align: left;
  }
}
