/* FFC Staff Portal — one calm system.
   A neutral canvas, one deep-teal material (the sidebar), white sheets for content, one accent color.
   Every size, radius and color below comes from these tokens. */

:root {
    /* Brand */
    --ffc-teal: #1e5048;
    --ffc-teal-dark: #143f3a;
    --ffc-teal-bright: #2b7a6e;
    --ffc-accent-tint: #e7f1ef;

    /* Neutrals */
    --ffc-canvas: #f3f5f4;
    --ffc-surface: #ffffff;
    --ffc-ink: #1d2725;
    --ffc-muted: #5f6b69;
    --ffc-faint: #8a9593;
    --ffc-line: rgba(18, 38, 34, 0.09);
    --ffc-line-strong: rgba(18, 38, 34, 0.16);
    --ffc-tint: #f6f8f7;

    /* Status tints (calm, readable, print-friendly) */
    --ffc-ok-bg: #e4f2ec;   --ffc-ok: #1c6a4d;
    --ffc-warn-bg: #fbf1d9; --ffc-warn: #7a5600;
    --ffc-bad-bg: #fbe6e3;  --ffc-bad: #a1291d;
    --ffc-info-bg: #e6eff6; --ffc-info: #1f4f73;

    /* Shape */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --shadow-sheet: 0 1px 2px rgba(18, 38, 34, 0.05);
    --shadow-raised: 0 2px 6px rgba(18, 38, 34, 0.06), 0 10px 24px rgba(18, 38, 34, 0.08);
    --focus-ring: 0 0 0 3px rgba(43, 122, 110, 0.28);

    /* Motion: one curve for everything that arrives. Fast out, gentle settle, no overshoot
       (critically damped, like Apple's default spring) because nothing here is thrown or flicked. */
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --dur-quick: 120ms;
    --dur-arrive: 280ms;

    /* Lets height animate to "auto" (sidebar groups opening). Browsers without it simply snap. */
    interpolate-size: allow-keywords;
}

/* ---------- Base & type ---------- */

html, body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ffc-ink);
    -webkit-font-smoothing: antialiased;
}

/* A quiet brand wash: a faint teal glow behind the top bar that fades to neutral
   within the first few hundred pixels, so it never sits behind tables or text. */
body {
    min-height: 100vh;
    background-color: var(--ffc-canvas);
    background-image:
        radial-gradient(1100px 420px at 18% -140px, rgba(43, 122, 110, 0.16), transparent 70%),
        radial-gradient(900px 360px at 95% -160px, rgba(38, 96, 120, 0.10), transparent 70%),
        linear-gradient(180deg, #ebf2f0 0, var(--ffc-canvas) 380px);
    background-repeat: no-repeat;
    line-height: 1.5;
}

/* Hierarchy from size + weight + tracking together: large text tightens, small text stays at 0. */
h1, .h1 {
    font-size: 1.6rem;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--ffc-ink);
    margin-bottom: 0.4rem;
}

h2, .h4 {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--ffc-ink);
}

h3, .h5, .h6 {
    font-weight: 600;
    color: var(--ffc-ink);
}

h1:focus {
    outline: none;
}

.text-muted {
    color: var(--ffc-muted) !important;
}

/* ---------- Links ---------- */

a, .btn-link {
    color: var(--ffc-teal-bright);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

    a:hover, .btn-link:hover {
        color: var(--ffc-teal-dark);
    }

/* ---------- Buttons: instant feedback on press ---------- */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.1s ease-out;
}

    .btn:active:not(:disabled) {
        transform: scale(0.98);
    }

.btn-primary {
    color: #fff;
    background-color: var(--ffc-teal);
    border-color: var(--ffc-teal);
}

    .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active {
        background-color: var(--ffc-teal-dark) !important;
        border-color: var(--ffc-teal-dark) !important;
        color: #fff !important;
    }

    .btn-primary:disabled, .btn-primary.disabled {
        background-color: var(--ffc-teal);
        border-color: var(--ffc-teal);
        opacity: 0.45;
    }

.btn-success {
    color: #fff;
    background-color: var(--ffc-teal-bright);
    border-color: var(--ffc-teal-bright);
}

    .btn-success:hover, .btn-success:focus, .btn-success:active {
        background-color: var(--ffc-teal) !important;
        border-color: var(--ffc-teal) !important;
    }

/* Secondary actions are quiet: hairline border, ink text, light fill on hover */
.btn-outline-primary, .btn-outline-secondary {
    color: var(--ffc-ink);
    background: var(--ffc-surface);
    border-color: var(--ffc-line-strong);
}

    .btn-outline-primary:hover, .btn-outline-secondary:hover,
    .btn-outline-primary:active, .btn-outline-secondary:active {
        color: var(--ffc-ink) !important;
        background: var(--ffc-tint) !important;
        border-color: var(--ffc-line-strong) !important;
    }

/* Gray "Cancel" buttons read as quiet secondary actions too */
.btn-secondary {
    color: var(--ffc-ink);
    background: var(--ffc-surface);
    border-color: var(--ffc-line-strong);
}

    .btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active {
        color: var(--ffc-ink) !important;
        background: var(--ffc-tint) !important;
        border-color: var(--ffc-line-strong) !important;
    }

/* Caution (e.g. closing a month): amber tint rather than a loud yellow block */
.btn-warning {
    color: var(--ffc-warn);
    background: var(--ffc-warn-bg);
    border-color: rgba(122, 86, 0, 0.25);
}

    .btn-warning:hover, .btn-warning:focus, .btn-warning:active {
        color: #fff !important;
        background: #9a6c00 !important;
        border-color: #9a6c00 !important;
    }

/* The final, irreversible step (delete permanently) is the one place solid red appears */
.btn-danger {
    background: var(--ffc-bad);
    border-color: var(--ffc-bad);
}

.btn-outline-danger {
    color: var(--ffc-bad);
    border-color: rgba(161, 41, 29, 0.35);
}

    .btn-outline-danger:hover {
        color: #fff;
        background: var(--ffc-bad);
        border-color: var(--ffc-bad);
    }

.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--ffc-teal-bright);
    box-shadow: var(--focus-ring);
    outline: none;
}

/* ---------- Page titles ---------- */

/* Which organization or month a page is showing, as quiet context next to the title */
.title-context {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ffc-muted);
    margin-left: 0.35rem;
}

/* ---------- Inputs ---------- */

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--ffc-line-strong);
    background-color: var(--ffc-surface);
}

    .form-control:disabled, .form-select:disabled {
        background-color: var(--ffc-tint);
        color: var(--ffc-muted);
    }

.form-check-input:checked {
    background-color: var(--ffc-teal);
    border-color: var(--ffc-teal);
}

.form-label {
    color: var(--ffc-ink);
    font-weight: 500;
}

/* Fields written without Bootstrap classes (the Time Off admin pages) get the same look as every other field */
.content input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not(.form-control):not(.form-check-input),
.content select:not(.form-select),
.content textarea:not(.form-control) {
    padding: 0.375rem 0.65rem;
    font: inherit;
    color: var(--ffc-ink);
    background: var(--ffc-surface);
    border: 1px solid var(--ffc-line-strong);
    border-radius: var(--radius-sm);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

    .content input:not([type=checkbox]):not([type=radio]):not([type=file]):not(.form-control):not(.form-check-input):focus,
    .content select:not(.form-select):focus,
    .content textarea:not(.form-control):focus {
        border-color: var(--ffc-teal-bright);
        box-shadow: var(--focus-ring);
        outline: none;
    }

.content label:not(.form-label):not(.form-check-label) {
    font-weight: 500;
}

    .content label:not(.form-label):not(.form-check-label) > input,
    .content label:not(.form-label):not(.form-check-label) > select {
        margin-left: 0.4rem;
        font-weight: 400;
    }

.form-text {
    color: var(--ffc-muted);
}

input[type=file].form-control {
    padding: 0.3rem;
}

input[type=file]::file-selector-button {
    background: var(--ffc-teal);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 1rem;
    margin-right: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

    input[type=file]::file-selector-button:hover {
        background: var(--ffc-teal-dark);
    }

/* ---------- Surfaces ---------- */

.card {
    border-radius: var(--radius-md);
    border-color: var(--ffc-line);
    box-shadow: var(--shadow-sheet);
}

.card-header {
    background: var(--ffc-surface);
    border-bottom-color: var(--ffc-line);
    color: var(--ffc-ink);
    font-weight: 600;
}

    .card-header:first-child {
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

.list-group-item:first-child {
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.list-group-item:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.border.rounded {
    border-color: var(--ffc-line) !important;
    border-radius: var(--radius-md) !important;
}

/* ---------- Tables: sentence-case headers, hairlines, room to breathe ---------- */

.table {
    --bs-table-hover-bg: rgba(43, 122, 110, 0.045);
    color: var(--ffc-ink);
    font-variant-numeric: tabular-nums; /* digits line up down a column */
}

    .table > thead th {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--ffc-muted);
        background: var(--ffc-tint);
        border-bottom: 1px solid var(--ffc-line-strong);
        white-space: nowrap;
    }

    .table > :not(caption) > * > * {
        padding: 0.7rem 0.75rem;
        border-bottom-color: var(--ffc-line);
    }

.table-sm > :not(caption) > * > * {
    padding: 0.45rem 0.55rem;
}

.table-light, .table > thead.table-light th {
    --bs-table-bg: var(--ffc-tint);
}

.table-secondary {
    --bs-table-bg: #eef3f2;
    --bs-table-color: var(--ffc-ink);
}

/* ---------- Badges & alerts: tinted, never shouting ---------- */

.badge {
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35em 0.7em;
}

.badge.text-bg-success   { background: var(--ffc-ok-bg) !important;   color: var(--ffc-ok) !important; }
.badge.text-bg-warning   { background: var(--ffc-warn-bg) !important; color: var(--ffc-warn) !important; }
.badge.text-bg-danger    { background: var(--ffc-bad-bg) !important;  color: var(--ffc-bad) !important; }
.badge.text-bg-secondary { background: #eceff0 !important;            color: var(--ffc-muted) !important; }
.badge.text-bg-info      { background: var(--ffc-info-bg) !important; color: var(--ffc-info) !important; }
.badge.text-bg-light     { background: var(--ffc-tint) !important;    color: var(--ffc-muted) !important; border-color: var(--ffc-line) !important; }

.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 0.8rem 1rem;
}

.alert-success { background: var(--ffc-ok-bg);   color: var(--ffc-ok); }
.alert-warning { background: var(--ffc-warn-bg); color: var(--ffc-warn); }
.alert-danger  { background: var(--ffc-bad-bg);  color: var(--ffc-bad); }
.alert-info    { background: var(--ffc-info-bg); color: var(--ffc-info); }

.progress {
    border-radius: 999px;
    background-color: #e6ecea;
}

.progress-bar {
    background-color: var(--ffc-teal-bright);
}

.text-danger { color: var(--ffc-bad) !important; }
.text-success { color: var(--ffc-ok) !important; }

/* ---------- Validation & framework defaults ---------- */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--ffc-ok);
}

.invalid {
    outline: 1px solid var(--ffc-bad);
}

.validation-message {
    color: var(--ffc-bad);
}

.blazor-error-boundary {
    background: var(--ffc-bad-bg);
    color: var(--ffc-bad);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
}

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

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

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---------- Motion ---------- */

/* Things arrive by fading in and rising a few pixels: content toward you, never sliding in from the side. */
@keyframes ffc-arrive {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

@keyframes ffc-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Feedback messages (saved, errors, warnings) ease in where they appear instead of popping. */
.alert {
    animation: ffc-arrive 220ms var(--ease-out) both;
}

/* Page arrival: each page's content fades in and rises into place when you navigate.
   The white sheet and sidebar stay put, so the app's frame feels stable while the content changes.
   (Global, not in MainLayout.razor.css: scoped styles can't reach the page components' elements.) */
.content.page-enter > * {
    animation: ffc-arrive 300ms var(--ease-out) both;
}

/* Row highlights follow the pointer without lag but don't flicker */
.table > tbody > tr > * {
    transition: background-color var(--dur-quick) ease;
}

/* ---------- Accessibility preferences ---------- */

/* Reduced motion keeps the feedback but drops the movement: short cross-fades only. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
    }

    .alert {
        animation: ffc-fade 150ms ease both;
    }

    .content.page-enter > * {
        animation: ffc-fade 160ms ease both;
    }

    .btn:active:not(:disabled) {
        transform: none;
    }
}

@media (prefers-contrast: more) {
    :root {
        --ffc-line: rgba(0, 0, 0, 0.35);
        --ffc-line-strong: rgba(0, 0, 0, 0.55);
        --ffc-muted: #3c4644;
    }
}
