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

html {
    min-height: 100%;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--color-background);
    color: var(--color-text-primary);
    margin: 0;
    min-height: 100dvh;
    min-width: 0;
    overscroll-behavior: none;
    overflow-x: hidden;
    width: 100%;
}

#app {
    min-width: 0;
    width: 100%;
}

img,
svg {
    max-width: 100%;
}

::selection {
    background: var(--color-primary);
    color: var(--color-on-brand);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-secondary);
    opacity: 1;
}

button,
input,
select,
textarea {
    color: inherit;
    font-size: var(--text-md);
    letter-spacing: 0;
}

button,
a,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button {
    cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(40, 100, 240, 0.24);
    outline-offset: 2px;
}

h1:focus {
    outline: none;
}

.app-bootstrap {
    align-items: center;
    background: var(--color-brand-dark);
    color: var(--color-on-brand);
    display: flex;
    font-size: var(--text-xl);
    font-weight: 700;
    justify-content: center;
    min-height: 100dvh;
}

.app-page {
    background: var(--color-background);
    min-height: 100%;
}

.app-page--light {
    background: var(--color-surface);
}

.app-page__header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4);
}

.app-page__title {
    color: var(--color-text-primary);
    font-size: var(--text-xl);
    font-weight: 700;
    line-height: var(--line-tight);
}

.scrollable {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollable::-webkit-scrollbar {
    display: none;
}

.sr-only {
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.valid.modified:not([type="checkbox"]) {
    border-color: var(--color-success);
}

.invalid {
    border-color: var(--color-danger);
}

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

.blazor-error-boundary {
    background: var(--color-danger);
    color: var(--color-on-brand);
    padding: var(--space-3);
}

.blazor-error-boundary::after {
    content: "Si è verificato un errore inatteso.";
}
