@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css");

* {
    scrollbar-width: thin;
}

/* The window scrolls the page — see MainLayout.razor.css. The scrollbar's room is kept whether or not
   the page overflows, so a page growing past the window's height (a list landing) does not shift the
   whole layout sideways by the bar's width. */
html {
    scrollbar-gutter: stable;
}

/* The front page is dark in either theme, so the window's edge is too. The gutter kept above is painted
   with the root's background, which is the app's light page tint — on a front page that does not scroll
   it showed as a bare light strip down the right. The root takes the ink here, and the scrollbar, when
   there is one, a dark track. The gutter itself stands down: the front page does not grow after it loads,
   so there is no shift to guard against, and a page that fits the window shows no strip at all. */
html:has(.landing-layout) {
    scrollbar-gutter: auto;
    background-color: var(--cp-landing-ink);
    scrollbar-color: color-mix(in srgb, var(--cp-landing-on-dark) 30%, transparent) var(--cp-landing-ink);
}

/* A modal popup locks the page's scroll. DevExpress does it on the body (.dxbl-modal-open, overflow:
   hidden) and pads the body's right by the scrollbar's width, so the page keeps its width as the bar
   goes — written for a page whose scrollbar disappears. With the gutter above held, it did not: the
   window kept the bar's room as an empty strip (the window's own ground, which the popup's veil does not
   cover, as it lies outside the viewport) and the padding narrowed the page by the bar's width again, so
   everything, the popup included, jumped sideways. The gutter stands down while a popup is up, and
   DevExpress's padding takes its place exactly. */
html:has(> body.dxbl-modal-open) {
    scrollbar-gutter: auto;
}

/* Bootstrap makes the root scroll smoothly. With the window as the page's scroller that would animate
   every jump: Blazor's return to the top on each navigation, and page-scroll.js putting a page back
   where the customer left it on Back. Smooth scrolling is asked for where it is wanted (section-nav.js). */
:root {
    scroll-behavior: auto;
}

/* The page's ground is painted on the root, opaque. The tint (--cp-color-page-bg) is translucent, and
   on the body alone it left the canvas under it to the browser: a browser in dark mode drew a dark
   canvas through it, under text that is dark because the app is light — the quote's number and the
   section headings vanished. The pre-composited tint keeps the same look on any canvas, and the root
   paints the overscroll and the area below a short page too. */
html {
    background-color: var(--cp-color-page-bg-solid);
}

body {
    background-color: transparent !important;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.button-link {
    text-decoration: unset;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.625rem;
}

.title.title-secondary {
    padding-top: 0.313rem;
    padding-bottom: 0;
    color: var(--bs-secondary-color, var(--cp-color-content));
}

.title-header-text {
    font-size: 2.5rem;
    line-height: 3rem;
    font-weight: 600;
    letter-spacing: 0rem;
    padding: 0.3125rem 0;
}

.title-content-text {
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 2.5rem;
    letter-spacing: 0rem;
}

.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.block-content {
    width: 31.25rem;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-width: 100%;
}

.icon {
    width: var(--icon-width);
    height: var(--icon-height);
    background-color: currentcolor;
    mask-position: center center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-image: var(--icon-mask-image);
    mask-image: var(--icon-mask-image);
}

.loading-panel {
    min-width: 100px;
    min-height: 100px;
    height: fit-content;
    /*    width: 100vw;
    height: 100vh;

    position: fixed !important;
    top: 0;
    left: 0;*/
}

/* backwards, not forwards: the end state (opacity 1) is the default anyway, and a fill that holds an
   opacity animation after it ends keeps the element a stacking context. Every Card carries this
   class, so with forwards a hint panel inside a card (z-index 20) could not rise above a positioned
   sibling later in the page — the /account/invoices "Balances as of" hint slid under the search box. */
.fade-in {
    animation-name: fade-in;
    animation-duration: .35s;
    animation-fill-mode: backwards;
    animation-timing-function: ease-in;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* A bar (SegmentedMeter) with a folded legend (MeterLegend) straight under it: the bar's bottom margin
   only spaced it from the legend's lines, so with the lines folded away it would leave an empty strip at
   the foot of the card. Global because the rule spans two components' CSS scopes; the element names
   lift it above the bar's own scoped margin rule, which would otherwise win on load order. */
div.segmented-meter:has(+ div.meter-legend--collapsed) {
    margin-bottom: 0;
}

/* The phone's dock (NavigationBar.razor.css) floats in the bottom-right corner, over MainLayout's
   content column: an upright pill of up to three buttons - the cookie setting, a list page's filters,
   the menu. The column gets room at the bottom so the dock never sits on the last line of a page — only
   while the bar is there and drawn; a page without it keeps its edge. */
@media screen and (max-width: 634px) {
    body:has(.navigation-bar:not(.navigation-bar--empty)) .app-content {
        padding-bottom: 5rem;
    }

    body:has(.navigation-bar:not(.navigation-bar--empty) :is(.cp-filter-dock-button, .activity-dock-filters)) .app-content {
        padding-bottom: 9rem;
    }
}

/* Wider than the dock, the cookie setting floats on its own in the bottom-left corner (cookie-consent.css:
   40px, 16px in), over the start of the content column. The column gets room at its foot for it, so the
   last line of a page — a card's figures, the next section's heading — is never left under the button. */
@media screen and (min-width: 635px) {
    body:has(.lc-cookie-reconsent:not([hidden])) .app-content {
        padding-bottom: 4.5rem;
    }
}

/* A destructive action that is not the card's main one — Delete beside Edit on a team group or a saved
   address. Outlined, so it does not outshout the action beside it, but in the danger colour, so it still
   reads as destructive: the Fluent theme draws DevExpress's outline-danger as a plain grey button, which
   left Delete looking exactly like Edit. Global because the class lands on DxButton's own root element. */
/* Three classes: the theme maps its outline variables on .dxbl-btn.dxbl-btn-outline-danger, two classes
   in a stylesheet loaded after this one, so two here would lose. */
.dxbl-btn.dxbl-btn-standalone.cp-btn-destructive {
    --dxbl-btn-color: var(--cp-color-danger);
    --dxbl-btn-border-color: var(--cp-color-danger);
    --dxbl-btn-hover-color: var(--cp-color-danger);
    --dxbl-btn-hover-border-color: var(--cp-color-danger);
    --dxbl-btn-hover-bg: color-mix(in srgb, var(--cp-color-danger) 8%, transparent);
}

/* Cookie banner styles live in css/cookie-consent.css. */

/* Web-quote customer file attach uses the stock DevExpress DxFileInput (QuoteFileUpload.razor) —
   no bespoke CSS needed. */
/* Boot loader (App.razor): fills the wait for the circuit on a page that is not prerendered
   (PageRenderModes), dressed as the loading overlay's panel. It is in the response before the layout
   is, so it goes the moment the layout lands in the body — no script to take it away, and nothing to
   go wrong if the circuit never connects (Blazor's own reconnect UI says so then). */
/* Mirrors LoadingOverlay.razor.css - veil, panel, mark and words - since a component's scoped CSS cannot
   reach markup outside it. It waits 500ms before it shows, as the overlay does (ShowDelay), so a circuit
   that connects at once flashes nothing. */
.boot-loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--cp-space-4);
    box-sizing: border-box;
    background-color: var(--cp-color-backdrop-frosted);
    backdrop-filter: blur(var(--cp-backdrop-blur));
    animation: bootLoaderIn 150ms linear 500ms backwards;
}

@keyframes bootLoaderIn {
    from { opacity: 0; }
}

body:has(> .content) > .boot-loader {
    display: none;
}

.boot-loader__panel {
    display: flex;
    align-items: center;
    gap: var(--cp-space-4);
    max-width: 100%;
    padding: var(--cp-space-4) var(--cp-space-6) var(--cp-space-4) var(--cp-space-4);
    border: 1px solid var(--cp-color-border);
    border-radius: var(--cp-radius-lg);
    background-color: var(--cp-color-surface);
    color: var(--cp-color-content);
    box-shadow: var(--cp-shadow-3);
    box-sizing: border-box;
    animation: bootLoaderPanelIn 150ms ease-out 500ms backwards;
}

@keyframes bootLoaderPanelIn {
    from { transform: translateY(var(--cp-space-2)) scale(0.96); }
}

.boot-loader__icon {
    flex: none;
    width: 3.5rem;
    height: 3.5rem;
    display: grid;
    place-items: center;
}

.boot-loader__text {
    display: flex;
    flex-direction: column;
    gap: var(--cp-space-1);
    min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
    .boot-loader,
    .boot-loader__panel {
        animation: none;
    }
}
