@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

/* =========================================================================
   Cornuvo site-wide theme
   -------------------------------------------------------------------------
   Tokens, Bootstrap variable overrides, and shared component styling
   extracted from Views/Home/Landing.cshtml's inline <style> block so the
   whole app (not just the signed-out landing page) picks up the same
   look with no per-view markup changes. See
   sitewide-restyle-build-prompt.md Sections 2a/2c/3 for the spec this
   file implements.
   ========================================================================= */

:root {
    --cv-oxblood: #6B1E24;
    --cv-oxblood-dark: #4F161B;
    --cv-oxblood-tint: #F4E9E7;
    --cv-bronze: #A8703A;
    --cv-bronze-text: #8A5A2B;   /* darker bronze for text on light (AA) */
    --cv-teal: #14B8A6;
    --cv-charcoal: #1F2328;
    --cv-slate: #4B4F55;
    --cv-ivory: #F7F3EC;
    --cv-line: #E6DDD0;

    --bs-body-font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-color: var(--cv-charcoal);
    --bs-primary: var(--cv-oxblood);
    --bs-primary-rgb: 107, 30, 36;
    --bs-link-color: var(--cv-oxblood);
    --bs-link-color-rgb: 107, 30, 36;
    --bs-link-hover-color: var(--cv-oxblood-dark);
    --bs-border-color: var(--cv-line);
    --bs-border-radius: .75rem;
    --bs-border-radius-lg: 1rem;
}

body { padding-bottom: 0; }

.text-slate { color: var(--cv-slate) !important; }
.bg-ivory { background: var(--cv-ivory); }
.bg-charcoal { background: var(--cv-charcoal); }

/* ---------- Buttons ----------
   Applies to Bootstrap's own .btn / .btn-primary / .btn-outline-dark
   classes everywhere, no markup changes needed. Pill shape + bold text
   apply to every .btn variant (including btn-outline-secondary,
   btn-outline-primary, btn-outline-danger, btn-outline-success and
   btn-outline-light, all of which are already used across the app) so no
   existing outline button is left unstyled; only btn-primary and
   btn-outline-dark get an explicit Cornuvo colour override, matching the
   landing page - the other outline variants keep Bootstrap's own
   semantic colours (e.g. danger stays red) and automatically pick up the
   new --bs-primary for btn-outline-primary via Bootstrap's own CSS
   variables. */
.btn { font-weight: 600; border-radius: 999px; padding: .5rem 1.25rem; }
.btn-primary {
    --bs-btn-bg: var(--cv-oxblood); --bs-btn-border-color: var(--cv-oxblood);
    --bs-btn-hover-bg: var(--cv-oxblood-dark); --bs-btn-hover-border-color: var(--cv-oxblood-dark);
    --bs-btn-active-bg: var(--cv-oxblood-dark); --bs-btn-active-border-color: var(--cv-oxblood-dark);
    --bs-btn-focus-shadow-rgb: 107, 30, 36;
}
/* Bootstrap 5.3 gives .btn-outline-primary its own fixed blue, so --bs-primary does not reach it: set the Cornuvo oxblood here. */
.btn-outline-primary {
    --bs-btn-color: var(--cv-oxblood); --bs-btn-border-color: var(--cv-oxblood);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--cv-oxblood); --bs-btn-hover-border-color: var(--cv-oxblood);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--cv-oxblood-dark); --bs-btn-active-border-color: var(--cv-oxblood-dark);
    --bs-btn-disabled-color: var(--cv-oxblood); --bs-btn-disabled-border-color: var(--cv-oxblood);
    --bs-btn-focus-shadow-rgb: 107, 30, 36;
}
.btn-outline-dark { --bs-btn-color: var(--cv-charcoal); --bs-btn-border-color: #CFC5B7; --bs-btn-hover-bg: var(--cv-charcoal); }
.btn-outline-light { --bs-btn-color: var(--cv-oxblood); }
.btn .bi { transition: transform .2s ease; }
/* ---------- Selected / active state: the green of the Cornuvo logo horns ----------
   Bootstrap hard-codes its default blue for the "selected" look of pills, list-group items, pagination
   and highlighted dropdown items, so --bs-primary does not reach them. Text is dark charcoal because white
   on this green is too faint to read comfortably. */
.nav-pills {
    --bs-nav-pills-link-active-color: var(--cv-charcoal);
    --bs-nav-pills-link-active-bg: var(--cv-teal);
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { color: var(--cv-charcoal); background-color: var(--cv-teal); }
.list-group {
    --bs-list-group-active-color: var(--cv-charcoal);
    --bs-list-group-active-bg: var(--cv-teal);
    --bs-list-group-active-border-color: var(--cv-teal);
}
.pagination {
    --bs-pagination-active-color: var(--cv-charcoal);
    --bs-pagination-active-bg: var(--cv-teal);
    --bs-pagination-active-border-color: var(--cv-teal);
}
.dropdown-menu {
    --bs-dropdown-link-active-color: var(--cv-charcoal);
    --bs-dropdown-link-active-bg: var(--cv-teal);
}

.btn:hover .bi-arrow-right { transform: translateX(3px); }

/* ---------- Logo (brand mark in _Layout.cshtml's navbar) ---------- */
.brand-mark { display: inline-flex; align-items: center; gap: .375rem; text-decoration: none; }
.brand-mark svg { height: 26px; width: auto; }
.brand-word { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; color: var(--cv-charcoal); line-height: 1; }
.org-logo { height:auto; width:auto; max-height:40px; max-width:200px; object-fit:contain; margin:0 0 0 1rem; padding-left:1rem; border-left:1px solid var(--cv-line, #E6DDD0); }
@media (max-width: 575.98px) { .org-logo { margin:.5rem 0 0; padding-left:0; border-left:0; max-width:140px; max-height:32px; } }
.brand-mark.reversed .brand-word { color: var(--cv-ivory); }

/* ---------- Navbar ---------- */
/* Upper utility row (Admin, Help, user, Log out, organisation logo), right-aligned above the main menu. */
.utility-row { padding-top: .25rem; padding-bottom: 0; }
.utility-row .navbar-nav { width: 100%; }
.utility-row .dropdown-menu { position: absolute; }
.navbar .nav-link { color: var(--cv-slate); font-weight: 500; }
.navbar .nav-link:hover, .navbar .nav-link:focus { color: var(--cv-oxblood); }

/* ---------- Cards ----------
   Re-skins Bootstrap's own .card class (used by ~15 existing views) with
   the curved-outlined look. Kept purely visual (border/radius/background/
   shadow/hover transform) so it doesn't disturb .card-body/.card-title
   spacing that existing views rely on. */
.card {
    background: #fff;
    border: 1px solid var(--cv-line);
    border-radius: 1.25rem;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card .card-body { padding: 1.75rem; }
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 40px -28px rgba(107, 30, 36, .45);
    border-color: #D9C3BF;
}

/* ---------- Table striping ----------
   Keyed off the plain .table class Bootstrap already applies across ~43
   views - no table-striped markup change required. Alternates white and
   a lighter ivory tint. */
.table > tbody > tr:nth-of-type(odd) > * {
    background-color: #fff;
}
.table > tbody > tr:nth-of-type(even) > * {
    background-color: #FBF9F5; /* lighter blend of var(--cv-ivory) */
}

/* ---------- Page header ----------
   Used by Views/Shared/_PageHeader.cshtml in place of a bare <h1> (and
   its following intro paragraph / back-link) at the top of a view. */
.page-header {
    background: var(--cv-ivory);
    border: 1px solid var(--cv-line);
    border-radius: 1.25rem;
    padding: 1.75rem 2rem;
    margin-bottom: 1.75rem;
}

/* ---------- Second-row sub-nav (My Courses / My Learning Plans / My
   Assessments) ----------
   .subnav-strip is a full-width band sitting directly under the main
   navbar, inside the shared sticky-top wrapper in _Layout.cshtml, so the
   sticky area has no gap/see-through between the navbar and the curved
   box. .subnav reuses the .page-header curved-outlined recipe (border/
   radius/background) but with slimmer, nav-sized padding and no bottom
   margin, since it sits flush under the navbar rather than above page
   content. Its links pick up the same colours as the main navbar's. */
.subnav-strip {
    background: #fff;
    padding: .5rem 0;
}
.subnav {
    padding: .5rem 1.25rem;
    margin-bottom: 0;
}
.subnav .nav-link { color: var(--cv-slate); font-weight: 500; }
.subnav .nav-link:hover, .subnav .nav-link:focus { color: var(--cv-oxblood); }

/* ---------- Dashboard module grid ----------
   Views/Home/Index.cshtml's module grid used to render each module as its
   own separate .card. It now sits inside one single .page-header-style
   box (.module-grid-box, same curved-outlined recipe as the H1/page-header
   areas) with plain tile cells inside it rather than nested cards. Each
   live tile's top highlight is the Rising Horn logo's main colour
   (--cv-oxblood), replacing the old per-organisation
   DashboardBrandingSettings.AccentColour for this element; disabled/
   "coming soon" tiles stay muted with no colour highlight. */
.module-grid-box { padding: 1.5rem 1.75rem; }
.module-tile-col { border: 1px solid var(--cv-line); border-top: none; border-left: none; }
.module-tile-col:nth-of-type(3n+1) { border-left: 1px solid var(--cv-line); }
.module-grid-box .row.g-0 > .module-tile-col:nth-last-child(-n+3) { border-bottom: none; }
.module-tile {
    display: block;
    height: 100%;
    padding: 1.25rem 1.5rem;
    border-top: 3px solid var(--cv-oxblood);
    transition: background-color .2s ease;
}
.module-tile:hover { background-color: var(--cv-oxblood-tint); }
.module-tile h5 { margin-bottom: .5rem; }
.module-tile-disabled {
    border-top: 3px solid var(--cv-line);
    color: var(--cv-slate);
    opacity: .6;
}

/* ---------- Admin dropdown: two-level flyout menu ----------
   The Admin dropdown used to be one long scroll-less list of section
   headers + items (10+ sections). Each section heading is now a single
   row (.submenu-toggle); clicking it opens that section's own items in a
   second panel flying out to the left (admin-menu.js toggles the .show
   class - Bootstrap has no built-in multi-level dropdown). The outer
   dropdown gets data-bs-auto-close="outside" (in _Layout.cshtml) so a
   click inside it doesn't close the whole menu while a submenu opens. */
.admin-menu { min-width: 15rem; padding: .5rem; }
.dropdown-submenu { position: relative; }
.submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.submenu-toggle .bi { color: var(--cv-slate); font-size: .8rem; }
.dropdown-submenu.open > .submenu-toggle,
.dropdown-submenu.open > .submenu-toggle .bi {
    background-color: var(--cv-oxblood-tint);
    color: var(--cv-oxblood);
}
.dropdown-menu.submenu {
    display: none;
    position: absolute;
    top: 0;
    left: auto;
    right: 100%;
    margin-right: .25rem;
    min-width: 15rem;
}
.dropdown-menu.submenu.show { display: block; }

/* Narrow screens: a side-by-side flyout has nowhere to go, so each
   section's items expand in place underneath it instead (an accordion),
   rather than flying out sideways off the edge of the viewport. */
@media (max-width: 575.98px) {
    .dropdown-menu.submenu {
        position: static;
        right: auto;
        margin-right: 0;
        margin-left: 1rem;
        border: 0;
        box-shadow: none;
        padding: 0;
    }
}

/* ---------- Forum: full-width title bar + layered illustration ----------
   Scoped to the forum list page only (.forum-title-bar/.forum-illustration-
   wrap), not a change to the shared .page-header recipe used everywhere
   else. The bar breaks out of the normal .container width to span the
   full viewport (the standard "full-bleed" negative-margin trick), with
   its own 50%-transparent ivory background; .page-header's own card
   styling is switched off inside it since the bar itself is now the box.
   The illustration sits in an absolutely-positioned wrapper so it doesn't
   push the rest of the page down, anchored to the bottom-right corner of
   the title bar and shifted up by a quarter of its own height, so its top
   25% sits behind (z-index) the bar while the rest hangs below it. */
.forum-title-bar {
    position: relative;
    z-index: 2;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: rgba(247, 243, 236, .5);
    border-bottom: 1px solid var(--cv-line);
    padding: 1.5rem 0;
}
.forum-title-bar .page-header {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}
.forum-header-stack {
    position: relative;
    margin-bottom: 1.5rem;
}
.forum-illustration {
    position: absolute;
    top: 0; /* flush with the top of the title bar */
    right: 1rem;
    width: 30vw;
    height: auto;
    z-index: -1; /* behind every other area of the page (the bar itself, cards, alerts, the filter form) */
    pointer-events: none;
}


/* Org Admin licence panel (home dashboard): drafting-style outlined cells, state colours
   for nearly full (amber) and full (red). */
.licence-panel { border: 1px solid var(--cv-charcoal); border-top: 3px solid var(--cv-oxblood); border-radius: 0; background: #fff; }
.licence-cell { padding: 1rem 1.25rem; border-right: 1px solid var(--cv-line); }
.licence-cell:last-child { border-right: none; }
.licence-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--cv-slate); }
.licence-value { font-size: 1.75rem; font-weight: 600; line-height: 1.2; color: var(--cv-charcoal); }
.licence-note { font-size: .8rem; color: var(--cv-bronze-text); }
.licence-bar { height: 6px; background: var(--cv-line); }
.licence-bar-fill { height: 100%; background: var(--cv-teal); }
.licence-message { padding: .6rem 1.25rem; font-size: .9rem; border-top: 1px solid var(--cv-line); }
.licence-near { border-top-color: #D98E04; }
.licence-near .licence-bar-fill { background: #D98E04; }
.licence-near .licence-message { background: #FFF6E0; }
.licence-full { border-top-color: #B42318; }
.licence-full .licence-bar-fill { background: #B42318; }
.licence-full .licence-message { background: #FDECEA; color: #7A1810; }
.licence-full .licence-value { color: #7A1810; }
@media (max-width: 767.98px) { .licence-cell:nth-child(2n) { border-right: none; } .licence-cell { border-bottom: 1px solid var(--cv-line); } }


/* Department Manager area: team summary tiles. */
.mgr-stat { border: 1px solid var(--cv-charcoal); border-top: 3px solid var(--cv-oxblood); background: #fff; padding: .8rem 1rem; height: 100%; }
.mgr-stat-num { font-size: 1.75rem; font-weight: 600; line-height: 1.2; color: var(--cv-charcoal); }
.mgr-stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--cv-slate); }
.mgr-stat-alert { border-top-color: #B42318; background: #FDECEA; }
.mgr-stat-alert .mgr-stat-num { color: #7A1810; }


/* ---- Help Centre ---- */
.help-card { border: 1px solid var(--cv-line); color: var(--cv-charcoal); }
.help-card:hover, .help-card:focus { border-color: var(--cv-oxblood); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.help-nav summary { cursor: pointer; padding: .2rem 0; }
.help-suggest-list { position: absolute; z-index: 1050; left: 0; right: 0; top: 100%; max-height: 22rem; overflow: auto; }
.help-body h2 { font-size: 1.35rem; margin-top: 1.75rem; }
.help-body h3 { font-size: 1.1rem; margin-top: 1.25rem; }
.help-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.help-body th, .help-body td { border: 1px solid var(--cv-line); padding: .4rem .6rem; text-align: left; vertical-align: top; }
.help-body th { background: var(--cv-ivory); }
.help-body kbd { background: var(--cv-charcoal); color: #fff; padding: .1rem .35rem; border-radius: .25rem; }
.help-body .help-callout { border-left: 4px solid var(--cv-teal); background: var(--cv-ivory); padding: .6rem .9rem; margin: 1rem 0; border-radius: .25rem; }
.help-body .help-callout.help-warning { border-left-color: #D98E04; background: #FFF6E0; }
.help-body img.help-img { max-width: 100%; height: auto; border: 1px solid var(--cv-line); border-radius: .5rem; margin: .75rem 0; display: block; }
.help-body img.help-img-sm { max-width: 240px; }
.help-body img.help-img-md { max-width: 480px; }
.help-lightbox { max-width: 95vw; max-height: 95vh; border: 0; border-radius: .5rem; padding: .75rem; }
.help-lightbox img { max-width: 100%; height: auto; display: block; clear: both; }
mark { background: #FFE9A8; padding: 0 .1em; }
@media print {
    .sticky-top, .help-noprint, .subnav-strip, nav.navbar { display: none !important; }
}


/* ---------- Footer: "Powered by" ---------- */
.powered-by {
    margin-top: 1.5rem;
    padding: 1rem .5rem 1.1rem;
    background: #343a40;
    color: #fff;
    text-align: center;
}
.powered-by-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.powered-by-text { font-size: .8rem; font-weight: 400; }
.powered-by-logo { width: 98px; height: auto; display: block; }
.powered-by-copy { margin-top: .85rem; font-size: .58rem; font-style: italic; }
@media print { .powered-by { display: none; } }

/* ---------- The Herd: dashboard progress panel and detailed results ---------- */
/* Tiles beside The Herd panel: one column on phones, two from 576px (the base rules assume three). */
.module-grid-narrow > .module-tile-col { border-left: 1px solid var(--cv-line); border-bottom: 1px solid var(--cv-line); }
.module-grid-narrow > .module-tile-col:last-child { border-bottom: none; }
@media (min-width: 576px) {
    .module-grid-narrow > .module-tile-col:nth-of-type(even) { border-left: none; }
    .module-grid-narrow > .module-tile-col:nth-last-child(2):nth-child(odd) { border-bottom: none; }
}

.herd-panel { background: #fff; border: 1px solid var(--cv-line); border-radius: 20px; box-shadow: 0 30px 60px -30px rgba(31,35,40,.35); overflow: hidden; }
.herd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: 1.4rem 1.4rem .5rem; }
.herd-greeting { font-size: .9rem; color: var(--cv-slate); }
.herd-name { font-size: 1.75rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; overflow-wrap: anywhere; }
.herd-help { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--cv-line); color: var(--cv-oxblood); font-weight: 700; font-size: .8rem; text-decoration: none; }
.herd-help:hover, .herd-help:focus { background: var(--cv-oxblood-tint); }
.herd-empty { padding: .5rem 1.4rem 1.2rem; color: var(--cv-slate); margin: 0; }
.herd-plan-label { padding: .4rem 1.4rem 0; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cv-bronze-text); font-weight: 600; }
.herd-plan-title { padding: .1rem 1.4rem 0; font-size: 1.05rem; font-weight: 600; }
.herd-bars { padding: .8rem 1.4rem .3rem; }
.herd-bar-row { margin-bottom: .85rem; }
.herd-bar-text { display: flex; justify-content: space-between; gap: .6rem; font-size: .85rem; margin-bottom: .3rem; }
.herd-bar-pct { color: var(--cv-slate); white-space: nowrap; }
.herd-track { height: 8px; background: #F1E6E3; border-radius: 999px; overflow: hidden; }
.herd-fill { height: 100%; border-radius: 999px; background: var(--cv-oxblood); }
.herd-rings { display: flex; gap: 1rem; padding: .4rem 1.4rem 1.1rem; }
.herd-ring-box { flex: 1; text-align: center; min-width: 0; }
.herd-ring { width: 104px; height: 104px; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.herd-ring-sm { width: 84px; height: 84px; }
.herd-ring-inner { width: 78px; height: 78px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.herd-ring-sm .herd-ring-inner { width: 62px; height: 62px; }
.herd-ring-inner strong { font-size: 1.25rem; }
.herd-ring-sm .herd-ring-inner strong { font-size: 1rem; }
.herd-ring-inner span { font-size: .7rem; color: var(--cv-slate); }
.herd-ring-title { margin-top: .5rem; font-weight: 600; font-size: .95rem; }
.herd-ring-note { font-size: .75rem; color: var(--cv-slate); line-height: 1.35; }
.herd-latest { margin: 0 1.4rem 1rem; background: var(--cv-charcoal); color: var(--cv-ivory); border-radius: 16px; padding: .9rem 1rem; display: flex; align-items: center; gap: .85rem; }
.herd-latest-text { flex: 1; min-width: 0; }
.herd-latest-label { font-size: .75rem; color: #C9C4BB; }
.herd-latest-title { font-weight: 600; font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; }
.herd-foot { border-top: 1px solid var(--cv-line); padding: .85rem 1.4rem; text-align: right; }
.herd-foot a { font-weight: 600; font-size: .9rem; text-decoration: none; }

.results-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.results-summary > div { background: #fff; border: 1px solid var(--cv-line); border-radius: 12px; padding: .8rem 1rem; font-size: .8rem; color: var(--cv-slate); }
.results-summary > div span { display: block; font-size: 1.35rem; font-weight: 600; color: var(--cv-charcoal); }
.results-plan-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.results-plan-info { flex: 1 1 280px; min-width: 0; }
.results-plan-rings { display: flex; gap: 1rem; }
.results-prog-col { min-width: 110px; }

@media print {
    .no-print, nav, header, footer, .navbar, .subnav { display: none !important; }
    .results-plan { break-inside: avoid; box-shadow: none; }
    .herd-fill, .herd-ring { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Global Admin banner above the dashboard module grid */
.global-banner { background: var(--cv-oxblood); color: #fff; border-radius: 12px; padding: 1.5rem 1.75rem; border-bottom: 4px solid var(--cv-teal); }
.global-banner h1 { color: #fff; margin: 0 0 .35rem; }
.global-banner h2 { color: #F4E9E7; margin: 0; font-size: 1.35rem; font-weight: 500; }

.herd-plan-title a { color: inherit; text-decoration: none; }
.herd-plan-title a:hover, .herd-plan-title a:focus { color: var(--cv-oxblood); text-decoration: underline; }
.herd-plan-open { padding: .15rem 1.4rem 0; font-size: .85rem; }
.herd-plan-open a { font-weight: 600; text-decoration: none; }

/* Global Admin dashboard: live visitor counts */
.presence-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.presence-cell { background: #fff; border: 1px solid var(--cv-line); border-radius: 12px; padding: .9rem 1.1rem; }
.presence-value { font-size: 2rem; font-weight: 600; line-height: 1.1; color: var(--cv-charcoal); }
.presence-label { font-size: .85rem; color: var(--cv-slate); }
.presence-note { grid-column: 1 / -1; font-size: .8rem; color: var(--cv-slate); }
@media (max-width: 575.98px) { .presence-strip { grid-template-columns: 1fr; } }
.presence-link { display: inline-block; margin-top: .35rem; font-size: .85rem; font-weight: 600; text-decoration: none; }
