/* Fitech platform (root) look: Bootstrap 5.3 + Syncfusion bootstrap5.3 theme, in the platform's deep navy
   (docs/root-menu-mockup.html) so it can't be mistaken for the operators' green or the administrators' #00661A. */

:root {
    /* Shared tokens (as Fitech.Web's app.css) */
    --fx-green: #008a3e;
    --fx-green-dark: #006e31;
    --fx-green-tint: #e6f3ec;
    --fx-page: #f4f6f9;
    --fx-surface: #ffffff;
    --fx-border: #dde2ea;
    --fx-text: #1c2433;
    --fx-muted: #5d6779;

    /* Platform livery */
    --fx-root: #13294b;
    --fx-root-hover: #1f3a66;
    --fx-root-dark: #0c1c35;
    --fx-root-text: #e8edf5;
    --fx-root-muted: #a9b6cc;
    --fx-root-tint: #e7ecf5;

    /* The shared sign-in card (Fitech.Web.Shared AuthLayout) */
    --fx-auth-accent: var(--fx-root);
    --fx-auth-tint: var(--fx-root-tint);

    --bs-primary: var(--fx-root);
    --bs-primary-rgb: 19, 41, 75;
    --bs-link-color: var(--fx-root);
    --bs-link-color-rgb: 19, 41, 75;
    --bs-link-hover-color: var(--fx-root-hover);
    --bs-body-color: var(--fx-text);
    --bs-font-sans-serif: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background: var(--fx-page);
    color: var(--fx-text);
}

.btn-primary {
    --bs-btn-bg: var(--fx-root);
    --bs-btn-border-color: var(--fx-root);
    --bs-btn-hover-bg: var(--fx-root-hover);
    --bs-btn-hover-border-color: var(--fx-root-hover);
    --bs-btn-active-bg: var(--fx-root-dark);
    --bs-btn-active-border-color: var(--fx-root-dark);
    --bs-btn-disabled-bg: var(--fx-root);
    --bs-btn-disabled-border-color: var(--fx-root);
}

.btn-outline-primary {
    --bs-btn-color: var(--fx-root);
    --bs-btn-border-color: var(--fx-root);
    --bs-btn-hover-bg: var(--fx-root);
    --bs-btn-hover-border-color: var(--fx-root);
    --bs-btn-active-bg: var(--fx-root-dark);
    --bs-btn-active-border-color: var(--fx-root-dark);
}

.btn-link {
    --bs-btn-color: var(--fx-root);
    --bs-btn-hover-color: var(--fx-root-hover);
}

/* Square corners on buttons and panels (Bootstrap and Syncfusion). */
.btn,
.btn-sm,
.btn-lg {
    --bs-btn-border-radius: 0;
}

.alert {
    --bs-alert-border-radius: 0;
}

.e-btn,
.e-grid {
    border-radius: 0;
}

.form-control,
.form-select {
    border-radius: 0;
}

.form-control:focus,
.form-select:focus {
    border-color: #7d8fb0;
    box-shadow: 0 0 0 0.25rem rgba(19, 41, 75, 0.2);
}

h1:focus {
    outline: none;
}

/* Page building blocks */

.fx-lead {
    color: var(--fx-muted);
    margin-bottom: 1.5rem;
}

.fx-panel,
.fx-stat {
    padding: 1rem 1.25rem;
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
}

.row > * > .fx-stat {
    height: 100%;
}

.fx-stat-label {
    font-size: 0.85rem;
    color: var(--fx-muted);
}

.fx-stat-value {
    font-size: 1.7rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.fx-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.05rem 0.45rem;
    border: 1px solid var(--fx-border);
    background: #f7f8fa;
    white-space: nowrap;
}

.fx-badge-ok { color: var(--fx-green-dark); background: var(--fx-green-tint); border-color: #bfe0cc; }
.fx-badge-warn { color: #7a5a00; background: #fff4d6; border-color: #f0dc9c; }
.fx-badge-bad { color: #8a1c1c; background: #fdeaea; border-color: #f1c3c3; }

/* Retiring an organisation: permanent, so the warning and the confirming panel are red. */
.fx-retire-warning {
    color: #5c1111;
    background: #fdeaea;
    border: 1px solid #e3a5a5;
    border-left: 6px solid #b42318;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.fx-retire-confirm { border-color: #e3a5a5; }

.fx-danger-zone { border-color: #e3a5a5; }

.fx-modules {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.fx-modules .fx-badge {
    font-size: 0.7rem;
}

/* Sign-in codes and MFA set-up (the shared account pages; as Fitech.Web's app.css) */

.fx-code {
    font-size: 1.4rem;
    letter-spacing: 0.3em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.fx-setup {
    max-width: 560px;
}

.fx-qr {
    display: inline-block;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid var(--fx-border);
}

.fx-key {
    font-size: 1rem;
    word-spacing: 0.4em;
    color: var(--fx-text);
}

.fx-confirm {
    max-width: 320px;
}

.fx-recovery-codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.25rem 1rem;
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
}

.fx-recovery-codes code {
    font-size: 1rem;
    color: var(--fx-text);
}

.fx-narrow-form {
    max-width: 420px;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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;
}

/* Accounts (Fitech staff, administrators): one card each, actions as buttons */
.fx-account-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.fx-account-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.25rem;
}

.fx-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--fx-border);
}

/* A ticket's thread (cleaned HTML, newest first) */
.fx-ticket-thread {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* The audit log's activity grid (Fitech.Web.Shared AuditLogView; as Fitech.Web's app.css, in navy) */
.fx-heat-wrap { overflow-x: auto; }
.fx-heat { border-collapse: separate; border-spacing: 2px; font-size: 0.75rem; }
.fx-heat-day { padding-right: 0.5rem; font-weight: 400; color: var(--fx-muted); white-space: nowrap; }
.fx-heat-hour { font-weight: 400; color: var(--fx-muted); text-align: left; min-width: 1.1rem; }
.fx-heat-cell { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 2px; }
td.fx-heat-cell { display: table-cell; }
.fx-heat-0 { background: #eef1f5; }
.fx-heat-1 { background: color-mix(in srgb, var(--fx-root) 22%, white); }
.fx-heat-2 { background: color-mix(in srgb, var(--fx-root) 45%, white); }
.fx-heat-3 { background: color-mix(in srgb, var(--fx-root) 72%, white); }
.fx-heat-4 { background: var(--fx-root); }
.fx-heat-legend { display: flex; align-items: center; gap: 3px; }

/* The shared library pages (Fitech.Web.Shared Library views; as Fitech.Web's app.css, in navy) */
.fx-field-error {
    color: #b02a37;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.fx-tabs.e-tab .e-tab-header {
    background: transparent;
}

.fx-tabs.e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text {
    color: var(--fx-root);
    font-weight: 600;
}

.fx-tabs.e-tab .e-tab-header .e-indicator {
    background: var(--fx-root);
}

.fx-tab-body {
    padding: 1rem 0;
}

/* Exercise pictures: the library's, or a placeholder (same box, so lists line up). */
.fx-ex-pic {
    display: inline-grid;
    place-items: center;
    object-fit: cover;
    border-radius: 6px;
    background: var(--fx-root-tint);
    flex-shrink: 0;
}

.fx-ex-pic-none {
    color: var(--fx-root);
}

/* A band's colour beside its picker */
.fx-swatch {
    display: inline-block;
    width: 1.4rem;
    height: 1.4rem;
    border: 1px solid var(--fx-border);
    vertical-align: middle;
}

/* The organisation's branding (Fitech.Web.Shared OrganisationBrandingPanel; as Fitech.Web's app.css). The cover
   preview stays in the report's own green: it shows what subjects' reports look like. */
.fx-brand-pic { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: .75rem; align-items: center; }
.fx-brand-pic-thumb { width: 96px; height: 72px; border: 1px solid var(--fx-border); border-radius: 4px; display: grid; place-items: center; overflow: hidden; background: #fff; }
.fx-brand-pic-thumb img { width: 100%; height: 100%; object-fit: contain; }
.fx-cover-preview { position: relative; width: 100%; max-width: 260px; aspect-ratio: 210 / 297; border-radius: 4px; overflow: hidden; color: #fff;
    background: linear-gradient(135deg, var(--fx-green-dark), var(--fx-green) 60%, #4fb47a); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.fx-cover-preview .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fx-cover-preview .shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0, 30, 15, .78)); }
.fx-cover-preview .logo { position: absolute; top: 6%; left: 8%; max-width: 45%; max-height: 14%; background: #fff; padding: 3px 5px; border-radius: 2px; object-fit: contain; }
.fx-cover-preview .caption { position: absolute; left: 8%; right: 8%; bottom: 9%; font-size: 1rem; font-weight: 300; line-height: 1.2; }
.fx-cover-preview .caption small { display: block; font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; opacity: .9; margin-bottom: .2rem; }
