/**
 * PAUK Wealth Band Slider
 * Brand-styled, touch-friendly discrete slider for Gravity Forms.
 */

.pauk-wb {
	--pauk-navy: #112b62;
	--pauk-purple: #714ace;
	--pauk-rail: #cfc7e8;
	--pauk-muted: #5b6a8a;
	--pauk-white: #fff;
	--pauk-pos: 0%;

	max-width: 40rem;
	font-family: inherit;
}

/* ---------- Readout ---------- */

.pauk-wb__readout {
	display: flex;
	align-items: baseline;
	min-height: 2.4em;
	margin: 0 0 0.35rem;
}

.pauk-wb__value {
	font-size: clamp(1.5rem, 6vw, 2rem);
	font-weight: 800;
	line-height: 1.2;
	color: var(--pauk-navy);
	letter-spacing: -0.01em;
}

.pauk-wb--unset .pauk-wb__value {
	font-size: 1rem;
	font-weight: 600;
	color: var(--pauk-muted);
	letter-spacing: 0;
}

/* ---------- Slider ---------- */

.pauk-wb__slider {
	position: relative;
	height: 44px; /* full-size touch target */
	margin: 0;
}

.pauk-wb__slider[hidden] {
	display: none;
}

.pauk-wb__rail {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 8px;
	transform: translateY(-50%);
	border-radius: 999px;
	background: var(--pauk-rail);
	overflow: hidden;
}

.pauk-wb__fill {
	display: block;
	height: 100%;
	width: var(--pauk-pos, 0%);
	border-radius: 999px;
	background: linear-gradient(90deg, var(--pauk-purple) 0%, var(--pauk-navy) 100%);
	transition: width 0.12s ease-out;
}

.pauk-wb--unset .pauk-wb__fill {
	width: 0;
}

.pauk-wb__ticks {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 0;
	pointer-events: none;
}

.pauk-wb__tick {
	position: absolute;
	top: 0;
	width: 3px;
	height: 3px;
	margin-left: -1.5px;
	transform: translateY(-50%);
	border-radius: 50%;
	background: rgba(17, 43, 98, 0.25);
}

.pauk-wb__tick.is-anchor {
	width: 4px;
	height: 4px;
	margin-left: -2px;
	background: rgba(17, 43, 98, 0.4);
}

/*
 * The native input sits transparently over the rail.
 *
 * Themes and the Gravity Forms stylesheet both style bare inputs, and their
 * selectors are specific enough to win on background, border, radius and
 * height — which paints a white box over the rail. These resets are forced so
 * the control renders the same whatever the surrounding theme does.
 */
.pauk-wb .pauk-wb__slider input.pauk-wb__range {
	position: absolute;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 44px !important;
	min-height: 0 !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none;
	line-height: normal;
	cursor: pointer;
	touch-action: pan-y;
	-webkit-appearance: none;
	appearance: none;
}

.pauk-wb .pauk-wb__slider input.pauk-wb__range:focus {
	outline: none;
	box-shadow: none;
}

.pauk-wb .pauk-wb__slider input.pauk-wb__range::-webkit-slider-runnable-track {
	height: 44px;
	background: transparent;
	border: 0;
}

.pauk-wb .pauk-wb__slider input.pauk-wb__range::-moz-range-track {
	height: 44px;
	background: transparent;
	border: 0;
}

.pauk-wb .pauk-wb__slider input.pauk-wb__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	width: 28px;
	height: 28px;
	margin-top: 8px;
	border: 4px solid var(--pauk-purple);
	border-radius: 50%;
	background: var(--pauk-white);
	box-shadow: 0 2px 6px rgba(17, 43, 98, 0.28);
	transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.pauk-wb .pauk-wb__slider input.pauk-wb__range::-moz-range-thumb {
	box-sizing: border-box;
	width: 28px;
	height: 28px;
	border: 4px solid var(--pauk-purple);
	border-radius: 50%;
	background: var(--pauk-white);
	box-shadow: 0 2px 6px rgba(17, 43, 98, 0.28);
	transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.pauk-wb--unset .pauk-wb__slider input.pauk-wb__range::-webkit-slider-thumb {
	border-color: #9aa5bd;
}

.pauk-wb--unset .pauk-wb__slider input.pauk-wb__range::-moz-range-thumb {
	border-color: #9aa5bd;
}

.pauk-wb .pauk-wb__slider input.pauk-wb__range:focus-visible::-webkit-slider-thumb,
.pauk-wb .pauk-wb__slider input.pauk-wb__range:focus::-webkit-slider-thumb {
	box-shadow: 0 0 0 5px rgba(113, 74, 206, 0.28), 0 2px 6px rgba(17, 43, 98, 0.28);
}

.pauk-wb .pauk-wb__slider input.pauk-wb__range:focus-visible::-moz-range-thumb,
.pauk-wb .pauk-wb__slider input.pauk-wb__range:focus::-moz-range-thumb {
	box-shadow: 0 0 0 5px rgba(113, 74, 206, 0.28), 0 2px 6px rgba(17, 43, 98, 0.28);
}

.pauk-wb .pauk-wb__slider input.pauk-wb__range[disabled] {
	cursor: default;
	opacity: 0.65;
}

/* ---------- Scale + hint ---------- */

.pauk-wb__scale {
	display: flex;
	justify-content: space-between;
	margin-top: 0.35rem;
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--pauk-muted);
}

.pauk-wb__hint {
	margin-top: 0.5rem;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--pauk-muted);
}

.pauk-wb:not(.pauk-wb--unset) .pauk-wb__hint {
	visibility: hidden;
}

/* ---------- No-JS fallback control ---------- */

.pauk-wb__fallback-label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.pauk-wb__select {
	width: 100%;
	max-width: 22rem;
	min-height: 44px;
	padding: 0.55rem 0.75rem;
	font-family: inherit;
	font-size: 1rem;
	color: var(--pauk-navy);
	background: var(--pauk-white);
	border: 1px solid #c8cede;
	border-radius: 4px;
}

.pauk-wb--js .pauk-wb__fallback,
.pauk-wb__fallback--hidden {
	display: none;
}

/* ---------- Small screens ---------- */

@media (max-width: 420px) {
	.pauk-wb__tick:not(.is-anchor) {
		display: none;
	}
}

/* ---------- Preferences ---------- */

@media (prefers-reduced-motion: reduce) {
	.pauk-wb__fill,
	.pauk-wb__range::-webkit-slider-thumb,
	.pauk-wb__range::-moz-range-thumb {
		transition: none;
	}
}

@media (forced-colors: active) {
	.pauk-wb__rail {
		border: 1px solid CanvasText;
	}

	.pauk-wb__fill {
		background: Highlight;
	}

	.pauk-wb__range::-webkit-slider-thumb {
		border-color: CanvasText;
		background: Canvas;
	}

	.pauk-wb__range::-moz-range-thumb {
		border-color: CanvasText;
		background: Canvas;
	}
}
