/*
 * Goldsmith Alliance ROI calculator.
 * Everything is scoped under .garoi. Brand values come from the live Kubio theme:
 * gold rgb(210,181,86), dark gold rgb(124,107,51), charcoal rgb(65,65,66),
 * sage rgb(188,216,208); headings Ubuntu, body Open Sans (inherited from the theme).
 */
.garoi {
	--garoi-gold: #d2b556;
	--garoi-gold-dark: #7c6b33;   /* 5.0:1 on white: safe for text and links */
	--garoi-gold-deep: #272210;   /* text on gold buttons, 9.5:1 */
	--garoi-gold-tint: #faf6e8;
	--garoi-sage: #bcd8d0;
	--garoi-sage-tint: #eef5f3;
	--garoi-ink: #414142;
	--garoi-muted: #5f5f61;       /* 6.3:1 on white */
	--garoi-line: #dcd8cc;
	--garoi-bg: #ffffff;
	--garoi-error: #b3261e;
	--garoi-success: #1e6b52;
	--garoi-focus: #1d4ed8;
	--garoi-radius: 10px;
	--garoi-heading-font: Ubuntu, Helvetica, Arial, sans-serif;

	box-sizing: border-box;
	max-width: 1100px;
	margin: 0 auto 2.5rem;
	color: var(--garoi-ink);
	font-size: 1rem;
	line-height: 1.55;
	text-align: left;
}

.garoi *,
.garoi *::before,
.garoi *::after {
	box-sizing: inherit;
}

.garoi [hidden] {
	display: none !important;
}

/* Headings: keep the theme's typeface, tame its very large sizes. */
.garoi .garoi__title {
	margin: 0 0 0.5rem;
	font-family: var(--garoi-heading-font);
	font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
	font-weight: 400;
	line-height: 1.2;
	color: var(--garoi-ink);
}

.garoi .garoi__section-title {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 0.35rem;
	font-family: var(--garoi-heading-font);
	font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem);
	font-weight: 500;
	line-height: 1.3;
	color: var(--garoi-ink);
}

.garoi .garoi__section-title:focus {
	outline: none;
}

.garoi .garoi__section-title:focus-visible {
	outline: 3px solid var(--garoi-focus);
	outline-offset: 4px;
}

.garoi .garoi__step {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--garoi-gold);
	color: var(--garoi-gold-deep);
	font-size: 1rem;
	font-weight: 700;
}

.garoi p {
	margin: 0 0 0.75rem;
}

.garoi .garoi__intro {
	font-size: 1.1rem;
}

.garoi .garoi__fees,
.garoi .garoi__hint {
	color: var(--garoi-muted);
	font-size: 0.95rem;
}

.garoi .garoi__header {
	margin-bottom: 1.5rem;
}

.garoi .garoi__section {
	margin: 0 0 1.5rem;
	padding: 1.5rem;
	border: 1px solid var(--garoi-line);
	border-radius: var(--garoi-radius);
	background: var(--garoi-bg);
}

/* Tables */
.garoi .garoi-table {
	width: 100%;
	margin: 0.75rem 0 0;
	border: 0;
	border-collapse: collapse;
	font-size: 0.95rem;
	table-layout: auto;
}

.garoi .garoi-table th,
.garoi .garoi-table td {
	padding: 0.7rem 0.75rem;
	border: 0;
	border-bottom: 1px solid var(--garoi-line);
	background: transparent;
	color: var(--garoi-ink);
	text-align: left;
	vertical-align: middle;
}

.garoi .garoi-table thead th {
	border-bottom: 2px solid var(--garoi-gold);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.garoi .garoi-table tbody th {
	font-weight: 600;
}

.garoi .garoi-table tbody tr:hover {
	background: var(--garoi-gold-tint);
}

.garoi .garoi-col-input,
.garoi .garoi-col-result {
	text-align: right;
	white-space: nowrap;
}

.garoi .garoi-table thead th.garoi-col-input,
.garoi .garoi-table thead th.garoi-col-result {
	text-align: right;
}

.garoi .garoi-col-result {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.garoi .garoi-partner,
.garoi .garoi-note {
	display: block;
	margin-top: 0.15rem;
	color: var(--garoi-muted);
	font-size: 0.85rem;
	font-weight: 400;
}

/* Yes/No switch */
.garoi .garoi-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	cursor: pointer;
	font-weight: 600;
}

/*
 * Extra specificity beats theme-wide checkbox rules such as Kubio's
 * "[data-kubio] input[type=checkbox] { position: relative; bottom: .15rem; ... }",
 * which would otherwise pull the hidden input back into the layout.
 */
.garoi .garoi-switch input.garoi-switch__input[type="checkbox"] {
	position: absolute;
	inset: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	font-size: inherit;
	vertical-align: baseline;
	opacity: 0;
	cursor: pointer;
}

.garoi .garoi-switch .garoi-switch__track {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	width: 2.9rem;
	min-width: 2.9rem;
	height: 1.6rem;
	border: 2px solid var(--garoi-muted);
	border-radius: 999px;
	background: #fff;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.garoi .garoi-switch__track::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: calc(1.6rem - 8px);
	height: calc(1.6rem - 8px);
	border-radius: 50%;
	background: var(--garoi-muted);
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.garoi .garoi-switch__input:checked + .garoi-switch__track {
	border-color: var(--garoi-gold-dark);
	background: var(--garoi-gold);
}

.garoi .garoi-switch__input:checked + .garoi-switch__track::after {
	background: var(--garoi-gold-deep);
	transform: translateX(1.3rem);
}

.garoi .garoi-switch__input:focus-visible + .garoi-switch__track {
	outline: 3px solid var(--garoi-focus);
	outline-offset: 2px;
}

.garoi .garoi-switch__input:disabled ~ * {
	opacity: 0.65;
	cursor: default;
}

.garoi .garoi-switch__state {
	min-width: 2em;
	text-align: left;
}

.garoi .garoi-switch__yes,
.garoi .garoi-switch__input:checked ~ .garoi-switch__state .garoi-switch__no {
	display: none;
}

.garoi .garoi-switch__input:checked ~ .garoi-switch__state .garoi-switch__yes {
	display: inline;
}

/* Inputs */
.garoi input[type="text"],
.garoi input[type="email"],
.garoi input[type="number"] {
	width: 100%;
	min-height: 2.75rem;
	margin: 0;
	padding: 0.55rem 0.75rem;
	border: 1px solid #8a8a8c; /* 3.4:1 against white for the field boundary */
	border-radius: 6px;
	background: #fff;
	color: var(--garoi-ink);
	font: inherit;
	box-shadow: none;
}

.garoi .garoi-number {
	width: 5.5rem;
	text-align: right;
}

.garoi input:focus-visible,
.garoi summary:focus-visible,
.garoi a:focus-visible,
.garoi button:focus-visible {
	outline: 3px solid var(--garoi-focus);
	outline-offset: 2px;
}

.garoi input[aria-invalid="true"] {
	border-color: var(--garoi-error);
	box-shadow: 0 0 0 1px var(--garoi-error);
}

.garoi input:disabled {
	background: #f4f4f4;
	color: var(--garoi-ink);
}

.garoi .garoi-fields {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
	margin: 1rem 0;
}

.garoi .garoi-field label {
	display: block;
	margin-bottom: 0.3rem;
	font-weight: 600;
}

.garoi .garoi-req,
.garoi .garoi-opt {
	color: var(--garoi-muted);
	font-size: 0.85em;
	font-weight: 400;
}

.garoi .garoi-field__error {
	margin: 0.3rem 0 0;
	color: var(--garoi-error);
	font-size: 0.9rem;
	font-weight: 600;
}

.garoi .garoi-check {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	margin: 0.75rem 0 0;
}

.garoi .garoi-check input[type="checkbox"] {
	position: static;
	bottom: auto;
	flex: 0 0 auto;
	width: 1.25rem;
	height: 1.25rem;
	margin: 0.15rem 0 0;
	font-size: inherit;
	vertical-align: top;
	accent-color: var(--garoi-gold-dark);
}

.garoi .garoi-check label {
	margin: 0;
	font-weight: 400;
}

.garoi a {
	color: var(--garoi-gold-dark);
	text-decoration: underline;
}

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.garoi .garoi-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

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

.garoi .garoi-turnstile {
	margin-top: 1rem;
}

/* Buttons: pill shape to match the site. */
.garoi .garoi-btn {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 3rem;
	margin: 1.25rem 0 0;
	padding: 0.8rem 1.9rem;
	border: 2px solid transparent;
	border-radius: 999px;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

/*
 * Button and link colours use !important because page builders (Kubio)
 * colour links with ID-based selectors such as "#kubio .style-123 a",
 * which no class selector can beat. Scoped to .garoi, so nothing leaks out.
 */
.garoi .garoi-btn--primary,
.garoi a.garoi-btn--primary:link,
.garoi a.garoi-btn--primary:visited {
	background: var(--garoi-gold) !important;
	color: var(--garoi-gold-deep) !important;
	text-decoration: none !important;
}

.garoi .garoi-btn--primary:hover,
.garoi .garoi-btn--primary:focus,
.garoi a.garoi-btn--primary:hover,
.garoi a.garoi-btn--primary:focus {
	background: #c4a540 !important;
	color: var(--garoi-gold-deep) !important;
}

.garoi .garoi-btn--secondary,
.garoi .garoi-btn--secondary:hover,
.garoi .garoi-btn--secondary:focus {
	border-color: var(--garoi-gold-dark) !important;
	background: #fff !important;
	color: var(--garoi-gold-dark) !important;
}

.garoi .garoi-btn--secondary:hover {
	background: var(--garoi-gold-tint) !important;
}

/* Button labels and sublines always take the button's colour. */
.garoi .garoi-btn span {
	color: inherit !important;
}

/* Other links (e.g. privacy policy): dark gold passes contrast on white; theme gold does not. */
.garoi a:not(.garoi-btn),
.garoi a:not(.garoi-btn):visited,
.garoi a:not(.garoi-btn):hover {
	color: var(--garoi-gold-dark) !important;
	text-decoration: underline !important;
}

.garoi .garoi-btn[disabled] {
	opacity: 0.7;
	cursor: progress;
}

.garoi .garoi-btn__sub {
	display: block;
	margin-top: 0.2rem;
	font-size: 0.82rem;
	font-weight: 400;
}

.garoi .garoi-alert {
	margin: 1rem 0 0;
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--garoi-error);
	border-radius: 4px;
	background: #fdf0ef;
	color: var(--garoi-error);
	font-weight: 600;
}

/* Results */
.garoi .garoi__results {
	border: 2px solid var(--garoi-gold);
	background: var(--garoi-gold-tint);
}

.garoi .garoi-totals {
	width: 100%;
	max-width: 640px;
	margin: 0.75rem 0 1rem;
	border-collapse: collapse;
	background: #fff;
	font-size: 1rem;
	font-variant-numeric: tabular-nums;
}

.garoi .garoi-totals th,
.garoi .garoi-totals td {
	padding: 0.65rem 0.85rem;
	border: 0;
	border-bottom: 1px solid var(--garoi-line);
	color: var(--garoi-ink);
	text-align: left;
}

.garoi .garoi-totals td,
.garoi .garoi-totals thead th:not(:first-child) {
	text-align: right;
	white-space: nowrap;
}

.garoi .garoi-totals thead th {
	border-bottom: 2px solid var(--garoi-gold);
	font-size: 0.85rem;
}

.garoi .garoi-totals tr.is-strong th,
.garoi .garoi-totals tr.is-strong td {
	font-weight: 700;
}

.garoi .garoi-totals tr.is-net th,
.garoi .garoi-totals tr.is-net td {
	border-bottom: 0;
	background: var(--garoi-sage-tint);
	font-size: 1.1rem;
}

.garoi .garoi-subtitle {
	margin: 1.5rem 0 0;
	font-family: var(--garoi-heading-font);
	font-size: 1.1rem;
	font-weight: 500;
	color: var(--garoi-ink);
}

.garoi .garoi-breakeven {
	margin: 0 0 0.75rem;
	padding: 0;
	list-style: none;
}

.garoi .garoi-breakeven li {
	margin: 0 0 0.35rem;
}

.garoi .garoi-negative {
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--garoi-gold-dark);
	background: #fff;
}

.garoi .garoi-confirm {
	color: var(--garoi-success);
	font-weight: 600;
}

.garoi .garoi-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
}

.garoi .garoi-actions .garoi-btn {
	margin-top: 0.5rem;
}

/* Compliance and FAQ */
.garoi .garoi__compliance {
	padding: 1.25rem 1.5rem;
	border-radius: var(--garoi-radius);
	background: var(--garoi-sage-tint);
	color: var(--garoi-ink);
	font-size: 0.9rem;
}

.garoi .garoi__compliance p:last-child {
	margin-bottom: 0;
}

.garoi .garoi__faq {
	margin-top: 2.5rem;
}

.garoi .garoi-faq {
	border-bottom: 1px solid var(--garoi-line);
}

.garoi .garoi-faq summary {
	padding: 0.9rem 0;
	cursor: pointer;
	font-weight: 600;
}

.garoi .garoi-faq p {
	padding-bottom: 0.75rem;
}

/* Tablet: tighten the tables */
@media (max-width: 900px) {
	.garoi .garoi-fields {
		grid-template-columns: 1fr;
	}

	.garoi .garoi-table th,
	.garoi .garoi-table td {
		padding: 0.6rem 0.5rem;
	}
}

/* Mobile: tables become stacked cards. */
@media (max-width: 720px) {
	.garoi .garoi__section {
		padding: 1rem;
	}

	.garoi .garoi-table,
	.garoi .garoi-table tbody,
	.garoi .garoi-table tr,
	.garoi .garoi-table th,
	.garoi .garoi-table td {
		display: block;
		width: 100%;
	}

	.garoi .garoi-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.garoi .garoi-table tbody tr {
		margin: 0 0 0.85rem;
		padding: 0.75rem 0.9rem;
		border: 1px solid var(--garoi-line);
		border-radius: 8px;
	}

	.garoi .garoi-table tbody th,
	.garoi .garoi-table tbody td {
		padding: 0.3rem 0;
		border: 0;
		text-align: left;
		white-space: normal;
	}

	.garoi .garoi-table tbody th {
		padding-bottom: 0.4rem;
		font-size: 1.05rem;
	}

	.garoi .garoi-table tbody td[data-label] {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 1rem;
		text-align: right;
	}

	.garoi .garoi-table tbody td[data-label]::before {
		content: attr(data-label);
		flex: 0 0 42%;
		text-align: left;
		color: var(--garoi-muted);
		font-size: 0.85rem;
		font-weight: 600;
	}

	.garoi .garoi-table tbody td[data-empty] {
		display: none;
	}

	.garoi .garoi-table tbody td.garoi-col-input,
	.garoi .garoi-table tbody td.garoi-col-result {
		margin-top: 0.35rem;
		padding-top: 0.6rem;
		border-top: 1px solid var(--garoi-line);
	}

	.garoi .garoi-table tbody td.garoi-col-input + td.garoi-col-result {
		margin-top: 0;
		border-top: 0;
	}

	.garoi .garoi-totals th,
	.garoi .garoi-totals td {
		padding: 0.55rem 0.5rem;
		font-size: 0.95rem;
	}

	.garoi .garoi-btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.garoi * {
		transition: none !important;
	}
}
