body {
    --body-font: "Segoe UI Variable", "Segoe UI", sans-serif;
    font-family: var(--body-font);
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    margin: 0;
}

:root {
    /* Falcon red */
    --eoat-color-primary: #C8102E;
    --eoat-color-secondary: #FDF2F4;
}

.navmenu-icon {
    display: none;
}

/* Blazor's FocusOnNavigate (App.razor) focuses the page h1 on every
   navigation for screen-reader announcements; suppress the resulting
   browser focus outline since it isn't a keyboard-navigation focus. */
h1:focus {
    outline: none;
}

h1 {
    font-size: 24px;
    margin: 0;
}

h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
}

.main {
    min-height: calc(100dvh - 50px);
    color: var(--neutral-foreground-rest);
    align-items: stretch !important;
}

.body-content {
    align-self: stretch;
    height: calc(100dvh - 50px) !important;
    display: flex;
}

.content {
    padding: 1rem 1.5rem;
    align-self: stretch !important;
    width: 100%;
    max-width: 1200px;
}

/* Page header: title + subtitle on the left, actions on the right */
.eoat-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.eoat-page-header .eoat-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.eoat-subtitle {
    margin: 4px 0 0;
    color: var(--neutral-foreground-hint);
    font-size: 13px;
    max-width: 75ch;
}

.eoat-hint {
    color: var(--neutral-foreground-hint);
    font-size: 12px;
}

.eoat-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eoat-card {
    padding: 20px !important;
    height: auto !important;
}

.eoat-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.eoat-card-header h2 {
    margin: 0;
}

.eoat-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--neutral-stroke-rest);
}

/* Two cards next to each other on wide screens */
.eoat-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1100px) {
    .eoat-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Label/value list (detail pages) */
.eoat-details {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 10px 16px;
    margin: 0;
}

.eoat-details dt {
    font-weight: 600;
}

.eoat-details dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .eoat-details {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }

    .eoat-details dd {
        margin-bottom: 8px;
    }
}

/* Form: fields below each other, full width up to a readable maximum */
.eoat-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 760px;
}

.eoat-form fluent-text-field,
.eoat-form fluent-text-area,
.eoat-form fluent-select {
    width: 100%;
}

.eoat-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 600px) {
    .eoat-form-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

.eoat-form-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

.eoat-form-buttons > div {
    display: flex;
    gap: 8px;
}

.eoat-mono {
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 12px;
}

/* Tables (FilterableList and cards) */
.eoat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.eoat-table th {
    padding: 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.eoat-table td {
    padding: 10px;
    vertical-align: top;
}

.eoat-table tbody tr {
    border-bottom: 1px solid var(--neutral-stroke-rest);
}

.eoat-table tbody tr:hover {
    background-color: var(--neutral-fill-stealth-hover);
}

/* Simple list with dividers (divisions, linked users) */
.eoat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.eoat-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--neutral-stroke-rest);
}

.eoat-list li:last-child {
    border-bottom: none;
}

.eoat-empty {
    border: 1px dashed var(--neutral-stroke-rest);
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    color: var(--neutral-foreground-hint);
    font-size: 13px;
}

/* Badges (see Components/Badge.razor) */
.eoat-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

.eoat-badge-gray { background: #F3F4F6; color: #374151; }
.eoat-badge-green { background: #DCFCE7; color: #166534; }
.eoat-badge-red { background: #FEE2E2; color: #991B1B; }
.eoat-badge-amber { background: #FEF3C7; color: #92400E; }
.eoat-badge-blue { background: #DBEAFE; color: #1E40AF; }

/* Read-only value with a copy button (see Components/CopyField.razor) */
.eoat-copy-field {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.eoat-copy-field code {
    display: block;
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border-radius: 4px;
    background: var(--neutral-layer-2);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eoat-copy-field.multiline code {
    max-height: 12rem;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Centered card for the login and password pages */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100dvh - 120px);
}

.login-card {
    padding: 2rem !important;
    width: 440px !important;
    max-width: 95vw;
    height: auto !important;
}

.login-card fluent-text-field,
.login-card fluent-button {
    width: 100%;
}

.eoat-divider-section {
    border-top: 1px solid var(--neutral-stroke-rest);
    padding-top: 20px;
}

.eoat-password-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 12px;
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    font-size: 12px;
}

.eoat-password-rules li {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--neutral-foreground-hint);
}

.eoat-password-rules li.ok {
    color: #15803D;
}

/* Bounded, scrollable list of checkboxes (companies of a user) */
.eoat-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 18rem;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
}

@media (max-width: 600px) {
    .eoat-checklist,
    .eoat-password-rules {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Boost fluent-select dropdown above siblings only while open */
fluent-select[open] {
    position: relative;
    z-index: 100;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #E5E7EB;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--eoat-color-primary);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Laden");
}

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

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::before {
        content: "Er is een fout opgetreden: "
    }

@media (max-width: 600px) {
    .content {
        padding: 0.75rem 1rem;
    }

    .main {
        flex-direction: column !important;
        row-gap: 0 !important;
    }

    nav.sitenav {
        width: 100%;
        height: 100%;
    }

    #main-menu {
        width: 100% !important;
    }

        #main-menu > div:first-child:is(.expander) {
            display: none;
        }

    .navmenu {
        width: 100%;
    }

    #navmenu-toggle {
        appearance: none;
    }

        #navmenu-toggle ~ nav {
            display: none;
        }

        #navmenu-toggle:checked ~ nav {
            display: block;
        }

    .navmenu-icon {
        cursor: pointer;
        z-index: 10;
        display: block;
        position: absolute;
        top: 15px;
        left: unset;
        right: 20px;
        width: 20px;
        height: 20px;
        border: none;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Fluent inputs render their Label as a sibling <label>: keep it close to its input in the flex stacks */
.eoat-form > label.fluent-input-label,
.eoat-stack > label.fluent-input-label {
    margin-bottom: -12px;
}
