/*
 * TOA Payroll Pricing Calculator
 *
 * Two layers:
 *  1. .toa-ppc            structural styles (steps, form, lock, blur). Always loaded.
 *  2. .toa-ppc--themed    the card look (blue card, lime accents). Only when
 *                         Design > Styling is "Plugin styling".
 * Colours and sizes come from CSS custom properties printed from the Design tab.
 */

/* ------------------------------------------------------------------ */
/* 1. Structural                                                       */
/* ------------------------------------------------------------------ */

.toa-ppc {
	box-sizing: border-box;
	position: relative;
	container-type: inline-size;
}

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

.toa-ppc [hidden] {
	display: none !important;
}

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

.toa-ppc .toa-ppc-form {
	margin: 0;
}

/* Steps indicator */
.toa-ppc .toa-ppc-steps {
	display: flex;
	align-items: center;
	gap: 10px;
	list-style: none;
	margin: 22px 0 22px;
	padding: 0;
	font-size: 13px;
	line-height: 1.2;
	color: var(--ppc-muted);
}

.toa-ppc .toa-ppc-steps li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	flex: 0 1 auto;
	min-width: 0;
	opacity: .78;
	transition: opacity .25s ease;
}

.toa-ppc .toa-ppc-steps li + li::before {
	content: "";
	display: block;
	width: 26px;
	height: 1px;
	margin-right: 2px;
	background: var(--ppc-line);
	flex: 0 0 auto;
}

.toa-ppc .toa-ppc-steps li.is-active,
.toa-ppc .toa-ppc-steps li.is-done {
	opacity: 1;
	color: var(--ppc-text);
}

.toa-ppc .toa-ppc-steps li.is-clickable {
	cursor: pointer;
}

.toa-ppc .toa-ppc-dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 1px solid var(--ppc-line);
	font-size: 12px;
	font-weight: 700;
	color: var(--ppc-text);
	transition: background .25s ease, color .25s ease, border-color .25s ease;
}

.toa-ppc .toa-ppc-dot svg {
	width: 13px;
	height: 13px;
}

.toa-ppc .toa-ppc-steps li.is-active .toa-ppc-dot,
.toa-ppc .toa-ppc-steps li.is-done .toa-ppc-dot {
	background: var(--ppc-accent);
	border-color: var(--ppc-accent);
	color: var(--ppc-accent-text);
}

.toa-ppc .toa-ppc-step-name {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 600;
}

/* Panels */
.toa-ppc .toa-ppc-panel.is-entering {
	animation: toa-ppc-in .35s ease both;
}

@keyframes toa-ppc-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

/* Step 2: summary chip */
.toa-ppc .toa-ppc-chip {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	padding: 8px 8px 8px 14px;
	border-radius: 14px;
	background: rgba(255, 255, 255, .12);
	font-size: 14px;
	color: var(--ppc-text);
}

.toa-ppc .toa-ppc-link {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ppc-accent);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	box-shadow: none;
}

.toa-ppc .toa-ppc-link:hover,
.toa-ppc .toa-ppc-link:focus,
.toa-ppc .toa-ppc-link:active {
	background: rgba(255, 255, 255, .1);
	color: var(--ppc-accent);
	border: 0;
	box-shadow: none;
}

.toa-ppc .toa-ppc-link svg {
	width: 16px;
	height: 16px;
}

.toa-ppc .toa-ppc-title {
	margin: 18px 0 4px;
	font-size: 22px;
	line-height: 1.25;
	font-weight: 600;
	color: var(--ppc-text);
	outline: none;
}

.toa-ppc .toa-ppc-intro {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ppc-muted);
}

/* Step 2: fields */
.toa-ppc .toa-ppc-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 16px;
}

.toa-ppc .toa-ppc-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.toa-ppc .toa-ppc-field label {
	font-size: 14px;
	font-weight: 500;
	color: var(--ppc-text);
}

.toa-ppc .toa-ppc-req {
	color: var(--ppc-accent);
}

.toa-ppc .toa-ppc-field input {
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 2px solid transparent;
	border-radius: var(--ppc-control-radius);
	background: var(--ppc-field);
	color: var(--ppc-field-text);
	font: inherit;
	font-size: 16px;
	box-shadow: none;
	outline: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.toa-ppc .toa-ppc-field input:focus {
	border-color: var(--ppc-accent);
	box-shadow: 0 0 0 3px rgba(215, 242, 141, .35);
}

.toa-ppc .toa-ppc-field input[aria-invalid="true"] {
	border-color: var(--ppc-error);
}

.toa-ppc .toa-ppc-error {
	display: block;
	min-height: 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--ppc-error);
}

.toa-ppc .toa-ppc-error:empty {
	display: none;
}

.toa-ppc .toa-ppc-error--form {
	margin: 12px 0 0;
}

.toa-ppc .toa-ppc-consent {
	margin-top: 16px;
}

.toa-ppc .toa-ppc-consent label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--ppc-muted);
	cursor: pointer;
}

.toa-ppc .toa-ppc-consent input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--ppc-accent);
}

.toa-ppc .toa-ppc-consent a {
	color: var(--ppc-text);
	text-decoration: underline;
}

.toa-ppc .toa-ppc-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Step 3: success */
.toa-ppc .toa-ppc-success {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 16px 18px;
	border-radius: 12px;
	background: rgba(255, 255, 255, .1);
	outline: none;
}

.toa-ppc .toa-ppc-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--ppc-accent);
	color: var(--ppc-accent-text);
}

.toa-ppc .toa-ppc-success-icon svg {
	width: 18px;
	height: 18px;
	stroke-width: 2.4;
}

.toa-ppc .toa-ppc-success-text {
	margin: 4px 0 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--ppc-text);
}

.toa-ppc .toa-ppc-adjust {
	margin: 10px 0 0 -10px;
}

/* Estimate: lock and blur */
.toa-ppc .estimate {
	position: relative;
}

.toa-ppc .toa-ppc-figure-wrap {
	position: relative;
	min-height: 60px;
}

.toa-ppc .estimate-figure {
	transition: filter .6s ease, opacity .6s ease;
}

.toa-ppc .estimate.is-locked .estimate-figure {
	filter: blur(var(--ppc-blur));
	user-select: none;
	pointer-events: none;
}

.toa-ppc .toa-ppc-lock {
	position: absolute;
	left: 0;
	top: 50%;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 100%;
	padding: 10px 20px 10px 10px;
	border-radius: 999px;
	background: var(--ppc-lock-bg);
	color: var(--ppc-lock-text);
	box-shadow: 0 14px 34px -12px rgba(10, 18, 60, .55);
	transform: translateY(-50%);
	transition: opacity .4s ease, transform .4s ease;
	z-index: 2;
}

.toa-ppc .estimate:not(.is-locked) .toa-ppc-lock {
	opacity: 0;
	transform: translateY(-50%) scale(.9);
	pointer-events: none;
	visibility: hidden;
	transition: opacity .4s ease, transform .4s ease, visibility 0s linear .4s;
}

.toa-ppc .toa-ppc-lock-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--ppc-accent);
	color: var(--ppc-accent-text);
}

.toa-ppc .toa-ppc-lock-icon svg {
	width: 20px;
	height: 20px;
	stroke-width: 2;
}

.toa-ppc .toa-ppc-lock-copy {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	line-height: 1.25;
}

.toa-ppc .toa-ppc-lock-copy strong {
	font-size: 15px;
	font-weight: 700;
}

.toa-ppc .toa-ppc-lock-copy span {
	font-size: 13px;
	opacity: .75;
}

.toa-ppc.toa-ppc--pulse[data-step="2"] .toa-ppc-lock {
	animation: toa-ppc-pulse 2.2s ease-in-out infinite;
}

@keyframes toa-ppc-pulse {
	0%, 100% { box-shadow: 0 14px 34px -12px rgba(10, 18, 60, .55), 0 0 0 0 rgba(215, 242, 141, .7); }
	50%      { box-shadow: 0 14px 34px -12px rgba(10, 18, 60, .55), 0 0 0 10px rgba(215, 242, 141, 0); }
}

.toa-ppc .toa-ppc-secondary {
	display: block;
	margin-top: 8px;
}

.toa-ppc .estimate.is-revealed .estimate-figure {
	animation: toa-ppc-pop .7s cubic-bezier(.2, .9, .3, 1.3) both;
}

@keyframes toa-ppc-pop {
	0%   { transform: scale(.94); }
	60%  { transform: scale(1.03); }
	100% { transform: scale(1); }
}

/* Actions */
.toa-ppc .toa-ppc-action .button {
	width: 100%;
}

.toa-ppc .toa-ppc-hint {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 12px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--ppc-muted);
}

.toa-ppc .toa-ppc-back {
	margin-top: 10px;
	margin-left: -10px;
}

.toa-ppc .toa-ppc-submit.is-loading {
	pointer-events: none;
	opacity: .85;
}

.toa-ppc .toa-ppc-submit.is-loading svg {
	animation: toa-ppc-spin 1s linear infinite;
}

@keyframes toa-ppc-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.toa-ppc *,
	.toa-ppc *::before,
	.toa-ppc *::after {
		animation: none !important;
		transition: none !important;
	}
}

/* ------------------------------------------------------------------ */
/* 2. Themed card                                                      */
/* ------------------------------------------------------------------ */

.toa-ppc.toa-ppc--themed {
	width: 100%;
	max-width: var(--ppc-max);
	margin: 0 auto;
	padding: var(--ppc-pad);
	border: var(--ppc-border-width) solid var(--ppc-card-border);
	border-radius: var(--ppc-radius);
	background: var(--ppc-card);
	box-shadow: var(--ppc-shadow);
	color: var(--ppc-text);
	font-family: var(--ppc-font);
	font-size: var(--ppc-size);
	line-height: 1.45;
	text-align: left;
}

.toa-ppc--themed .calculator-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.toa-ppc--themed .calculator-top > span {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 600;
	color: var(--ppc-text);
}

.toa-ppc--themed .calculator-top > span svg {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

.toa-ppc--themed select {
	appearance: none;
	-webkit-appearance: none;
	height: 38px;
	margin: 0;
	padding: 0 34px 0 12px;
	border: 0;
	border-radius: var(--ppc-control-radius);
	background-color: var(--ppc-field);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23132820' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 14px;
	color: var(--ppc-field-text);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 38px;
	cursor: pointer;
	box-shadow: none;
}

.toa-ppc--themed select:focus-visible {
	outline: 2px solid var(--ppc-accent);
	outline-offset: 2px;
}

.toa-ppc--themed .calculator-top select {
	min-width: 68px;
}

/* Frequency toggle */
.toa-ppc--themed .calc-frequency {
	display: grid;
	grid-auto-columns: 1fr;
	grid-auto-flow: column;
	gap: 4px;
	padding: 4px;
	border-radius: var(--ppc-toggle-radius);
	background: var(--ppc-track);
}

.toa-ppc.toa-ppc--themed .calc-frequency button {
	appearance: none;
	min-height: 44px;
	margin: 0;
	padding: 8px 10px;
	border: 0;
	border-radius: calc(var(--ppc-toggle-radius) - 2px);
	background: transparent;
	color: var(--ppc-track-text);
	font: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: none;
	transition: background .2s ease, color .2s ease;
}

.toa-ppc.toa-ppc--themed .calc-frequency button:focus {
	background: transparent;
	color: var(--ppc-track-text);
	border: 0;
	outline: none;
}

.toa-ppc.toa-ppc--themed .calc-frequency button:hover {
	background: rgba(255, 255, 255, .08);
	color: var(--ppc-track-text);
	border: 0;
}

.toa-ppc.toa-ppc--themed .calc-frequency button.active,
.toa-ppc.toa-ppc--themed .calc-frequency button.active:hover,
.toa-ppc.toa-ppc--themed .calc-frequency button.active:focus {
	background: var(--ppc-accent);
	color: var(--ppc-accent-text);
}

.toa-ppc.toa-ppc--themed .calc-frequency button:focus-visible {
	outline: 2px solid var(--ppc-accent);
	outline-offset: 2px;
}

/* Employees */
.toa-ppc--themed .employee-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 26px;
}

.toa-ppc--themed .employee-row label {
	margin: 0;
	font-size: 15px;
	font-weight: 500;
	color: var(--ppc-text);
}

.toa-ppc--themed .employee-row select {
	min-width: 104px;
}

/* Range slider */
.toa-ppc--themed input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 22px;
	margin: 26px 0 8px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	--ppc-fill: 0%;
}

.toa-ppc--themed input[type="range"]::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(to right, var(--ppc-slider) 0, var(--ppc-slider) 100%);
}

.toa-ppc--themed input[type="range"]::-moz-range-track {
	height: 6px;
	border-radius: 999px;
	background: var(--ppc-slider);
}

.toa-ppc--themed input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	margin-top: -7px;
	border: 0;
	border-radius: 50%;
	background: var(--ppc-accent);
	box-shadow: 0 2px 6px rgba(10, 18, 60, .3);
	transition: transform .15s ease;
}

.toa-ppc--themed input[type="range"]::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border: 0;
	border-radius: 50%;
	background: var(--ppc-accent);
	box-shadow: 0 2px 6px rgba(10, 18, 60, .3);
}

.toa-ppc--themed input[type="range"]:active::-webkit-slider-thumb {
	transform: scale(1.15);
}

.toa-ppc--themed input[type="range"]:focus {
	outline: none;
}

.toa-ppc--themed input[type="range"]:focus-visible::-webkit-slider-thumb {
	box-shadow: 0 0 0 4px rgba(215, 242, 141, .45);
}

.toa-ppc--themed .range-labels {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 14px;
	color: var(--ppc-text);
}

/* Estimate */
.toa-ppc--themed .estimate {
	display: block;
	margin-top: 26px;
	padding: 28px 0 0;
	border-top: 1px solid var(--ppc-line);
	background: var(--ppc-estimate-bg);
}

.toa-ppc--themed .estimate > .estimate-label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ppc-text);
}

.toa-ppc--themed .estimate-figure {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0 6px;
	margin: 12px 0 14px;
}

.toa-ppc--themed .estimate-figure strong {
	font-size: var(--ppc-price-size);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -.02em;
	color: var(--ppc-price);
	font-variant-numeric: tabular-nums;
}

.toa-ppc--themed .estimate-figure span {
	font-size: 13px;
	color: var(--ppc-text);
}

.toa-ppc--themed .estimate small {
	display: block;
	font-size: 14px;
	color: var(--ppc-text);
}

.toa-ppc--themed .estimate .toa-ppc-secondary {
	margin: -4px 0 8px;
	color: var(--ppc-muted);
}

/* Buttons */
.toa-ppc--themed .toa-ppc-actions {
	margin-top: 26px;
}

.toa-ppc.toa-ppc--themed .button,
.toa-ppc.toa-ppc--themed a.button {
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 58px;
	margin: 0;
	padding: 14px 26px;
	border: 0;
	border-radius: var(--ppc-button-radius);
	background: var(--ppc-btn);
	color: var(--ppc-btn-text);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: none;
	transition: background .2s ease, transform .2s ease;
}

.toa-ppc.toa-ppc--themed .button:hover,
.toa-ppc.toa-ppc--themed .button:focus,
.toa-ppc.toa-ppc--themed .button:active {
	background: var(--ppc-btn-hover);
	color: var(--ppc-btn-text);
	border: 0;
	text-decoration: none;
	box-shadow: none;
}

.toa-ppc.toa-ppc--themed .button:focus-visible {
	outline: 2px solid var(--ppc-text);
	outline-offset: 3px;
}

.toa-ppc.toa-ppc--themed .button svg {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	transition: transform .2s ease;
}

.toa-ppc.toa-ppc--themed .button:hover svg {
	transform: translateX(3px);
}

.toa-ppc--themed .calc-note {
	margin: 24px 0 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--ppc-text);
}

/* ------------------------------------------------------------------ */
/* Narrow layouts                                                      */
/* ------------------------------------------------------------------ */

@container (max-width: 520px) {
	.toa-ppc .toa-ppc-fields {
		grid-template-columns: 1fr;
	}
	.toa-ppc .toa-ppc-steps li + li::before {
		width: 12px;
	}
	.toa-ppc .toa-ppc-step-name {
		font-size: 12px;
	}
	.toa-ppc--themed .estimate-figure strong {
		font-size: calc(var(--ppc-price-size) * .72);
	}
	.toa-ppc.toa-ppc--themed .calc-frequency button {
		font-size: 14px;
		padding: 8px 4px;
	}
	.toa-ppc.toa-ppc--themed .button,
	.toa-ppc.toa-ppc--themed a.button {
		padding: 14px 22px;
	}
	.toa-ppc .toa-ppc-title {
		font-size: 19px;
	}
	.toa-ppc .toa-ppc-lock {
		padding-right: 14px;
	}
	.toa-ppc .toa-ppc-lock-copy strong {
		font-size: 14px;
	}
}

@container (max-width: 440px) {
	.toa-ppc .toa-ppc-lock {
		gap: 10px;
		padding: 8px 16px 8px 8px;
	}
	.toa-ppc .toa-ppc-lock-icon {
		width: 34px;
		height: 34px;
	}
	.toa-ppc .toa-ppc-lock-copy strong {
		font-size: 14px;
	}
	.toa-ppc .toa-ppc-lock-copy span {
		display: none;
	}
}

@container (max-width: 380px) {
	.toa-ppc .toa-ppc-steps li:not(.is-active) .toa-ppc-step-name {
		display: none;
	}
}

@media (max-width: 600px) {
	.toa-ppc.toa-ppc--themed {
		padding: min(var(--ppc-pad), 22px);
	}
}
