/* The MCA register's own screen.
   ==========================================================================

   **The five states are the product, so they are the design.** A register
   holding no insolvency is good news about the company. A register that was
   down is no news at all. Those two are drawn apart three times over, in
   colour, in shape and in words, because a reader who confuses them reaches
   the opposite of the truth and nothing on the page would tell them.

   The shape is the part worth explaining. Each source is a page in a file:

       found            a filled mark, because there is something on the page
       nothing found    a hollow mark, because the page is blank and that is
                        the answer
       could not look   a hatched mark, because the page is missing

   Filled, blank, missing. It reads the same in greyscale, on a projector and
   to somebody who cannot tell the green from the red, which no arrangement of
   coloured pills does.

   **System faces only, and that is the edge's rule rather than a preference.**
   `deploy/nginx/mca.conf.template` sends `default-src 'self'`, so a font from
   anywhere else is refused silently. One face for everything, and a monospace
   stack for company numbers and registration numbers alone: those are compared
   character by character by people reading them off a paper, and nothing else
   on the page is. */

:root {
  /* **Light only, white and navy**, as the product owner asked on
     29 September 2026: the dark theme read badly and nobody chose it. Every
     colour on the page is one of these; a literal anywhere below is a bug. */
  color-scheme: light;

  --paper:      #f4f6fa;
  --card:       #ffffff;
  --sunk:       #eef2f8;
  --ink:        #111827;
  --ink-2:      #4b5563;
  --ink-3:      #5f6b7a;
  --rule:       #e2e7ef;
  --rule-firm:  #c7cfdb;

  /* The platform's navy: buttons, the tab that is open, links, headings, a
     choice that is picked. White on it, and it on white, both pass AA. */
  --accent:      #233e84;
  --accent-deep: #182c61;
  --on-accent:   #ffffff;

  /* Registrar's ink. The source answered and there is a record. */
  --found:      #233e84;
  /* Cleared. The source answered and holds nothing, which is the good news. */
  --clear:      #1d6b40;
  --clear-soft: #e5f3eb;
  /* A hole in the file. Never the same colour family as cleared. */
  --void:       #b3261e;
  --void-soft:  #fcebe9;
  --warn:       #8a5300;

  --shadow: 0 1px 2px rgba(17, 24, 39, .06);

  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, sans-serif;
  --id: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 0 72px;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding-inline: 16px;
}

h1, h2, h3 { margin: 0; letter-spacing: -.011em; }
h1 { font-size: 17px; font-weight: 600; color: var(--accent); }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: var(--accent); }
h3 { font-size: 15px; font-weight: 600; }

a { color: var(--accent); }
a:hover { color: var(--accent-deep); }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* Company numbers, registration numbers, PANs. Nothing else. */
.id { font-family: var(--id); font-size: .92em; letter-spacing: -.01em; }

/* ---------------------------------------------------------------- signing in
   One card on an empty page. There is nothing else to do until it is done. */

.gate { min-height: 82vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card {
  width: 100%; max-width: 340px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 26px 24px;
}
.gate-card h1 { margin-bottom: 20px; }
.gate-card label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.gate-card input { width: 100%; margin-bottom: 14px; }
.gate-card button { width: 100%; }
.gate-card p { margin: 12px 0 0; font-size: 13px; }

/* -------------------------------------------------------------------- chrome */

.bar {
  border-bottom: 1px solid var(--rule);
  background: var(--card);
  margin-bottom: 26px;
}
.bar-in {
  max-width: 960px; margin: 0 auto;
  padding: 0 16px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  min-height: 52px;
}
.bar h1 { flex: 0 0 auto; }
.bar nav { display: flex; gap: 2px; margin-left: auto; }

button.tab {
  background: none; border: 0; border-radius: 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-3);
  font: inherit; font-size: 14px; font-weight: 500;
  padding: 15px 12px 13px;
  cursor: pointer;
}
button.tab:hover { color: var(--ink); }
button.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
button.tab span {
  margin-left: 6px; font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--on-accent); background: var(--ink-3);
  border-radius: 9px; padding: 1px 7px;
}
button.tab.on span { background: var(--accent); }
button.tab span:empty { display: none; }

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

input[type=text], input[type=password], input[type=file] {
  font: inherit;
  width: 100%;
  padding: 9px 11px;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--rule-firm);
  border-radius: 7px;
}
input[type=text] { font-variant-ligatures: none; }
input::placeholder { color: var(--ink-3); }
input[type=file] { padding: 7px 10px; }

label.field { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }

button {
  font: inherit; font-weight: 500;
  padding: 9px 17px;
  border-radius: 7px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}
button:not(.tab):not(.plain):not(.quiet):hover:not([disabled]) {
  background: var(--accent-deep); border-color: var(--accent-deep);
}
button.plain { background: var(--card); color: var(--accent); }
button.quiet {
  background: none; border-color: var(--rule-firm); color: var(--ink-2);
  padding: 6px 12px; font-size: 13px;
}
button.plain:hover:not([disabled]), button.quiet:hover:not([disabled]) { background: var(--sunk); }
button.quiet:hover:not([disabled]) { color: var(--ink); }
button[disabled] { opacity: .5; cursor: default; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1 1 220px; min-width: 0; }
.row > div.tight { flex: 0 0 auto; align-self: flex-end; }

/* --------------------------------------------------------------- the search
   **One field, because finding a company by name and by number is one job.**
   It was two boxes in two cards, and a person who had a number still had to
   know which of them to put it in. */

.hunt { margin-bottom: 28px; }
.hunt-row { display: flex; gap: 10px; align-items: stretch; }
.hunt input {
  flex: 1 1 auto;
  font-size: 17px;
  padding: 13px 15px;
  border-radius: 9px;
  box-shadow: var(--shadow);
}
.hunt button { flex: 0 0 auto; padding-inline: 20px; }

/* -------------------------------------------------------------------- panels */

.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}

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

table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left; padding: 7px 16px 7px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th:last-child, td:last-child { padding-right: 0; }
th {
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  border-bottom-color: var(--rule-firm);
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; white-space: nowrap; }
td.muted { color: var(--ink-3); }

.scroll { overflow-x: auto; }
/* A company with two dozen appeals must not push everything under it off the
   screen. The count above the table is the answer; the rows are the working. */
.tall { max-height: 24rem; overflow-y: auto; }

.muted { color: var(--ink-3); }
.bad { color: var(--void); }
.warn { color: var(--warn); }

.tag {
  display: inline-block; font-size: 12px; padding: 1px 7px;
  border: 1px solid var(--rule-firm); border-radius: 5px; color: var(--ink-2);
}

ul.plain { margin: 10px 0 0; padding-left: 18px; }
ul.plain li { margin-bottom: 4px; }

/* A refusal or an empty result, carrying the same mark the source cards carry.
   **The search is held to the page's own rule.** A register nobody has loaded
   answering nothing is not an answer about the company, and it was told as one
   until 22 September 2026: *no company's name starts with Amtek Auto Limited*,
   about a company that is on MCA's register and not on ours. The hatched mark
   is what says which of the two happened. */
.verdict {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0;
  padding: 14px 16px;
  font-size: 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule-firm);
  border-radius: 8px;
}
.verdict span { min-width: 0; }
.verdict .mark { align-self: center; }
.verdict.clear { border-left-color: var(--clear); }
.verdict.void {
  border-left-color: var(--void);
  background: var(--void-soft);
  color: var(--void);
  font-weight: 500;
}

p.more { margin: 12px 0 0; font-size: 13px; }
p.unit { margin: 8px 0 18px; font-size: 13px; }

/* --------------------------------------------------------------- statistics */

.facts { display: flex; gap: 26px; flex-wrap: wrap; }
.facts div { min-width: 64px; }
.facts b {
  display: block; font-size: 21px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.facts span { font-size: 12px; color: var(--ink-3); }
/* A figure that is a phrase rather than a count, so it is not squeezed into
   the big tabular numerals the counts use. */
.facts b.phrase { font-size: 16px; letter-spacing: -.01em; }

/* ==========================================================================
   The dossier
   ========================================================================== */

.who { margin-bottom: 18px; }
.who h2 {
  font-size: 24px; font-weight: 600; letter-spacing: -.02em;
  margin-bottom: 4px; text-wrap: balance;
}
.who p { margin: 0; color: var(--ink-3); }

/* The index: every source and its verdict on one line, before any of the
   detail. **Sticky**, so the shape of the answer is still on screen when the
   reader is four screens down a table of appeals. */
.index {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.index a {
  display: flex; align-items: baseline; gap: 12px;
  padding: 6px 16px;
  text-decoration: none; color: inherit;
}
.index a:last-child { padding-bottom: 9px; }
.index a:hover { background: var(--sunk); }
.index a + a { border-top: 1px solid var(--rule); }

/* The question each block of sources answers, said once in the index and again
   over the cards. **It names a question and never answers one**: there is no
   count and no verdict on a band, because three sources under one heading can
   be one found and two nobody could look at, and a band that summed them would
   be this page holding the opinion the service refuses to. */
.index .band {
  padding: 11px 16px 5px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
}
.index .band:first-child { border-top: 0; }
.index .what { flex: 1 1 auto; min-width: 0; font-size: 13.5px; }
.index .said { flex: 0 0 auto; font-size: 13px; color: var(--ink-2); text-align: right; }
.index .said.void { color: var(--void); font-weight: 500; }
.index .said.clear { color: var(--clear); }

/* **Pinned only where there is room to pin it.** The index is the answer in
   five lines and it is worth keeping on screen while somebody reads four
   screens of appeals under it, which is the whole reason it exists.
   **Width as well as height**, because the two are not independent: on a narrow
   screen the source titles wrap to three lines each and the same five rows
   stand 270px tall, which is a third of a phone. There it scrolls away like
   anything else. */
@media (min-height: 720px) and (min-width: 640px) {
  .index {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 5;
  }
  /* Cleared by the index, which the bands made taller. Measured rather than
     guessed: five rows and four bands stand about 270px. A card that scrolls
     to sit underneath the thing you clicked to reach it is worse than no
     index at all, so this is rounded up rather than down. */
  .src, .band-head { scroll-margin-top: 280px; }
}

/* The same heading over the cards, and over the filings below them, so the
   page has one way of saying a new question starts here. The rule running off
   to the right is what makes it read as a division rather than as a title, so
   a band with one card under it still looks like structure and not like a
   label somebody forgot to fill in. */
.band-head {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 0 10px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3);
  scroll-margin-top: 76px;
}
.band-head::after {
  content: ""; flex: 1 1 auto; height: 1px; background: var(--rule);
}
/* Only the first band under the index, which already carries the gap. The
   filings band is scoped out of this on purpose: it is a new question after a
   run of cards and it needs the air. */
#record > .band-head:first-of-type { margin-top: 0; }

/* The mark. Filled, hollow, hatched: there is something on this page, the
   page is blank, the page is missing. */
.mark {
  flex: 0 0 auto;
  width: 11px; height: 11px;
  border-radius: 2px;
  align-self: center;
}
.mark.found { background: var(--found); }
.mark.clear { border: 2px solid var(--clear); }
.mark.void {
  border: 1px solid var(--void);
  background-image: repeating-linear-gradient(
    -45deg, var(--void) 0 1.5px, transparent 1.5px 4px);
}
.mark.waiting { border: 1px dashed var(--ink-3); animation: breathe 1.6s ease-in-out infinite; }

@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

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

.src {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule-firm);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 12px;
  scroll-margin-top: 76px;
}
.src.found { border-left-color: var(--found); }
.src.clear { border-left-color: var(--clear); }
.src.void  { border-left-color: var(--void); background: var(--void-soft); }

.src .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.src .head h3 { flex: 1 1 auto; min-width: 0; font-size: 14px; }

.state {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.state.found { color: var(--found); }
.state.clear { color: var(--clear); }
.state.void  { color: var(--void); }
.state.waiting { color: var(--ink-3); font-weight: 500; }

.when { margin: 5px 0 0; font-size: 12px; color: var(--ink-3); }
.when b { font-weight: 400; }
.when b + b::before { content: ", "; }

.why { margin: 10px 0 0; font-size: 14px; }
.why.void { color: var(--void); font-weight: 500; }
.why.muted { color: var(--ink-2); font-weight: 400; }

.src table { margin-top: 12px; }
.src .facts { margin-top: 12px; }
.src .facts b { font-size: 18px; }

/* The status a company is on the register under. It is the one field on the
   master record an underwriter reads first, so it is not a row in a list. */
.standing {
  display: inline-block;
  margin-top: 12px;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  padding: 3px 12px;
  border-radius: 6px;
  background: var(--clear-soft); color: var(--clear);
}
.standing.gone { background: var(--void-soft); color: var(--void); }

.pairs {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 20px;
  margin: 14px 0 0;
  font-size: 14px;
}
.pairs dt { color: var(--ink-3); }
.pairs dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Two columns of pairs where there is room, because eleven facts in one
   column is a scroll for no reason. */
@media (min-width: 720px) {
  .pairs.wide {
    grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr);
    column-gap: 28px;
  }
}
@media (max-width: 460px) {
  .pairs { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pairs dd { margin-bottom: 8px; }
  .hunt-row { flex-wrap: wrap; }
  .hunt button { width: 100%; }
  .index .said { text-align: left; }
}

/* ==========================================================================
   Manual checks and lists
   ==========================================================================

   The tech team's entry screens (`INS-P-112`). Same panels, same marks: a
   category searched and clear carries the hollow mark, one with pledges the
   filled one, one never searched the dashed one, so the state reads the way
   the public record's cards do. */

select, input[type=date], input[type=datetime-local] {
  font: inherit;
  width: 100%;
  padding: 8px 10px;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--rule-firm);
  border-radius: 7px;
}
input[readonly] { background: var(--sunk); color: var(--ink-2); }

/* A value the machine read off a report, until somebody touches it. Dashed,
   as the approved mockup draws it, so the person confirming the form can see
   which boxes they did not type. */
input.read, select.read { border-style: dashed; border-color: var(--accent); }

span.field { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }

.panel-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { margin: 0; flex: 1 1 auto; }

label.check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
}

table.pick tbody tr { cursor: pointer; }
table.pick tbody tr:hover { background: var(--sunk); }

.ok { color: var(--clear); }
.nowrap { white-space: nowrap; }
td.court { min-width: 260px; }
.small { display: block; font-size: 12px; }
td .small { margin-top: 2px; }

.crumb { margin: 0 0 12px; font-size: 13px; }
ul.asked { margin: -6px 0 16px; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
ul.asked b { color: var(--ink); font-weight: 600; }
.row.by { max-width: 340px; margin-bottom: 18px; }

p.say { margin: 10px 0 0; font-size: 14px; }
.panel-head + p.say { margin: -6px 0 12px; }

/* One asset category of CERSAI, or one UDIN: a heading, its state, and the
   button that records the next one, on one line. */
.cat, .udin { border-top: 1px solid var(--rule); padding: 14px 0; }
.panel-head + .cat, .panel-head + .udin, .panel-head + p.say + .cat,
.panel-head + p.say + .udin { border-top: 0; padding-top: 0; }
.cat:last-of-type { padding-bottom: 0; }
.cat-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cat-head h3 { min-width: 100px; }
.cat-head .when { flex: 1 1 auto; font-size: 12px; color: var(--ink-3); }
.cat-head button { margin-left: auto; }
.cat table.searches { margin-top: 10px; font-size: 13px; }

.pledge {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--found);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
}
/* A pledge already paid off raises nothing, so it steps back. */
.pledge.settled { border-left-color: var(--rule-firm); }
.pledge h4 { margin: 0; font-size: 14px; font-weight: 600; }
.pledge .sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.pledge .pairs { margin-top: 10px; }
.pledge p.warn { margin: 8px 0 0; }

/* The words under a figure, as a cheque carries them. */
.inwords { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.35; margin-top: 2px; }

.entered { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }

.sitting { padding: 4px 0 14px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.sitting .pairs { margin-top: 0; }
.sitting table { margin-top: 10px; }
table.grid .state { font-weight: 500; }
h3.sub-head { margin: 4px 0 8px; }

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

form.entry {
  margin-top: 14px;
  padding: 16px;
  background: var(--sunk);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
form.entry h3 { margin-bottom: 14px; }
form.entry h4 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
form.entry .row { margin-bottom: 12px; }
form.entry .row > div { flex-basis: 180px; }
form.entry p.more { margin: 8px 0 12px; }

table.edit td { padding-top: 4px; padding-bottom: 4px; }
table.edit input { padding: 6px 8px; font-size: 14px; }
td.court .pair { display: flex; gap: 6px; margin-top: 6px; }
td.court .pair input { font-size: 13px; }

.case {
  border: 1px solid var(--rule-firm);
  border-radius: 8px;
  padding: 14px 14px 2px;
  margin-bottom: 12px;
  background: var(--card);
}

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Two or three answers side by side, every one visible, because these are
   read back at a glance and a select hides the answer not chosen. */
.seg {
  display: inline-flex;
  border: 1px solid var(--rule-firm);
  border-radius: 7px;
  overflow: hidden;
  background: var(--card);
}
.seg label { display: inline-flex; cursor: pointer; }
.seg label + label { border-left: 1px solid var(--rule-firm); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg span { padding: 6px 10px; font-size: 13px; white-space: nowrap; color: var(--ink-2); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------------------------------------------------------------- the lists */

details.states { margin-top: 14px; }
details.states summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
details.states table { margin-top: 8px; }
ol.steps { margin: 12px 0 16px; padding-left: 20px; font-size: 14px; }
ol.steps li { margin-bottom: 4px; }
#lf-out { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
