/*
  The whole stylesheet for this host, served from its own wwwroot. Element selectors almost
  throughout, so pages carry markup rather than class vocabulary; the two class hooks that do appear
  are the ones the framework generates for a form (.validation-message) and the single refusal line a
  page can show (.rejection).

  Nothing is fetched from a CDN. An admin sign-in page that reaches a third party to render tells that
  third party when the operator signs in, and stops rendering properly when they have an outage — for
  two forms, neither is worth it. System fonts for the same reason: no request leaves this host.
*/

/*
  Palette drawn from the RelayRobin mark, sampled from the artwork rather than transcribed:
  dark brown #521607 is 53% of it, light brown #79210B 22%, orange #DC491E 13%, red #CA3411 9%.
  The interface uses the dark brown and the red only. Orange and light brown are left to the mark
  itself, so it stays the most saturated thing on the page — the role it plays in the artwork.

  --accent is only ever FILLED (button background, link, focus ring); --alarm only ever OUTLINED
  or set as text. That split is what lets a warm accent sit beside a warm alarm without a
  destructive action ever resembling a routine one: they differ in shape before they differ in
  hue. Preserve it if you add a rule — a filled alarm would undo the whole arrangement.
*/
:root {
    --page: #fdfbfa;
    --ink: #23120c;
    --muted: #6b5a53;
    --line: #e0d5d0;
    --field: #ffffff;
    --accent: #521607;
    --accent-ink: #ffffff;
    --alarm: #ca3411;
}

@media (prefers-color-scheme: dark) {
    /*
      The brand browns are unreadable on a dark ground, so the accent lifts to a tint derived from
      the orange and takes dark-brown ink instead of white. The alarm lifts too, and is pushed
      further toward red so the two stay tellable apart at small sizes.
    */
    :root {
        --page: #1a1210;
        --ink: #f0e6e2;
        --muted: #a89690;
        --line: #3a2a25;
        --field: #221816;
        --accent: #e2734b;
        --accent-ink: #2a0b03;
        --alarm: #ff8a73;
    }
}

* {
    box-sizing: border-box;
}

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

header {
    border-bottom: 1px solid var(--line);
    padding: 0.9rem 1.25rem;
}

header p {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/*
  The mark sits beside the console's own name rather than replacing it. Both hosts render the same
  mark, so they read as one product; the text beside it is what tells an operator which of the two
  they are looking at, and only one of them can drop a database.

  Height is set and width left auto so the aspect ratio comes from the file. The asset ships at
  128px tall for a 26px render, which keeps it sharp on a high-density display.
*/
.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand img {
    height: 26px;
    width: auto;
    display: block;
}

/*
  The full lockup, wordmark and tagline included, appears only on sign-in and first-run setup —
  the two screens with room for it and a reason to introduce the product. Every other screen gets
  the mark above.
*/
.lockup {
    display: block;
    height: 62px;
    width: auto;
    margin: 0 auto 1.5rem;
}

header nav {
    display: flex;
    gap: 1rem;
    align-items: baseline;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

header nav span {
    margin-left: auto;
    color: var(--muted);
}

main {
    margin: 0 auto;
    max-width: 26rem;
    padding: 2.5rem 1.25rem 4rem;
}

/* A page whose content is a table needs the wide column every console list gets — the agent list,
   the agent detail and the invites list among them — never the narrow one sized for a sign-in or
   setup form. No class hook: the table's own presence is the signal, so a page opts in by what it
   renders rather than by a marker added to it. */
main:has(table) {
    max-width: 60rem;
}

h1 {
    font-size: 1.5rem;
    line-height: 1.25;
    margin: 0 0 0.75rem;
}

p {
    color: var(--muted);
    margin: 0 0 1.25rem;
}

strong {
    color: var(--ink);
}

a {
    color: var(--accent);
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    padding: 0.55rem 0.65rem;
    text-align: left;
}

th {
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-weight: 600;
}

form {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

input {
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: inherit;
    font: inherit;
    margin-bottom: 1rem;
    padding: 0.55rem 0.65rem;
    width: 100%;
}

input:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button {
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--accent-ink);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.6rem 1rem;
}

/* Framework-generated, on every field a DataAnnotations rule rejected. */
.validation-message {
    color: var(--alarm);
    font-size: 0.85rem;
    margin: -0.75rem 0 1rem;
}

/* The one refusal a page shows. Deliberately the same treatment whatever caused it — the pages
   themselves only ever have one message to put here. */
.rejection {
    border: 1px solid var(--alarm);
    border-radius: 6px;
    color: var(--alarm);
    margin-bottom: 1.5rem;
    padding: 0.65rem 0.8rem;
}
