/* What is left of the Blazor project template's stylesheet, and it is now only one thing: the
   Bootstrap that the Identity pages and the error page are written in.

   Those pages are the reason this file still exists. /Account/* and /Error carry
   [ExcludeFromInteractiveRouting] or are reached without a circuit, so they render statically, in
   Bootstrap markup, always in light: there is no circuit for MudBlazor's dark palette to be
   switched on over, and nothing below can reach a page the application draws itself. So a literal
   colour in this file is correct rather than an oversight, which is the opposite of the rule
   everywhere else, and each rule below says which page needs it.

   Nothing here may use an element or a bare-type selector that the themed application also
   matches. A rule in this file beats MudBlazor's: App.razor links bootstrap, then MudBlazor, then
   this, so at equal specificity this one wins. That is exactly how the template's
   "html, body { font-family: 'Helvetica Neue', Helvetica, Arial }" quietly overrode BrokerTheme's
   system font stack on every screen in the application, for as long as it sat here. It has gone,
   and MudBlazor's own "body { font-family: var(--mud-typography-default-family) }" is what paints
   the text now.

   Three other rules have gone with it. ".content" was this application's rather than Bootstrap's
   and moved into MainLayout.razor.css, next to the element it styles. "h1:focus { outline: none }"
   took the focus ring off a heading for a template pattern this application does not use, so it
   only ever cost somebody navigating by keyboard the one thing telling them where they were.
   ".blazor-error-boundary", and the encoded warning triangle inside it, styled a component
   nothing renders: there is no ErrorBoundary anywhere in this solution, so the rule had never
   matched an element.

   The left navigation's rules have gone too. There was a block here restating white text and
   white hover states for the menu, because MudBlazor painted MudNavMenu with the light theme's
   near-black and the sidebar behind it was the template's dark gradient. Both halves of that have
   gone. The menu sits in a MudDrawer, which MudBlazor paints from --mud-palette-drawer-background
   and --mud-palette-drawer-text, so it takes the right colours in light and in dark from the
   theme and nothing needs restating. */

/* Links, on the Bootstrap pages and on the disconnection banner, which are the only places a bare
   anchor is rendered. Every link the application itself draws is a MudNavLink, a MudLink or a
   MudButton with an Href, and each of those carries a class, which outranks this element selector
   however late this file loads. So this reaches the sign-in and account pages, the error page, and
   the "Reload" in the yellow band at the foot of the window, and nothing else.

   Kept rather than deleted for the band's sake as much as the Identity pages'. The band is
   deliberately outside the theme and always lightyellow, and this blue on it is 5.45:1 where
   Bootstrap's own link colour, which is what would apply instead, is 4.42:1 and under the
   threshold. */
a, .btn-link {
    color: #006bb7;
}

/* The submit button on every Identity form: Log in, Register, Change password and the rest. */
.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

/* The focus ring for those forms. Bootstrap's own is a wide translucent halo; this is the
   template's tighter two-stop ring, and it is the only focus indicator those pages have. */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Blazor's own validation classes, which only EditForm writes. Every form in the application
   proper is a MudForm and colours its own fields from the palette, so these reach the Identity
   pages alone. */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* "Remember me" on the sign-in page. Bootstrap's default border is too faint to find on white. */
.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* The floating labels the Identity forms are built from. Bootstrap shows the placeholder and the
   label in the same place, so the placeholder is pushed to the end until the field has focus. */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* The stored record of what one piece of advice stood on, shown on the recommendation page inside a
   <details> element. It is written as plain text with its own line breaks and indentation, so a <pre>
   is what keeps it readable; pre-wrap rather than pre so a long address or product name wraps in a
   narrow window instead of pushing the page sideways. The colour comes from the live palette, so this
   reaches dark mode without a rule of its own. */
pre.recommendation-record {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

/* The reason lines of one evaluation. Nothing here distinguishes a test that passed from one that
   failed, deliberately: the engine writes both with the same shape and the page must not guess which
   is which, so both read with the same weight and both carry their figure and their threshold. */
ul.recommendation-reasons {
    margin: 0;
    padding-left: 1.25rem;
}

/* ---------------------------------------------------------------- the Best Interests Duty record

   BestInterestsRecord.razor, on screen and on paper. It is written as plain semantic markup rather
   than as themed panels, so that the one thing it must never do, rely on a colour to carry a
   meaning, is impossible rather than merely avoided: every distinction on that page is a word.

   On screen the ink and the lines come from the live palette, so the page reads correctly in dark
   mode like every other screen. On paper the rules below force black on white, because a broker
   printing a compliance record should not be spending toner on a theme, and a page printed in
   greyscale from a dark palette is where a light grey caption becomes unreadable.

   Class selectors throughout. app.css loads after MudBlazor and would beat it at equal specificity,
   so nothing here may use a bare element selector that the themed application also matches. */
.bid-record {
    max-width: 52rem;
    color: var(--mud-palette-text-primary);
}

.bid-record h1 {
    font-size: 1.5rem;
    margin: 0 0 0.25rem 0;
}

.bid-record h2 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.4rem 0;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.bid-record h3 {
    font-size: 0.95rem;
    margin: 1rem 0 0.3rem 0;
}

/* Who and what the sheet is about, directly under the title. Kept together on one page, because a
   record whose subject line printed on the sheet after its heading would be two loose sheets. */
.bid-record .bid-subject {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.bid-record p {
    margin: 0 0 0.5rem 0;
}

.bid-record blockquote {
    margin: 0 0 0.5rem 0;
    padding-left: 0.75rem;
    border-left: 3px solid var(--mud-palette-lines-default);
}

.bid-record .bid-note {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.bid-record table.bid-figures {
    border-collapse: collapse;
}

.bid-record table.bid-figures th,
.bid-record table.bid-figures td {
    text-align: left;
    padding: 0.2rem 1.5rem 0.2rem 0;
    vertical-align: top;
    font-weight: normal;
}

/* The limitation block is the part of the record somebody else reads first, so it is set apart on
   screen as well as on paper. The border rather than a fill, because a fill is a colour carrying a
   meaning and this has to survive a greyscale print. */
.bid-record .bid-limits {
    border: 1px solid var(--mud-palette-lines-default);
    padding: 0.75rem 1rem;
    margin-top: 1rem;
}

.bid-record .bid-limits h2 {
    margin-top: 0;
}

@media print {
    /* No navigation and no controls. The bar, the drawer, MudBlazor's overlay and popover layers,
       the disconnection banner, and anything the page itself marked as not for print. */
    .mud-appbar,
    .mud-drawer,
    .mud-drawer-close,
    .mud-overlay,
    .mud-popover-provider,
    .mud-snackbar-container,
    #blazor-error-ui,
    .bid-no-print {
        display: none !important;
    }

    /* The shell's own geometry exists to leave room for the bar and the drawer, neither of which is
       printed, so the record starts at the top left of the sheet instead of an inch in. */
    .mud-main-content,
    .content {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Black on white, whatever the palette was on screen, and no shadows. */
    .bid-record,
    .bid-record * {
        color: #000 !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .bid-record {
        max-width: none;
    }

    .bid-record h2,
    .bid-record blockquote,
    .bid-record .bid-limits {
        border-color: #000 !important;
    }

    /* A section split across a page break reads as two half answers, and the stored record of what
       one evaluation stood on is the block where that hurts most. */
    .bid-record section,
    .bid-record .bid-evaluation {
        break-inside: avoid;
    }

    .bid-record pre.recommendation-record {
        font-size: 9pt;
    }
}
