/*
 * The Calculators page tools, [tangerine_tools] — Figma 2473:5721 (desktop)
 * and 2473:6611 (393 mobile). Markup: assets/partials/tools.php.
 *
 * Desktop: tabs 4 x 310x80, 40, card 1240 (controls 760 | results 480),
 * 20, note strip 97. Phones stack the tabs and the card, and the sliders
 * thicken to a 6px bar with a 20px handle.
 */

.tg-tools {
	--tt-grad: linear-gradient(90deg, #F08A33, #DE4807);
	--tt-gold: linear-gradient(180deg, #E6C46B, #A87F35);
	--tt-line: rgba(255, 255, 255, .06);
	font-family: "Hanken Grotesk", sans-serif;
	color: #F5F2ED;
	width: 100%;
}

.tg-tools p,
.tg-tools dl,
.tg-tools dd,
.tg-tools ul { margin: 0; padding: 0; }
.tg-tools [hidden] { display: none !important; }

/* the theme's <button> carries a 48px min-height and its own skin */
.tg-tools button {
	min-height: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

/* --- tabs ---------------------------------------------------------------- */
.tg-tools__tabs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
}

.tg-tools .tg-tools__tab {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	gap: 7px;
	padding: 18px 22px 18px;
	text-align: left;
	color: inherit;
	box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .08);
	transition: background-color .25s ease, box-shadow .25s ease;
}

.tg-tools .tg-tools__tab[aria-selected="true"] {
	background: rgba(255, 90, 30, .055);
	box-shadow: inset 0 -2px 0 #FF5A1E;
}

.tg-tools .tg-tools__tab:hover { background: rgba(255, 255, 255, .02); }
.tg-tools .tg-tools__tab[aria-selected="true"]:hover { background: rgba(255, 90, 30, .055); }
.tg-tools .tg-tools__tab:focus-visible { outline: 2px solid #FF5A1E; outline-offset: -2px; }

.tg-tools__tab-top {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
}

.tg-tools__num {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .66px;
	line-height: 17px;
	color: #3A3733;
	transition: color .25s ease;
}

.tg-tools__name {
	flex: 1;
	font-size: 19px;
	font-weight: 600;
	letter-spacing: -.08px;
	line-height: 25px;
	color: #6A645C;
	transition: color .25s ease;
}

.tg-tools__chev {
	flex: 0 0 11px;
	width: 11px;
	height: 11px;
	fill: #FF5A1E;
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity .25s ease, transform .25s ease;
}

.tg-tools__sub {
	font-size: 16px;
	line-height: 20px;
	color: #4A443E;
	transition: color .25s ease;
}

.tg-tools__tab[aria-selected="true"] .tg-tools__num { color: #FF5A1E; }
.tg-tools__tab[aria-selected="true"] .tg-tools__name { color: #F5F2ED; }
.tg-tools__tab[aria-selected="true"] .tg-tools__sub { color: #8A8072; }
.tg-tools__tab[aria-selected="true"] .tg-tools__chev { opacity: 1; transform: none; }

/* --- the card ------------------------------------------------------------ */
.tg-tools__panel { margin-top: 40px; }

.tg-tools__card {
	display: flex;
	border: 1px solid var(--tt-line);
	border-radius: 20px;
	background: linear-gradient(149.13deg, #241E19 0%, #161311 45%, #121010 100%);
	box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .45);
	overflow: hidden;
}

.tg-tools__controls {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 30px;
	padding: 36px;
}

.tg-tools__results {
	flex: 0 0 480px;
	display: flex;
	flex-direction: column;
	padding: 36px;
	border-left: 1px solid var(--tt-line);
}

/* toggle */
.tg-tools__toggle {
	align-self: flex-start;
	display: inline-flex;
	gap: 2px;
	margin-bottom: 4px; /* 34 to the first slider */
	padding: 4px;
	border-radius: 100px;
	background: #221E1B;
}

.tg-tools .tg-tools__toggle button {
	height: 32px;
	padding: 0 22px;
	border-radius: 100px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .66px;
	line-height: 19px;
	text-transform: uppercase;
	color: #8A8072;
	transition: color .2s ease;
}

.tg-tools .tg-tools__toggle button:hover { color: #F5F2ED; }
.tg-tools .tg-tools__toggle button[aria-pressed="true"] { background: var(--tt-grad); color: #FFF; }
.tg-tools .tg-tools__toggle button:focus-visible { outline: 2px solid #FF5A1E; outline-offset: 2px; }

/* sliders */
.tg-tools__field { display: flex; flex-direction: column; gap: 26px; }

.tg-tools__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.tg-tools__head label {
	margin: 0;
	font-size: 16px;
	font-weight: 400;
	line-height: 20px;
	color: #8A8072;
}

.tg-tools__head output {
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -.075px;
	line-height: 23px;
	color: #F5F2ED;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.tg-tools__track { position: relative; height: 16px; }

.tg-tools .tg-tools__range {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 16px;
	margin: 0;
	padding: 0;
	border: 0;
	outline: none;
	cursor: pointer;
	background: transparent no-repeat center / 100% 3px;
	background-image: linear-gradient(90deg, #F08A33 0%, #DE4807 var(--pos, 50%), #2C2723 var(--pos, 50%), #2C2723 100%);
	border-radius: 2px;
}

.tg-tools__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border: 0;
	border-radius: 50%;
	background: #FFF;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
	transition: transform .15s ease;
}

.tg-tools__range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: 0;
	border-radius: 50%;
	background: #FFF;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}

.tg-tools__range::-moz-range-track { background: none; }
.tg-tools__range:active::-webkit-slider-thumb { transform: scale(1.15); }
.tg-tools__range:focus-visible { outline: 2px solid #FF5A1E; outline-offset: 6px; }

/* the value bubble, over the handle while it is in use */
.tg-tools__tip {
	position: absolute;
	bottom: calc(100% + 6px);
	left: calc(7px + (100% - 14px) * var(--p, .5));
	padding: 6px 11px;
	border-radius: 6px;
	background: rgba(255, 255, 255, .97);
	box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .19px;
	line-height: 15px;
	color: #191512;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, 4px);
	transition: opacity .2s ease, transform .2s ease;
}

.tg-tools__track:hover .tg-tools__tip,
.tg-tools__range:focus-visible + .tg-tools__tip,
.tg-tools__range:active + .tg-tools__tip { opacity: 1; transform: translate(-50%, 0); }

/* results */
.tg-tools__k {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 1.14px;
	line-height: 19px;
	text-transform: uppercase;
	color: #6A645C;
}

.tg-tools__big {
	margin-top: 14px !important;
	font-size: 40px;
	font-weight: 700;
	letter-spacing: -.8px;
	line-height: 52px;
	color: #FF5A1E;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.tg-tools__split {
	position: relative;
	display: flex;
	align-items: center;
	gap: 26px;
	margin-top: 26px;
}

.tg-tools__donut { flex: 0 0 112px; width: 112px; height: 112px; display: block; }
.tg-tools__arc { transition: stroke-dasharray .35s ease, transform .35s ease; }

.tg-tools__pct {
	position: absolute;
	left: 0;
	top: 50%;
	width: 112px;
	transform: translateY(-50%);
	text-align: center;
	font-size: 19px;
	font-weight: 600;
	letter-spacing: -.19px;
	line-height: 25px;
	color: #F5F2ED;
}

.tg-tools__legend { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.tg-tools__legend li {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .9px;
	line-height: 20px;
	text-transform: uppercase;
	color: #6A645C;
}

.tg-tools__legend li::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 2px;
	background: var(--tt-gold);
}

.tg-tools__legend .is-orange::before { background: var(--tt-grad); }

.tg-tools__rows { margin-top: 26px !important; }

.tg-tools__rows > div {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: 43px;
	border-bottom: 1px solid var(--tt-line);
	font-size: 15px;
	line-height: 20px;
}

.tg-tools__rows > div:last-child { border-bottom: 0; }
.tg-tools__rows dt { color: #6A645C; font-weight: 400; }
.tg-tools__rows dd { color: #E2DCD2; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* buttons: gradient pill with the white disc and chevron */
.tg-tools .tg-tools__btn {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	height: 44px;
	margin-top: 26px;
	padding: 0 7px 0 24px;
	border-radius: 100px;
	background: var(--tt-grad);
	box-shadow: 0 0 26px rgba(222, 72, 7, .34);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .6px;
	line-height: 19px;
	text-transform: uppercase;
	text-decoration: none;
	color: #FFF;
	white-space: nowrap;
	transition: box-shadow .25s ease, transform .25s ease;
}

.tg-tools .tg-tools__btn:hover { color: #FFF; box-shadow: 0 0 34px rgba(222, 72, 7, .5); transform: translateY(-1px); }
.tg-tools .tg-tools__btn:focus-visible { outline: 2px solid #FFF; outline-offset: 3px; }

.tg-tools__go {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #FFF;
}

.tg-tools__go svg { width: 10px; height: 10px; fill: #DE4807; transition: transform .25s ease; }
.tg-tools__btn:hover .tg-tools__go svg { transform: translateX(2px); }

/* --- the note strip under the card --------------------------------------- */
.tg-tools__note {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-top: 20px;
	padding: 24px 20px 24px 32px;
	border: 1px solid rgba(222, 72, 7, .22);
	border-radius: 18px;
	background: linear-gradient(90deg, #3A1E0C 0%, #1C1512 60%, #161311 100%);
}

.tg-tools__note-t {
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -.2px;
	line-height: 26px;
	color: #F5F2ED;
}

.tg-tools__note-s {
	margin-top: 6px !important;
	font-size: 16px;
	line-height: 21px;
	color: #8A8072;
}

.tg-tools .tg-tools__note .tg-tools__btn { align-self: center; margin-top: 0; flex: none; }

/* --- tablet: the card stacks before the 480 results column gets squeezed - */
@media (max-width: 1024px) {
	.tg-tools__card { flex-direction: column; }
	.tg-tools__results { flex-basis: auto; border-left: 0; border-top: 1px solid var(--tt-line); }
	.tg-tools__name { font-size: 17px; }
}

/* --- phones: Figma 2473:6611 --------------------------------------------- */
@media (max-width: 767px) {
	.tg-tools__tabs { grid-template-columns: 1fr; }
	.tg-tools .tg-tools__tab { gap: 8px; min-height: 81px; }
	.tg-tools__name { font-size: 17px; }

	.tg-tools__panel { margin-top: 32px; }
	.tg-tools__controls { gap: 24px; padding: 24px; }
	.tg-tools__results { padding: 24px; }
	.tg-tools__toggle { margin-bottom: 0; }
	.tg-tools .tg-tools__toggle button { padding: 0 20px; }

	.tg-tools__field { gap: 12px; }
	.tg-tools__head label { font-size: 17px; font-weight: 600; line-height: 23px; color: #F5F2ED; }
	.tg-tools__track,
	.tg-tools .tg-tools__range { height: 20px; }
	.tg-tools .tg-tools__range {
		background-size: 100% 6px;
		background-image: linear-gradient(90deg, #FC7834 0%, #C84603 var(--pos, 50%), #33302E var(--pos, 50%), #33302E 100%);
	}
	.tg-tools__range::-webkit-slider-thumb { width: 20px; height: 20px; }
	.tg-tools__range::-moz-range-thumb { width: 20px; height: 20px; }
	.tg-tools__tip { left: calc(10px + (100% - 20px) * var(--p, .5)); }

	.tg-tools__k { font-size: 16px; font-weight: 400; letter-spacing: 1.5px; line-height: 20px; color: #8A8072; }
	.tg-tools__big { margin-top: 0 !important; font-size: 28px; letter-spacing: -.56px; line-height: 36px; }
	.tg-tools__split { margin-top: 24px; gap: 24px; }
	.tg-tools__donut { flex-basis: 96px; width: 96px; height: 96px; }
	.tg-tools__pct { width: 96px; }
	.tg-tools__rows { margin-top: 24px !important; }
	.tg-tools .tg-tools__btn { margin-top: 24px; }

	.tg-tools__note { flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 16px; padding: 24px 20px; }
	.tg-tools .tg-tools__note .tg-tools__btn { align-self: flex-start; }
}

/* --- switching tabs: the new panel rises in ------------------------------ */
.tg-tools__panel:not([hidden]) { animation: tg-tools-in .45s cubic-bezier(.2, .7, .2, 1); }

@keyframes tg-tools-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.tg-tools__panel:not([hidden]) { animation: none; }
}
