/**
 * Site header: light professional bar + TradingView ticker band.
 */

.fbr-header {
	--fbr-h-bg0: #ffffff;
	--fbr-h-bg1: #fafbfc;
	--fbr-h-text: #0f172a;
	--fbr-h-muted: #64748b;
	--fbr-h-accent: #0369a1;
	--fbr-h-accent-soft: rgba(3, 105, 161, 0.1);
	--fbr-h-border: rgba(15, 23, 42, 0.08);
	--fbr-h-glow: rgba(3, 105, 161, 0.06);
	position: sticky;
	top: 0;
	z-index: 200;
	color: var(--fbr-h-text);
	background: linear-gradient(180deg, var(--fbr-h-bg1) 0%, var(--fbr-h-bg0) 100%);
	box-shadow: 0 1px 0 var(--fbr-h-border);
	transition: box-shadow 0.35s ease, background 0.35s ease;
}

.fbr-header::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(ellipse 100% 90% at 50% -30%, var(--fbr-h-glow), transparent 50%);
	pointer-events: none;
}

.fbr-header--scrolled {
	background: rgba(255, 255, 255, 0.97);
	box-shadow:
		0 1px 0 var(--fbr-h-border),
		0 8px 30px rgba(15, 23, 42, 0.08);
}

@supports (backdrop-filter: blur(12px)) {
	.fbr-header--scrolled .fbr-header__bar {
		backdrop-filter: blur(12px) saturate(1.15);
		-webkit-backdrop-filter: blur(12px) saturate(1.15);
	}
}

.fbr-header__accent {
	height: 2px;
	width: 100%;
	background: var(--fbr-h-accent);
	position: relative;
	z-index: 2;
}

.fbr-header__bar {
	position: relative;
	z-index: 1;
	border-bottom: 1px solid var(--fbr-h-border);
}

.fbr-header__inner {
	position: relative;
	max-width: 1240px;
	margin: 0 auto;
	padding: 0.75rem clamp(1rem, 4vw, 1.75rem);
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 1rem 1.5rem;
}

.fbr-header__brand {
	flex: 0 1 auto;
	min-width: 0;
}

.fbr-header__logo-wrap {
	display: flex;
	align-items: center;
}

.fbr-header__logo-wrap .custom-logo-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.fbr-header__logo-wrap .custom-logo-link:hover,
.fbr-header__logo-wrap .custom-logo-link:focus-visible {
	opacity: 0.88;
	transform: translateY(-1px);
	outline: none;
}

.fbr-header__logo-wrap .custom-logo-link img,
.fbr-header__logo-wrap img {
	display: block;
	max-height: 44px;
	width: auto;
	height: auto;
	filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.08));
}

.fbr-header__title-link {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	text-decoration: none;
	color: inherit;
	padding: 0.15rem 0;
	transition: opacity 0.2s ease;
}

.fbr-header__title-link:hover,
.fbr-header__title-link:focus-visible {
	opacity: 0.85;
	outline: none;
}

.fbr-header__title {
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.15;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.fbr-header__title-text {
	color: var(--fbr-h-text);
}

.fbr-header__tagline {
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: var(--fbr-h-muted);
	line-height: 1.4;
	max-width: min(320px, 55vw);
}

.fbr-header__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
}

.fbr-header__compare {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border-radius: 8px;
	border: 1px solid var(--fbr-h-border);
	background: #fff;
	color: var(--fbr-h-text);
	text-decoration: none;
	transition:
		background 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		color 0.2s ease,
		transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.fbr-header__compare:hover,
.fbr-header__compare:focus-visible {
	background: #f8fafc;
	border-color: rgba(3, 105, 161, 0.35);
	box-shadow: 0 0 0 2px var(--fbr-h-accent-soft);
	color: var(--fbr-h-accent);
	outline: none;
}

.fbr-header__compare:active {
	transform: scale(0.96);
}

.fbr-header__compare-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.fbr-header__compare-count {
	position: absolute;
	top: 2px;
	right: 2px;
	min-width: 1.125rem;
	height: 1.125rem;
	padding: 0 4px;
	font-size: 0.625rem;
	font-weight: 700;
	line-height: 1.125rem;
	text-align: center;
	color: #fff;
	background: var(--fbr-h-accent, #0369a1);
	border-radius: 999px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
	pointer-events: none;
}

/* No brokers in list: hide icon + badge (live-updated via fbrCompareChanged) */
.fbr-header__compare--empty {
	display: none !important;
}

.fbr-header__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 1.15rem;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	color: #fff;
	background: var(--fbr-h-accent);
	border-radius: 8px;
	border: 1px solid transparent;
	transition: background 0.2s ease, box-shadow 0.2s ease;
	white-space: nowrap;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.fbr-header__cta:hover,
.fbr-header__cta:focus-visible {
	background: #0284c7;
	box-shadow: 0 2px 10px rgba(3, 105, 161, 0.3);
	outline: none;
	color: #fff;
}

/* Secondary: /broker-submit/ (right of primary CTA, before menu toggle) */
.fbr-header__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 1.05rem;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	color: var(--fbr-h-accent);
	background: #fff;
	border-radius: 8px;
	border: 1px solid rgba(3, 105, 161, 0.45);
	transition:
		background 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		color 0.2s ease;
	white-space: nowrap;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.fbr-header__submit:hover,
.fbr-header__submit:focus-visible {
	background: var(--fbr-h-accent-soft);
	border-color: var(--fbr-h-accent);
	box-shadow: 0 0 0 2px var(--fbr-h-accent-soft);
	color: #0369a1;
	outline: none;
}

/* Log in / My account / Register */
.fbr-header__account {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 0.95rem;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	color: var(--fbr-h-text);
	background: #fff;
	border-radius: 8px;
	border: 1px solid var(--fbr-h-border);
	transition:
		background 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease;
	white-space: nowrap;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.fbr-header__account:hover,
.fbr-header__account:focus-visible {
	background: #f8fafc;
	border-color: rgba(3, 105, 161, 0.35);
	color: #0369a1;
	outline: none;
}

/* User / account icon (replaces visible “Log in” / “My account” text) */
.fbr-header__account--icon {
	width: 44px;
	height: 44px;
	min-width: 44px;
	padding: 0;
	flex-shrink: 0;
}

.fbr-header__account-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.fbr-header__account-icon svg {
	display: block;
}

.fbr-header__account--ghost {
	color: var(--fbr-h-muted);
	border-style: dashed;
}

.fbr-header__menu-toggle {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--fbr-h-border);
	border-radius: 8px;
	background: #fff;
	color: var(--fbr-h-text);
	cursor: pointer;
	transition:
		background 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.fbr-header__menu-toggle:hover,
.fbr-header__menu-toggle:focus-visible {
	background: #f8fafc;
	border-color: rgba(3, 105, 161, 0.35);
	box-shadow: 0 0 0 2px var(--fbr-h-accent-soft);
	outline: none;
}

.fbr-header__menu-toggle-box {
	display: flex;
	flex-direction: column;
	gap: 5px;
	width: 20px;
}

.fbr-header__menu-toggle-bar {
	display: block;
	height: 2px;
	width: 100%;
	background: linear-gradient(90deg, var(--fbr-h-text), var(--fbr-h-muted));
	border-radius: 2px;
	transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.fbr-header__menu-toggle[aria-expanded="true"] .fbr-header__menu-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.fbr-header__menu-toggle[aria-expanded="true"] .fbr-header__menu-toggle-bar:nth-child(2) {
	opacity: 0;
	transform: scaleX(0);
}

.fbr-header__menu-toggle[aria-expanded="true"] .fbr-header__menu-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

.fbr-header__nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	min-width: 0;
}

.fbr-header__menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fbr-header__menu li {
	position: relative;
	margin: 0;
	padding: 0;
}

.fbr-header__menu > li > a {
	display: block;
	padding: 0.5rem 0.85rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--fbr-h-text);
	text-decoration: none;
	border-radius: 6px;
	transition: color 0.15s ease, background 0.15s ease;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.fbr-header__menu > li > a:hover,
.fbr-header__menu > li > a:focus-visible {
	color: var(--fbr-h-accent);
	background: transparent;
	outline: none;
}

.fbr-header__menu > li.current-menu-item > a,
.fbr-header__menu > li.current_page_item > a {
	color: var(--fbr-h-accent);
	font-weight: 600;
}

@media (max-width: 782px) {
	.fbr-header__inner {
		flex-wrap: wrap;
		padding-top: 0.65rem;
		padding-bottom: 0.65rem;
	}

	.fbr-header__brand {
		flex: 1 1 auto;
		min-width: 0;
	}

	.fbr-header__nav {
		order: 5;
		flex: 1 0 100%;
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		justify-content: stretch;
		max-height: 0;
		overflow: hidden;
		background: #fff;
		border-bottom: 1px solid var(--fbr-h-border);
		transition: max-height 0.35s ease;
		box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
	}

	.fbr-header__nav.is-open {
		max-height: min(70vh, 480px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.fbr-header__actions {
		order: 2;
		margin-left: auto;
	}

	.fbr-header__menu-toggle {
		display: flex;
	}

	.fbr-header__cta {
		padding: 0.45rem 0.85rem;
		font-size: 0.75rem;
	}

	.fbr-header__submit {
		padding: 0.45rem 0.75rem;
		font-size: 0.75rem;
	}

	.fbr-header__account {
		padding: 0.45rem 0.65rem;
		font-size: 0.75rem;
	}

	.fbr-header__account--icon {
		width: 40px;
		height: 40px;
		min-width: 40px;
		padding: 0;
	}

	.fbr-header__account--icon .fbr-header__account-icon svg {
		width: 20px;
		height: 20px;
	}

	.fbr-header__menu {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		padding: 0.5rem 1rem 1rem;
	}

	.fbr-header__menu > li > a {
		padding: 0.65rem 0.75rem;
		font-size: 0.9375rem;
		border-radius: 6px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fbr-header,
	.fbr-header__menu-toggle-bar,
	.fbr-header__menu > li > a,
	.fbr-header__nav,
	.fbr-header__compare {
		transition: none;
	}

	.fbr-header__compare:active {
		transform: none;
	}
}

/* TradingView ticker: under header (no negative margin: was hiding behind sticky bar) */
.fbr-tradingview-ticker.tradingview-widget-container {
	width: 100%;
	margin: 0;
	position: relative;
	z-index: 50;
	clear: both;
	min-height: 46px;
	background: #fff;
	border-bottom: 1px solid var(--fbr-h-border, rgba(15, 23, 42, 0.08));
}

.fbr-tradingview-ticker .fbr-tradingview-ticker__slot,
.fbr-tradingview-ticker .tradingview-widget-container__widget {
	width: 100%;
	min-height: 46px;
}
