/* PayRail IQ — base stylesheet. All values come from the design-system
   tokens in css/tokens/. No hex literals or invented styles here. */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
    margin: 0;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--text-link-hover);
}

button {
    font-family: var(--font-body);
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

::selection {
    background: var(--olive-200);
}

code, pre, .mono {
    font-family: var(--font-mono);
}

/* Blazor validation + error UI, restyled through tokens */
h1:focus,
h1:focus-visible {
    outline: none;
    box-shadow: none;
}

.validation-message {
    color: var(--danger-600);
    font-size: var(--text-xs);
}

.invalid {
    outline: 1px solid var(--danger-600);
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--danger-100);
    color: var(--danger-700);
    border-top: 1px solid var(--danger-600);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
}

.blazor-error-boundary {
    background: var(--danger-100);
    color: var(--danger-700);
    border: 1px solid var(--danger-600);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.blazor-error-boundary::after {
    content: "An unexpected error occurred on this screen.";
}

/* Print. The chrome-stripping rules live in PortalLayout.razor.css (they need
   the layout's scoping attribute to win); this block covers the page itself. */
@media print {
    @page {
        margin: 14mm;
    }

    body {
        background: var(--paper-0);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #blazor-error-ui,
    .pr-toasts {
        display: none !important;
    }

    a {
        color: var(--text-primary);
    }
}
