/**
 * Phase 6.4.8 / 6.4.8.1 — Branding, navbar, hero, login polish
 */

:root {
    --hf-nav-height: 72px;
    --hf-topbar-height: 40px;
    --hf-header-stack: calc(var(--hf-topbar-height) + var(--hf-nav-height));
    --hf-brand-green: #0d6b4f;
    --hf-brand-blue: #1a5f8a;
}

html {
    scroll-padding-top: calc(var(--hf-header-stack) + 12px);
}

body.hf-public-body {
    overflow-x: hidden;
}

/* —— Topbar —— */
.hf-topbar {
    min-height: var(--hf-topbar-height);
    font-size: 0.8125rem;
    line-height: 1.35;
}

.hf-topbar .container {
    gap: 0.75rem;
}

.hf-topbar__left {
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hf-topbar__right {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem 1.25rem;
}

.hf-topbar__right span {
    white-space: nowrap;
}

/* —— Navbar shell —— */
.hf-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: var(--hf-nav-height);
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.hf-navbar-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    max-width: 100%;
}

.hf-navbar-brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(100%, 280px);
    text-decoration: none;
    color: inherit;
}

.hf-navbar-brand-wrap:hover {
    color: inherit;
    opacity: 0.92;
}

.hf-brand-logo {
    display: block;
    object-fit: contain;
    object-position: left center;
    height: auto;
    max-width: 100%;
}

.hf-brand-logo--nav {
    max-height: 58px;
    width: auto;
}

.hf-brand-text {
    min-width: 0;
    line-height: 1.2;
}

.hf-brand-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--hf-primary-dark, #0f3d2e);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hf-brand-text small {
    display: block;
    font-size: 0.68rem;
    color: var(--hf-muted, #64748b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hf-navbar-toggler {
    border-radius: 12px;
    padding: 0.4rem 0.55rem;
}

.hf-navbar-desktop {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
}

.hf-nav-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.1rem;
    max-width: 100%;
}

.hf-navbar .nav-link {
    font-size: 0.875rem;
    padding: 0.42rem 0.55rem !important;
    white-space: nowrap;
}

.hf-navbar .nav-link:focus-visible {
    outline: 2px solid var(--hf-brand-green);
    outline-offset: 2px;
}

.hf-navbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
}

.hf-navbar-actions .btn {
    white-space: nowrap;
    font-size: 0.8125rem;
    padding: 0.45rem 0.85rem !important;
    border-radius: 999px;
}

.hf-nav-dropdown {
    border-radius: 14px;
    padding: 0.4rem;
    box-shadow: 0 12px 32px rgba(15, 61, 46, 0.12);
}

/* —— Hero: not covered by sticky header —— */
main#hf-main-content > .hf-hero:first-child,
main#hf-main-content > .hf-hero--enterprise:first-child {
    position: relative;
    z-index: 1;
}

.hf-hero--home-band {
    padding-top: clamp(2.5rem, 5vw, 4rem);
    padding-bottom: clamp(3rem, 6vw, 5.5rem);
}

/* —— Homepage banner carousel (CMS) —— */
.hf-hero--has-carousel {
    overflow: hidden;
}

.hf-hero-carousel {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hf-hero-carousel .carousel-inner,
.hf-hero-carousel .carousel-item {
    height: 100%;
    min-height: 100%;
}

.hf-hero-carousel .carousel-item {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hf-hero-carousel-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        118deg,
        rgba(253, 254, 254, 0.88) 0%,
        rgba(230, 245, 250, 0.78) 38%,
        rgba(184, 227, 218, 0.55) 68%,
        rgba(167, 216, 255, 0.45) 100%
    );
}

.hf-hero--has-carousel .hf-hero-content {
    position: relative;
    z-index: 2;
}

.hf-hero--has-carousel .hf-hero-card {
    background: rgba(253, 254, 254, 0.97);
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.14);
}

.hf-hero-carousel__indicators {
    z-index: 3;
    margin-bottom: 1.25rem;
}

.hf-hero-carousel__indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background-color: rgba(15, 61, 46, 0.35);
}

.hf-hero-carousel__indicators .active {
    background-color: var(--hf-brand-green, #0d6b4f);
}

.hf-hero-carousel__control {
    z-index: 3;
    width: 8%;
    opacity: 0.85;
}

.hf-hero-brand-watermark {
    position: absolute;
    right: 2%;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(120px, 22vw, 260px);
    opacity: 0.065;
    mix-blend-mode: soft-light;
    pointer-events: none;
    z-index: 0;
}

.hf-hero-brand-watermark .hf-brand-logo--symbol {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    filter: blur(0.5px);
}

.hf-hero--home-band .container {
    position: relative;
    z-index: 2;
}

.hf-hero--home-band h1 {
    font-size: clamp(1.75rem, 4vw, 3.25rem);
    line-height: 1.15;
}

.hf-hero-actions {
    gap: 0.5rem !important;
}

/* —— Login: clean enterprise + decorative background —— */
body.login-body.hf-login-clean {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        linear-gradient(165deg, #d4eaf6 0%, #e2f3ee 35%, #eef6fb 62%, #f8fbfd 100%) !important;
}

.hf-login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.hf-login-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.85;
}

.hf-login-bg__orb--1 {
    width: min(52vw, 520px);
    height: min(52vw, 520px);
    top: -12%;
    left: -10%;
    background: radial-gradient(circle at 30% 30%, rgba(124, 198, 182, 0.75) 0%, rgba(124, 198, 182, 0) 68%);
}

.hf-login-bg__orb--2 {
    width: min(48vw, 460px);
    height: min(48vw, 460px);
    bottom: -18%;
    right: -8%;
    background: radial-gradient(circle at 60% 60%, rgba(147, 197, 253, 0.7) 0%, rgba(147, 197, 253, 0) 70%);
}

.hf-login-bg__orb--3 {
    width: min(28vw, 280px);
    height: min(28vw, 280px);
    top: 38%;
    right: 18%;
    background: radial-gradient(circle, rgba(13, 107, 79, 0.22) 0%, transparent 72%);
    filter: blur(48px);
}

.hf-login-bg__mesh {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.9) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.65) 0%, transparent 40%),
        repeating-linear-gradient(
            125deg,
            rgba(26, 95, 138, 0.03) 0,
            rgba(26, 95, 138, 0.03) 1px,
            transparent 1px,
            transparent 28px
        );
}

.hf-login-bg__symbol {
    position: absolute;
    right: 6%;
    bottom: 8%;
    width: min(340px, 42vw);
    height: auto;
    opacity: 0.045;
    object-fit: contain;
}

body.login-body.hf-login-clean .login-shell.hf-login-shell {
    position: relative;
    z-index: 1;
}

body.login-body.hf-login-clean .login-info,
body.login-body.hf-login-clean .hf-login-info {
    color: #1e3340;
}

body.login-body.hf-login-clean .login-info .admin-brand strong,
body.login-body.hf-login-clean .login-info .admin-brand small,
body.login-body.hf-login-clean .login-info h1 {
    color: #0f3d2e;
}

body.login-body.hf-login-clean .login-info p,
body.login-body.hf-login-clean .hf-login-desc {
    color: #475569;
}

body.login-body.hf-login-clean .login-info .hero-kicker {
    color: var(--hf-brand-blue, #1a5f8a);
}

body.login-body.hf-login-clean .login-badges span {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(26, 95, 138, 0.15);
    color: #334155;
}

.login-shell.hf-login-shell {
    max-width: 1120px;
    gap: 2.5rem;
    padding: 2.5rem 1.25rem;
}

body.login-body.hf-login-clean .hf-login-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hf-login-brand-poster {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1 1 auto;
    min-height: min(68vh, 720px);
    padding: clamp(0.75rem, 2.5vw, 2rem);
}

.hf-login-brand-poster img {
    width: clamp(320px, 48vw, 680px);
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 14px 36px rgba(15, 61, 46, 0.14));
}

.hf-login-logo-link {
    display: inline-block;
    margin-bottom: 1rem;
}

.hf-brand-logo--login {
    max-width: 140px;
    max-height: 88px;
    width: auto;
    height: auto;
    display: block;
    filter: drop-shadow(0 6px 16px rgba(15, 61, 46, 0.1));
}

.hf-login-portal-lead {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--hf-primary-dark, #0f3d2e);
    max-width: 22rem;
    margin-bottom: 1.25rem;
}

body.login-body.hf-login-clean .login-info h1 {
    font-size: clamp(1.35rem, 2.8vw, 1.75rem);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

.login-card.hf-login-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 16px 40px rgba(15, 61, 46, 0.08);
    border: 1px solid rgba(26, 95, 138, 0.1);
}

body.login-body.hf-login-clean .login-card-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
}

/* —— Footer brand —— */
.hf-footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.hf-brand-logo--footer {
    max-height: 48px;
    width: auto;
    flex-shrink: 0;
    opacity: 0.95;
}

.hf-footer-slogan {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.78);
    margin-top: 0.35rem;
}

/* —— KPI / sections —— */
.hf-kpi-grid .hf-stat-card {
    border-radius: 1rem;
}

.hf-section-title h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

/* —— Offcanvas mobile nav —— */
.hf-nav-offcanvas .offcanvas-header {
    border-bottom: 1px solid var(--hf-border, rgba(0, 0, 0, 0.08));
}

.hf-nav-offcanvas .nav-link {
    padding: 0.75rem 0.5rem !important;
    border-radius: 12px;
    font-weight: 600;
}

.hf-nav-offcanvas .hf-login-btn {
    width: 100%;
    margin-top: 0.5rem;
}

@media (max-width: 1399.98px) {
    .hf-navbar .nav-link {
        font-size: 0.8125rem;
        padding: 0.38rem 0.45rem !important;
    }
}

@media (max-width: 1199.98px) {
    .hf-brand-logo--nav {
        max-height: 46px;
    }
    .hf-brand-text {
        display: none;
    }
    .hf-navbar-brand-wrap {
        max-width: 200px;
    }
}

@media (max-width: 991.98px) {
    :root {
        --hf-topbar-height: 0px;
    }
    .hf-topbar {
        display: none !important;
    }
    .hf-hero-brand-watermark {
        width: clamp(120px, 36vw, 160px);
        opacity: 0.05;
        right: 0;
    }
    .login-shell.hf-login-shell {
        grid-template-columns: 1fr;
    }
    .hf-login-info {
        text-align: center;
    }
    .hf-login-brand-poster {
        min-height: auto;
        padding: 1.25rem 0 0.5rem;
    }
    .hf-login-brand-poster img {
        width: clamp(240px, 78vw, 480px);
    }
}

@media (max-width: 575.98px) {
    .hf-login-brand-poster img {
        width: clamp(220px, 88vw, 360px);
    }
    .hf-brand-logo--nav {
        max-height: 40px;
    }
    .hf-hero--home-band .hf-hero-actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hf-brand-logo,
    .hf-navbar .nav-link {
        transition: none;
    }
    .hf-login-bg__orb {
        filter: blur(40px);
    }
}
