/**
 * W-2 vs 1099 Comparison Calculator — module styles.
 *
 * Inherits the shared design tokens (--bf-primary, --bf-accent, --bf-ink,
 * --bf-muted, --bf-border, --bf-bg-soft, --bf-radius, --bf-shadow) from
 * assets/css/frontend.css. Everything is scoped to .w2c so nothing leaks into
 * the host theme. Mobile-first: inputs and result cards stack on phones and
 * split into two columns at ≥720px. A print block renders a clean summary.
 */

.w2c {
	--w2c-w2: var(--bf-primary, #4f46e5);
	--w2c-1099: var(--bf-accent, #0ea5e9);
	--w2c-pos: #16a34a;
	--w2c-neg: #e11d48;
	color: var(--bf-ink, #0f172a);
	font-size: 16px;
	line-height: 1.55;
}

.w2c *,
.w2c *::before,
.w2c *::after {
	box-sizing: border-box;
}

/* ------------------------------------------------------------- controls */

.w2c__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 18px 28px;
	align-items: flex-end;
	margin-bottom: 20px;
}
.w2c__control-label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: var(--bf-muted, #64748b);
	margin-bottom: 8px;
}

/* Segmented toggles. */
.w2c__toggle {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 4px;
	border-radius: 12px;
	background: var(--bf-bg-soft, #f8fafc);
	border: 1px solid var(--bf-border, #e5e7eb);
}
.w2c__toggle--sm { padding: 3px; }
.w2c__toggle-btn {
	font: inherit;
	font-weight: 700;
	font-size: 14px;
	padding: 9px 16px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--bf-muted, #64748b);
	cursor: pointer;
	transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.w2c__toggle--sm .w2c__toggle-btn { padding: 7px 12px; font-size: 13px; }
.w2c__toggle-btn:hover { color: var(--bf-ink, #0f172a); }
.w2c__toggle-btn.is-active {
	background: #fff;
	color: var(--bf-primary, #4f46e5);
	box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
.w2c__toggle-btn:focus-visible { outline: 2px solid var(--bf-primary, #4f46e5); outline-offset: 1px; }

/* -------------------------------------------------------------- inputs */

.w2c__inputs {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin: 0;
}
@media (min-width: 720px) {
	.w2c__inputs { grid-template-columns: 1fr 1fr; }
}

.w2c__card {
	border: 1px solid var(--bf-border, #e5e7eb);
	border-radius: var(--bf-radius, 16px);
	background: #fff;
	padding: 20px 22px 24px;
	margin: 0;
	min-width: 0;
}
.w2c__card--w2 { border-top: 4px solid var(--w2c-w2); }
.w2c__card--c1099 { border-top: 4px solid var(--w2c-1099); }

.w2c__card-legend {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-weight: 800;
	font-size: 16px;
	padding: 0;
}
.w2c__card-badge {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .03em;
	color: #fff;
	padding: 3px 8px;
	border-radius: 6px;
}
.w2c__card-badge--w2 { background: var(--w2c-w2); }
.w2c__card-badge--c1099 { background: var(--w2c-1099); }
.w2c__card-hint {
	flex-basis: 100%;
	font-weight: 500;
	font-size: 12.5px;
	color: #94a3b8;
}

.w2c__field { margin-top: 16px; }
.w2c__field--split {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 12px;
}
.w2c__field--check { margin-top: 18px; }

.w2c__label {
	display: block;
	font-weight: 700;
	font-size: 13.5px;
	margin-bottom: 7px;
	color: var(--bf-ink, #0f172a);
}

.w2c__money,
.w2c__suffix {
	display: flex;
	align-items: center;
	border: 1px solid var(--bf-border, #e5e7eb);
	border-radius: 11px;
	background: var(--bf-bg-soft, #f8fafc);
	overflow: hidden;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.w2c__money:focus-within,
.w2c__suffix:focus-within {
	border-color: var(--bf-primary, #4f46e5);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--bf-primary, #4f46e5) 18%, transparent);
	background: #fff;
}
.w2c__sym,
.w2c__unit {
	flex: 0 0 auto;
	padding: 0 11px;
	font-weight: 700;
	color: var(--bf-muted, #64748b);
	font-size: 14px;
}
.w2c__sym { border-right: 1px solid var(--bf-border, #e5e7eb); }
.w2c__unit { border-left: 1px solid var(--bf-border, #e5e7eb); }
.w2c__money input,
.w2c__suffix input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	border: 0;
	background: transparent;
	padding: 11px 13px;
	font: inherit;
	font-weight: 700;
	font-size: 16px;
	color: var(--bf-ink, #0f172a);
	-moz-appearance: textfield;
}
.w2c__money input:focus,
.w2c__suffix input:focus { outline: none; }
.w2c__money input::-webkit-outer-spin-button,
.w2c__money input::-webkit-inner-spin-button,
.w2c__suffix input::-webkit-outer-spin-button,
.w2c__suffix input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.w2c__check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--bf-ink, #0f172a);
	cursor: pointer;
	line-height: 1.4;
}
.w2c__check input {
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--bf-primary, #4f46e5);
	flex: 0 0 auto;
}

/* -------------------------------------------------------------- actions */

.w2c__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 18px 0 24px;
}

/* ------------------------------------------------------------- headline */

.w2c__headline {
	text-align: center;
	padding: 24px;
	border-radius: var(--bf-radius, 16px);
	background: linear-gradient(135deg, color-mix(in srgb, var(--w2c-w2) 10%, #fff), color-mix(in srgb, var(--w2c-1099) 10%, #fff));
	border: 1px solid var(--bf-border, #e5e7eb);
	margin-bottom: 18px;
}
.w2c__headline-label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--bf-muted, #64748b);
}
.w2c__headline-value {
	display: block;
	margin: 6px 0 2px;
	font-size: clamp(34px, 7vw, 52px);
	font-weight: 800;
	line-height: 1.02;
	letter-spacing: -.02em;
	color: var(--bf-ink, #0f172a);
}
.w2c__headline-note {
	display: block;
	font-size: 14.5px;
	color: var(--bf-muted, #64748b);
}

/* -------------------------------------------------------------- results */

.w2c__results {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}
@media (min-width: 720px) {
	.w2c__results { grid-template-columns: 1fr 1fr; }
}

.w2c__result {
	border: 1px solid var(--bf-border, #e5e7eb);
	border-radius: var(--bf-radius, 16px);
	background: #fff;
	box-shadow: var(--bf-shadow, 0 10px 40px rgba(15, 23, 42, .08));
	padding: 20px 22px;
	min-width: 0;
}
.w2c__result--w2 { border-top: 4px solid var(--w2c-w2); }
.w2c__result--c1099 { border-top: 4px solid var(--w2c-1099); }

.w2c__result-title {
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 800;
	color: var(--bf-ink, #0f172a);
}

.w2c__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 9px 0;
	border-bottom: 1px dashed var(--bf-border, #e5e7eb);
	font-size: 14.5px;
}
.w2c__row:last-child { border-bottom: 0; }
.w2c__row-label { color: var(--bf-muted, #64748b); }
.w2c__row-value {
	font-weight: 700;
	white-space: nowrap;
	color: var(--bf-ink, #0f172a);
	font-variant-numeric: tabular-nums;
}
.w2c__row--sub .w2c__row-value { color: var(--w2c-neg); }
.w2c__row--add .w2c__row-value { color: var(--w2c-pos); }
.w2c__row--muted .w2c__row-label,
.w2c__row--muted .w2c__row-value { color: #94a3b8; font-weight: 600; }
.w2c__row--total {
	margin-top: 4px;
	padding-top: 12px;
	border-top: 2px solid var(--bf-border, #e5e7eb);
	border-bottom: 0;
}
.w2c__row--total .w2c__row-label { color: var(--bf-ink, #0f172a); font-weight: 800; }
.w2c__row--total .w2c__row-value { font-size: 18px; font-weight: 800; }

/* -------------------------------------------------------------- verdict */

.w2c__verdict {
	margin: 16px 0 0;
	padding: 14px 16px;
	border-radius: 12px;
	font-weight: 700;
	font-size: 15px;
	text-align: center;
}
.w2c__verdict:empty { display: none; }
.w2c__verdict--good {
	background: color-mix(in srgb, var(--w2c-pos) 12%, #fff);
	color: #15803d;
	border: 1px solid color-mix(in srgb, var(--w2c-pos) 30%, #fff);
}
.w2c__verdict--warn {
	background: color-mix(in srgb, var(--w2c-neg) 10%, #fff);
	color: #be123c;
	border: 1px solid color-mix(in srgb, var(--w2c-neg) 28%, #fff);
}

.w2c__disclaimer {
	margin-top: 18px;
	font-size: 12.5px;
	line-height: 1.5;
}

/* ---------------------------------------------------------------- print */

@media print {
	.w2c__controls,
	.w2c__inputs,
	.w2c__actions {
		display: none !important;
	}
	.w2c__results { grid-template-columns: 1fr 1fr; gap: 12px; }
	.w2c__result { box-shadow: none; break-inside: avoid; }
	.w2c__headline { background: #fff; }
	.w2c { color: #000; font-size: 11pt; }
	.w2c__verdict { border: 1px solid #999; }
}
