/* == SkadesPortal design-system ================================== */

:root {
    --bg: #eef1f6;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1a2733;
    --text-muted: #64748b;

    --brand: #2563eb;
    --brand-strong: #1e4fc4;
    --brand-soft: #e7eefc;

    --teal: #0f9d8f;
    --teal-soft: #dff3f0;

    --amber: #d97706;
    --amber-soft: #fdeeda;

    --green: #15803d;
    --green-soft: #e3f5e9;

    --sidebar-bg: #0f1c2b;
    --sidebar-bg-2: #14273c;
    --sidebar-text: #9fb2c4;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: #ffffff;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 28, 43, 0.05), 0 1px 3px rgba(15, 28, 43, 0.07);
    --shadow-md: 0 8px 24px rgba(15, 28, 43, 0.10);

    --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1:focus {
    outline: none;
}

a {
    color: var(--brand);
}

/* Shared page header used on all pages */
.page-header {
    margin-bottom: 1.75rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-header .sub {
    margin: 0.3rem 0 0;
    color: var(--text-muted);
}

/* Shared card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* Shared buttons and inputs */
.button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.12s ease;
}

.button:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.button.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.button.primary:hover {
    background: var(--brand-strong);
    color: #fff;
}

.button.primary:disabled {
    opacity: 0.6;
    cursor: default;
}

.button.danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.button.danger:hover {
    background: #b91c1c;
    color: #fff;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.12s ease;
    vertical-align: middle;
}

.icon-button:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

.icon-button.danger:hover {
    background: #fdecec;
    color: #dc2626;
}

.input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
    color: var(--text);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

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

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

.validation-message {
    color: #dc2626;
}

/* == Blazor loading & error UI ==================================== */

#blazor-error-ui {
    color-scheme: light only;
    background: #fff7d6;
    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;
    border-radius: var(--radius-sm);
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Der opstod en fejl.";
    }

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

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

        .loading-progress circle:last-child {
            stroke: var(--brand);
            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, "Indlæser");
    }
