html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

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

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

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/*
    Keeps a filled field's label floated when there is no circuit to notice it is filled.

    MudBlazor floats an outlined label with two selectors of its own:

        .mud-shrink ~ label...            when the field has a value
        .mud-input:focus-within ~ label...  while it has focus

    The second is plain CSS and always works. The first depends on .mud-shrink, which MudBlazor
    adds from C# — so on the five statically rendered Account pages it never arrives. The label
    lifts on focus, then drops back on blur and sits on top of the text the user just typed.

    Those pages cannot be made interactive: they write the authentication cookie, and headers are
    only open outside a circuit (see InteractivityTests). So the "has a value" half is restated
    here in CSS, where it does not need one.

    [placeholder] in the selector is load-bearing. :placeholder-shown never matches an input that
    has no placeholder attribute, so :not(:placeholder-shown) would match every field in the
    application and float every label permanently. Requiring the attribute limits this to the
    fields that opt in by setting one — which is why those fields carry Placeholder=" ".
*/
.mud-input:has(> input[placeholder]:not(:placeholder-shown))
    ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined {
    transform: translate(14px, -6px) scale(0.75);
    max-width: calc(100% - 14px);
}

/*
    The reconnection banner.

    Blazor owns the state and sets exactly one of these classes on #components-reconnect-modal:

        components-reconnect-show      trying to reconnect
        components-reconnect-hide      connected, nothing to say
        components-reconnect-failed    attempts exhausted; Blazor.reconnect() may still work
        components-reconnect-rejected  the server restarted and lost the circuit; only a reload

    Everything is hidden by default, including before Blazor has set any class at all. That order
    matters: a banner that flashes "connection lost" during a normal page load teaches people to
    ignore it, which costs more than saying nothing.

    Colours come from MudBlazor, deliberately. MudBlazor already ships rules for this element and
    marks them important:

        #components-reconnect-modal {
            z-index: 9999 !important;
            background-color: var(--mud-palette-background) !important;
        }

    A dark background set here loses to that, and the first version of this banner rendered white
    text on MudBlazor's white surface — present in the DOM, announced by the accessibility tree,
    and invisible. Taking the theme's own surface and text colours is both the fix and the better
    answer: the banner follows the theme instead of fighting it.
*/
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0 0 auto 0;
    justify-content: center;
    padding: 14px 16px;
    color: var(--mud-palette-text-primary);
    border-bottom: 2px solid var(--mud-palette-warning);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    font-size: 14px;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    /* Beats the inline display:none that hides this when the stylesheet does not load. */
    display: flex !important;
}

#components-reconnect-modal p { display: none; margin: 0; align-items: center; gap: 10px; }

/*
    Anchored on the id, not on the state class alone.

    The rule above is #id p — specificity (1,0,1). A selector of two classes is (0,2,0) and loses
    to it, so the banner appeared on disconnect with no text in it at all: visible, empty, and
    less useful than nothing. Matching the id here puts these at (1,2,0).
*/
#components-reconnect-modal.components-reconnect-show .reconnect-trying,
#components-reconnect-modal.components-reconnect-failed .reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected .reconnect-rejected { display: flex; }

#components-reconnect-modal button {
    margin-left: 10px;
    border: 0;
    border-radius: 999px;
    padding: 6px 16px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.reconnect-spin {
    width: 15px;
    height: 15px;
    border: 2px solid var(--mud-palette-divider);
    border-top-color: var(--mud-palette-warning);
    border-radius: 50%;
    animation: reconnect-spin 900ms linear infinite;
}

@keyframes reconnect-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .reconnect-spin { animation: none; }
}

/*
    Campos de fecha estrechos, sin estrechar el calendario.

    Poner el ancho en el propio MudDatePicker parece lo natural y es la trampa: el popover se
    dimensiona a partir del componente, así que un campo de 180 px produce un panel de 180 px con
    un calendario de 310 px dentro. Nada lo recorta —no hay overflow de por medio—, el calendario
    se sale del papel y se ve a medias.

    El ancho va aquí, en un contenedor que el popover no mira.
*/
.date-field {
    max-width: 180px;
}

/*
    Y una red por si alguien vuelve a ponerlo en el componente: el panel del calendario se
    dimensiona por su contenido, pase lo que pase con el campo.
*/
.mud-popover .mud-picker-container {
    width: max-content;
}

/*
    El logotipo de Gamify Flow.

    "Gamify" en peso normal y "Flow" en negrita: el nombre se separa por peso, nunca por un
    espacio. Chakra Petch es la tipografia de la marca y se carga desde Google Fonts; la pila de
    respaldo esta puesta en serio porque un servidor sin salida a internet no la va a descargar, y
    entonces esto tiene que seguir leyendose como un logotipo y no como texto suelto.
*/
.gf-wordmark {
    font-family: "Chakra Petch", "Segoe UI Semibold", system-ui, sans-serif;
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: .09em;
    line-height: 1;
    white-space: nowrap;
}

.gf-wordmark b {
    font-weight: 700;
}

.gf-wordmark-lg {
    font-size: 1.6rem;
    letter-spacing: .07em;
}

/*
    La insignia de nivel en el detalle de cliente.

    El contenedor lleva el color del nivel y la imagen va encima. Si la imagen no carga se
    elimina sola y queda el disco de color, que es lo que hace el sitio de demostracion: un
    merchant puede no haber puesto artwork, y puede haberlo puesto apuntando a algo que ya no
    esta. Ninguno de los dos casos deberia enseniar el icono roto del navegador.
*/
.level-badge {
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: 50%;
    background: var(--level-colour, #888);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.level-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/*
    Un hash de 64 caracteres hexadecimales no tiene por donde partirse.

    Sin esto, el acta de verificacion desborda su celda y empuja la tabla entera fuera del
    dialogo. `anywhere` y no `break-all` para que solo parta cuando de verdad no cabe.
*/
.gp-break {
    overflow-wrap: anywhere;
    word-break: break-word;
}
