/* ============================================================================
   CFIQ - brand tokens
   ----------------------------------------------------------------------------
   CFIQ (Commercial Furniture Advisor) on SMART's own shell: a navy rail and
   sign-in panel, a white header, the teal of the logo's dot as the one accent,
   cool greys, Inter throughout on SMART's own type scale (bold titles,
   semibold sentence-case buttons, small caps only for grid heads and section
   labels, the latter with the logo's hairline), and soft, small corners.

   Loaded by Components/Tenant/CFIQ/ThemeComponent.razor AFTER the default
   portal theme (tenants/DataDrivenInc/ddi-theme.css), so SMART's layout and
   components stay exactly as they are: this file only re-sets the brand
   tokens that sheet reads, and repaints the few rules where it writes its
   green as literal values. Only the CFIQ tenant gets it.

   Contrast (WCAG 2.1): white on #1F7A99 4.9:1, white on #17607A 7.0:1,
   #17607A on white 7.0:1, #15304F on white 13.4:1, #5B6B7C on white 5.5:1,
   #C9D4E0 on the navy 8.9:1, #7CC4DA on the navy 6.9:1 - all AA for normal text.
   ============================================================================ */

html:root {
    --cf-navy: #15304F;
    --cf-navy-dark: #0E2238;
    --cf-navy-deep: #0A1A2C;
    --cf-navy-rgb: 21, 48, 79;
    --cf-teal: #1F7A99;
    --cf-teal-dark: #17607A;
    --cf-teal-light: #7CC4DA;
    --cf-teal-soft: #EAF4F8;
    --cf-teal-rgb: 31, 122, 153;
    --cf-ink: #1E2B3A;
    --cf-gray-1: #3A4757;
    --cf-gray-2: #5B6B7C;
    --cf-gray-3: #A7B0BA;
    --cf-gray-4: #D3DAE2;
    --cf-gray-5: #E4E8ED;
    --cf-gray-6: #F5F7FA;
    --cf-rail-text: #C9D4E0;
    --cf-sans: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

    /* the default theme's tokens, re-pointed at the brand */
    --ddi-green: var(--cf-teal);
    --ddi-green-2: var(--cf-teal);
    --ddi-green-dark: var(--cf-teal-dark);
    --ddi-green-soft: var(--cf-teal-soft);
    --ddi-green-light: var(--cf-teal-light);
    --ddi-gold: var(--cf-teal-light);
    --ddi-gold-light: var(--cf-teal-light);
    --ddi-graphite: var(--cf-navy);
    --ddi-graphite-2: var(--cf-navy-dark);
    --ddi-night: var(--cf-navy-deep);
    --ddi-ink: var(--cf-navy);
    --ddi-body: var(--cf-ink);
    --ddi-muted: var(--cf-gray-2);
    --ddi-line: var(--cf-gray-5);
    --ddi-canvas: var(--cf-gray-6);
    --ddi-font: var(--cf-sans);
    --ddi-head: var(--cf-sans);

    /* MudBlazor's palette */
    --mud-palette-primary-rgb: var(--cf-teal-rgb);
    --mud-palette-primary-hover: rgba(var(--cf-teal-rgb), .06);
    --mud-palette-secondary-rgb: var(--cf-teal-rgb);
    --mud-palette-info-rgb: var(--cf-teal-rgb);
    --mud-palette-text-primary: var(--cf-ink);
    --mud-palette-text-secondary: var(--cf-gray-2);
    --mud-typography-default-family: var(--cf-sans);

    /* the shared shell */
    --sidebar-color: var(--cf-navy);
    --header-color: #FFFFFF;
    --top-menu-btn-color: var(--cf-navy);
    --mud-nav-item-text-color: var(--cf-rail-text);
    --mud-nav-item-hover-color: rgba(255, 255, 255, .07);
    --mud-nav-item-active-color: var(--cf-teal);
    --spacing-between-menu-and-header-color: var(--cf-gray-5);

    /* semantic colours, AA (WCAG 2.1): white on error #C62828 5.6:1, white on success #1B7F4B 5.0:1,
       navy on warning #F2B13A 7.6:1, white on info (the navy) 13.4:1 - info stays neutral, teal the one accent. */
    --mud-palette-error: #C62828;
    --mud-palette-error-rgb: 198, 40, 40;
    --mud-palette-error-darken: #A31F1F;
    --mud-palette-error-lighten: #E05555;
    --mud-palette-error-text: #FFFFFF;
    --mud-palette-error-hover: rgba(198, 40, 40, .06);
    --mud-palette-success: #1B7F4B;
    --mud-palette-success-rgb: 27, 127, 75;
    --mud-palette-success-darken: #15663C;
    --mud-palette-success-text: #FFFFFF;
    --mud-palette-warning: #F2B13A;
    --mud-palette-warning-rgb: 242, 177, 58;
    --mud-palette-warning-darken: #D9982A;
    --mud-palette-warning-text: var(--cf-navy);
    --mud-palette-info: var(--cf-navy);
    --mud-palette-info-rgb: var(--cf-navy-rgb);
    --mud-palette-info-darken: var(--cf-navy-dark);
    --mud-palette-info-lighten: #2B4A6D;
    --mud-palette-info-text: #FFFFFF;
    --app-danger: #C62828;
    --app-ink-faint: #6A7887;     /* empty-state text, on white 4.6:1 */

    /* the page kit (portal.css): calmer, smaller radii than SMART's default */
    --app-radius-control: 4px;
    --app-radius-card: 8px;
    --app-radius-pill: 999px;
    --app-font: var(--cf-sans);
    --app-font-head: var(--cf-sans);
    --app-ink: var(--cf-navy);

    /* the chat */
    --dac-radius: 8px;
}

::selection {
    background: rgba(var(--cf-teal-rgb), .18);
}

/* ------------------------------------------------------------ typography */

/* One family, one scale: SMART's own type hierarchy (bold titles, semibold headings and buttons in sentence case,
   small caps only for grid heads and section labels) set in Inter, the logo's face. Inter only needs a little
   negative tracking on the big sizes; nothing here adds a second style - no light titles, no capitalised buttons. */
.mud-typography-h1,
.mud-typography-h2,
.mud-typography-h3,
.mud-typography-h4,
#main-content .mud-typography-h2,
#main-content .mud-typography-h4,
.po-hero-title,
.acct-hero-name,
.login-page .mud-typography-h2,
.ddi-home-hero h1,
.cf-login-hero h1 {
    letter-spacing: -.02em !important;
}

#main-content .mud-typography-h2,
#main-content .mud-typography-h4,
#main-content .mud-typography-h6,
.po-hero-title,
.acct-hero-name,
.login-page .mud-typography-h2 {
    color: var(--cf-navy) !important;
}

/* the page tours write their own Poppins / Inter */
.tour-root,
.tour-root * {
    font-family: var(--cf-sans) !important;
}

/* tabular figures, so amounts and counts line up in grids and stat tiles */
.mud-table-cell,
.po-stat,
.app-kpi {
    font-variant-numeric: tabular-nums;
}

#main-content .mud-table-root .mud-table-head .mud-table-cell {
    color: var(--cf-gray-2);
    background: var(--cf-gray-6);
}

.ddi-home-hero__eyebrow {
    color: var(--cf-teal-light);
}

/* section labels: the logo's line - the caps label, then a hairline */
.ddi-home-section {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px !important;
    letter-spacing: .12em !important;
    color: var(--cf-navy);
}

/* Inter is spaced for text at 0: MudBlazor's +.01em body tracking (made for Roboto) reads loose in it */
.mud-typography-body1,
.mud-typography-body2,
.mud-typography-subtitle1,
.mud-typography-subtitle2,
.mud-typography-caption,
.mud-input,
.mud-input-label,
.mud-table-body .mud-table-cell,
.mud-table-pagination,
.mud-button-root.mud-button,
.mud-tab {
    letter-spacing: 0 !important;
}

/* the role editor's summary: status and share texts on their tints, AA (scoped styles use the raw palette) */
html .perm-summary-status.status-saved {
    color: var(--mud-palette-success-darken) !important;   /* on its tint 5.6:1 */
}

html .perm-summary-status.status-changed {
    color: #8A5100 !important;                             /* on its tint 5.4:1 */
}

html .perm-summary-pct {
    color: var(--cf-teal-dark) !important;                 /* on the teal tint 6.3:1 */
}

.ddi-home-section::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--cf-gray-4);
}

/* --------------------------------------------------------------- header */

.top-header,
.app-boot-header {
    border-bottom: 1px solid var(--cf-gray-5);
}

.top-header .mud-icon-button:hover {
    background-color: rgba(var(--cf-teal-rgb), .08);
    color: var(--cf-teal-dark);
}

/* ------------------------------------------------------------- left rail */

.mud-drawer.left-menu-drawer {
    background:
        radial-gradient(420px 300px at 0% 0%, rgba(var(--cf-teal-rgb), .18), transparent 70%),
        linear-gradient(180deg, var(--cf-navy) 0%, var(--cf-navy-dark) 60%, var(--cf-navy-deep) 100%) !important;
}

.left-menu-drawer .mud-nav-group > .mud-nav-link .mud-nav-link-text {
    color: #FFFFFF !important;
}

/* the open page: a teal pill with a light-teal edge, white text and icon */
.left-menu-drawer .mud-nav-item .mud-nav-link.active,
.left-menu-drawer .mud-navmenu.mud-navmenu-default .mud-nav-link.active:not(.mud-nav-link-disabled),
.left-menu-drawer .is-menu-alias .mud-nav-link:not(.mud-nav-link-disabled) {
    background: linear-gradient(90deg, rgba(var(--cf-teal-rgb), .55), rgba(var(--cf-teal-rgb), .18)) !important;
    box-shadow: inset 3px 0 0 var(--cf-teal-light) !important;
    border-radius: 6px !important;
}

.left-menu-drawer .mud-nav-item .mud-nav-link.active .mud-nav-link-icon,
.left-menu-drawer .is-menu-alias .mud-nav-link .mud-nav-link-icon {
    color: #FFFFFF !important;
}

.left-menu-drawer .mud-navmenu .mud-nav-link {
    border-radius: 6px !important;
}

.left-menu-drawer .search-input:focus-within {
    border-color: var(--cf-teal-light);
}

/* ---------------------------------------------------------- page content */

#main-content .po-grid-list,
#main-content .app-card {
    border-color: var(--cf-gray-5);
    box-shadow: 0 1px 2px rgba(var(--cf-navy-rgb), .05);
}

.po-hero-icon {
    color: var(--cf-teal) !important;
    background: var(--cf-teal-soft) !important;
    border-color: #CFE5EE !important;
    box-shadow: none;
}

/* ---------------------------------------------------------------- buttons */

.mud-button-filled.mud-button-filled-primary {
    box-shadow: 0 6px 14px -10px rgba(var(--cf-navy-rgb), .7) !important;
}

.mud-button-filled.mud-button-filled-primary:hover {
    box-shadow: 0 8px 18px -10px rgba(var(--cf-navy-rgb), .75) !important;
}

.mud-button-outlined.mud-button-outlined-primary {
    border-color: rgba(var(--cf-teal-rgb), .45);
}

.mud-button-outlined.mud-button-outlined-primary:hover {
    background: rgba(var(--cf-teal-rgb), .06);
    border-color: var(--cf-teal);
}

/* ------------------------------------------------------------------- grids */

#main-content .mud-table-hover .mud-table-body .mud-table-row:hover {
    background-color: rgba(var(--cf-teal-rgb), .05) !important;
}

#main-content .mud-table-striped .mud-table-body .mud-table-row:nth-of-type(odd) {
    background-color: #FAFBFC;
}

/* -------------------------------------------------------------------- home */

.ddi-home-hero {
    color: var(--cf-rail-text);
    background:
        radial-gradient(520px 260px at 100% 0%, rgba(var(--cf-teal-rgb), .30), transparent 70%),
        linear-gradient(135deg, var(--cf-navy) 0%, var(--cf-navy-dark) 60%, var(--cf-navy-deep) 100%);
}

.ddi-home-tile:hover {
    border-color: #CFE5EE;
    box-shadow: 0 14px 28px -20px rgba(var(--cf-navy-rgb), .55);
}

.ddi-home-tile__icon {
    color: var(--cf-teal);
    background: var(--cf-teal-soft);
}

/* ------------------------------------------------------------- sign-in page */

.ddi-login-hero {
    color: var(--cf-rail-text);
    background:
        radial-gradient(700px 480px at 100% 0%, rgba(var(--cf-teal-rgb), .22), transparent 65%),
        linear-gradient(165deg, var(--cf-navy) 0%, var(--cf-navy-dark) 60%, var(--cf-navy-deep) 100%);
}

/* CFIQ's own panel (Tenant/CFIQ/LoginHeroComponent): a faint plan grid, the wordmark over the tracked line */
.cf-login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: linear-gradient(160deg, #000 0%, transparent 70%);
    mask-image: linear-gradient(160deg, #000 0%, transparent 70%);
}

.cf-login-hero__brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.cf-login-hero .ddi-login-hero__brand svg {
    width: auto;
    height: 40px;
}

.cf-login-hero__tagline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--cf-rail-text);
}

.cf-login-hero__tagline::after {
    content: "";
    width: 32px;
    height: 1px;
    background: rgba(201, 212, 224, .5);
}

.cf-login-hero .ddi-login-hero__eyebrow {
    color: var(--cf-teal-light);
}

.cf-login-hero .ddi-login-hero__eyebrow::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cf-teal-light);
}

.cf-login-hero h1 {
    font-size: clamp(32px, 3.4vw, 48px);
    font-weight: 600;
    line-height: 1.1;
    color: #FFFFFF;
}

.cf-login-hero h1 em {
    color: var(--cf-teal-light);
}

.cf-login-hero p,
.cf-login-hero .ddi-login-hero__facts dd {
    color: #B4C2D1;               /* on the navy 7.6:1 */
}

.cf-login-hero .ddi-login-hero__facts {
    border-top-color: rgba(201, 212, 224, .16);
}

.cf-login-hero .ddi-login-hero__facts dt {
    color: #FFFFFF;
}

.cf-login-hero .ddi-login-hero__foot {
    color: #93A4B6;               /* on the navy 5.8:1 */
}

.cf-login-hero .ddi-login-hero__foot svg {
    fill: #93A4B6;
}

/* ------------------------------------------------------- semantic colours */

.text-danger,
.validation-message {
    color: var(--mud-palette-error) !important;
}

.mud-snackbar.mud-alert-filled-info {
    border-left: 4px solid var(--cf-teal-light);
}

/* ---------------------------------------------------------- keyboard focus */

/* one 2 px ring outside the control: teal-dark on white 7.0:1, light teal on the navy 6.9:1 */
.mud-button-root:focus-visible,
.mud-icon-button:focus-visible,
.mud-tab:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
.adv :focus-visible:not(textarea) {
    outline: 2px solid var(--cf-teal-dark) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

.left-menu-drawer :focus-visible,
.cf-login-hero :focus-visible {
    outline-color: var(--cf-teal-light) !important;
}

.dac__composer:focus-within {
    border-color: var(--cf-teal);
    box-shadow: 0 0 0 3px rgba(var(--cf-teal-rgb), .15);
}

/* sign-in on a phone: the snackbar goes to the bottom, clear of the wordmark and the heading */
@media (max-width: 600px) {
    body:has(.login-page) .mud-snackbar-location-top-right,
    body:has(.login-page) .mud-snackbar-location-top-center,
    body:has(.login-page) .mud-snackbar-location-top-left {
        top: auto !important;
        bottom: 16px !important;
    }

    .cf-login-hero__tagline {
        letter-spacing: .2em;
    }
}
