/* ===== GrowthVector brand palette (from the Business Growth Snapshot mockup) ===== */
:root {
    --ea-navy: #1a2b4a;
    --ea-navy-light: #2d4373;
    --ea-gold: #c9a227;
    --ea-gold-light: #e8d5a3;
    --ea-gray-bg: #f4f5f7;
    --ea-gray-border: #e1e4e8;
    --ea-text-dark: #1a1f2e;
    --ea-text-muted: #6b7280;
    --ea-green: #2e7d32;
    --ea-amber: #b8860b;
    --ea-red: #b3261e;
}

html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--ea-gray-bg);
    color: var(--ea-text-dark);
    line-height: 1.5;
}

h1, h2, h3, h4 {
    color: var(--ea-navy);
}

a, .btn-link {
    color: var(--ea-navy);
}

a:hover, .btn-link:hover {
    color: var(--ea-gold);
}

/* Force the Fluent accent to the exact brand navy (overrides the palette the design
   theme generates, which is a lighter shade). Drives accent buttons, active nav, badges. */
body {
    --accent-fill-rest: var(--ea-navy) !important;
    --accent-fill-hover: var(--ea-navy-light) !important;
    --accent-fill-active: #14223b !important;
    --accent-fill-focus: var(--ea-navy) !important;
}

/* ===== Brand chrome (global so it applies to the Fluent layout web components) ===== */
.ea-header {
    background-color: var(--ea-navy);
    color: #fff;
}

/* FluentHeader wraps its content in an inner .header-gutters flex row, so the
   gap has to go there to separate the account button from the Sign out form. */
.ea-header .header-gutters {
    column-gap: 12px;
}

.ea-brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.ea-brand sup {
    color: var(--ea-gold);
    font-size: 0.65em;
    margin-left: 1px;
}

.ea-footer {
    background-color: var(--ea-navy);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    padding: 0.6rem 2rem;
}

/* Slim navy top bar for anonymous public pages (the Snapshot), mirroring the
   mockup's header bar. The Fluent layout isn't used here, so this is plain markup. */
.ea-public-header {
    background-color: var(--ea-navy);
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.ea-public-header .ea-brand {
    color: #fff;
}

/* FluentDataGrid rows default to a 32px cell height, which clips 32px action
   buttons (the cell has overflow:hidden). Give every grid cell enough height so
   icon/text buttons render fully in any table. min-height overrides the inline
   height the grid sets, without needing !important. */
[role="gridcell"],
[role="columnheader"] {
    min-height: 44px;
}

/* Sticky footer: fill the viewport so the body section grows and the footer
   stays pinned to the bottom even when page content is short. */
.layout {
    min-height: 100vh;
}

.layout > .main {
    flex: 1;
}

.body-content {
    background-color: var(--ea-gray-bg);
}

/* ===== Controls: rounder corners and a gold focus accent, matching the mockup ===== */
body {
    --control-corner-radius: 6 !important;
    --layer-corner-radius: 8 !important;
}

/* Round the control parts directly too, in case the token is overridden closer to the element. */
fluent-button::part(control),
fluent-text-field::part(root),
fluent-number-field::part(root),
fluent-select::part(control),
fluent-search::part(root) {
    border-radius: 6px;
}

fluent-button[appearance="accent"]::part(control) {
    font-weight: 600;
}

/* Gold focus accent on text inputs and selects. */
fluent-text-field:focus-within::part(root),
fluent-number-field:focus-within::part(root),
fluent-select:focus-within::part(control) {
    border-color: var(--ea-gold);
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.2);
}

/* Bootstrap primary buttons (used by the Identity/Account pages) follow the brand navy. */
.btn-primary {
    color: #fff;
    background-color: var(--ea-navy);
    border-color: var(--ea-navy);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--ea-navy-light);
    border-color: var(--ea-navy-light);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(201, 162, 39, 0.5);
}

/* Account → "Manage your account" sub-navigation. The Identity pages use Bootstrap
   nav-pills, which default to Bootstrap blue for the active item; retint them to the
   brand navy/gold so the side nav matches the rest of the Fluent-themed app. */
.nav-pills {
    --bs-nav-pills-link-active-bg: var(--ea-navy);
    --bs-nav-link-color: var(--ea-text-dark);
    --bs-nav-link-hover-color: var(--ea-navy);
    --bs-nav-pills-border-radius: 6px;
}

.nav-pills .nav-link {
    color: var(--ea-text-dark);
}

.nav-pills .nav-link:hover {
    background-color: var(--ea-gray-bg);
    color: var(--ea-navy);
}

.nav-pills .nav-link.active {
    background-color: var(--ea-navy);
    color: #fff;
}

.content {
    padding: 1.25rem 2rem 2.5rem;
}

h1:focus {
    outline: none;
}

/* Cards pick up the mockup's soft rounded look. */
fluent-card {
    --card-corner-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

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

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

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTk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ary::after {
        content: "An error has occurred."
    }

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

/* Bootstrap's floating-label inputs (Identity pages) default to 58px tall, which looks
   oversized next to the app's 32px Fluent controls. Trim them closer to scale. */
.form-floating > .form-control,
.form-floating > .form-control-plaintext {
    height: calc(3.1rem + 2px);
    min-height: calc(3.1rem + 2px);
    font-size: 0.95rem;
}

.form-floating > label {
    font-size: 0.95rem;
    padding: 0.85rem 0.75rem;
}

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