/* Techspirit Site Tools — component styles for the plugin's own markup.
 * The design system (tokens + layout) lives in the child theme; literal
 * fallbacks are provided so output stays legible if the theme is swapped.
 * Red usage follows the system rule: buttons + small accents only.
 */

/* ---------------- Project / testimonial cards ---------------- */
.ts-card--project {
	padding: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.ts-card__media {
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: 0;
}
.ts-card__media .ts-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.ts-card__img--empty {
	display: block;
	width: 100%;
	height: 100%;
	background:
		radial-gradient(300px 160px at 30% 20%, rgba(100, 126, 170, 0.35), transparent 70%),
		var(--ts-dark, #051023);
}
.ts-card__body {
	padding: 20px 22px 24px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}
.ts-card__body .ts-eyebrow { margin-bottom: 0.35em; }
.ts-card__title {
	font-size: 1.15rem;
	margin: 0 0 6px;
}
.ts-card__title a {
	color: inherit;
	text-decoration: none;
}
.ts-card__title a:hover { color: var(--ts-navy, #11387D); }

.ts-arrow-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--ts-navy, #11387D);
	text-decoration: none;
}
.ts-arrow-link span { transition: transform 0.2s ease; }
.ts-arrow-link:hover span { transform: translateX(4px); }

.ts-card--quote {
	margin: 0;
	display: flex;
	flex-direction: column;
}
.ts-card--quote blockquote {
	margin: 0 0 16px;
	padding: 0;
	border: 0;
}
.ts-card--quote blockquote p {
	font-size: 1.05rem;
	line-height: 1.65;
	margin: 0;
}
.ts-card--quote figcaption {
	margin-top: auto;
	display: grid;
	gap: 3px;
	font-size: 0.92rem;
}
.ts-card--quote .ts-card__meta { color: var(--ts-text-muted, #5B6470); }
.ts-card--quote .ts-arrow-link { margin-top: 10px; }

/* ---------------- FAQ accordion ---------------- */
.ts-faq {
	border: 1px solid var(--ts-line, #E2E6EB);
	border-radius: var(--ts-radius, 14px);
	background: #fff;
	overflow: hidden;
}
.ts-faq__item + .ts-faq__item { border-top: 1px solid var(--ts-line, #E2E6EB); }
.ts-faq__q { margin: 0; font-size: 1rem; }
.ts-faq__toggle {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 22px;
	border: 0;
	background: none;
	font: inherit;
	font-weight: 700;
	color: var(--ts-text, #14181F);
	text-align: left;
	cursor: pointer;
}
.ts-faq__toggle:hover { color: var(--ts-navy, #11387D); }
.ts-faq__icon { flex: none; transition: transform 0.2s ease; }
.ts-faq__toggle[aria-expanded="true"] .ts-faq__icon { transform: rotate(180deg); }
.ts-faq__panel { padding: 0 22px 20px; }
.ts-faq__panel > :last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) {
	.ts-faq__icon, .ts-arrow-link span { transition: none; }
}

/* ---------------- Breadcrumbs / video (v1 compat) ---------------- */
.ts-crumbs { font-size: 0.86rem; margin: 0 0 12px; }
.ts-crumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.ts-crumbs li { max-width: none; margin: 0; color: var(--ts-text-muted, #5B6470); }
.ts-crumbs li + li::before { content: "›"; margin: 0 6px 0 2px; }
.ts-crumbs a { color: var(--ts-text-muted, #5B6470); text-decoration: none; }
.ts-crumbs a:hover { color: var(--ts-navy, #11387D); text-decoration: underline; }

.ts-video__frame {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--ts-radius, 14px);
	overflow: hidden;
	background: var(--ts-muted, #EDF0F4);
}
.ts-video__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}
.ts-video video { width: 100%; border-radius: var(--ts-radius, 14px); }
.ts-video figcaption {
	font-size: 0.88rem;
	color: var(--ts-text-muted, #5B6470);
	margin-top: 8px;
}

/* ---------------- Quote form ---------------- */
.ts-qf {
	background: #fff;
	border: 1px solid var(--ts-line, #E2E6EB);
	border-radius: var(--ts-radius, 14px);
	padding: clamp(22px, 4vw, 36px);
	max-width: 760px;
}
.ts-section--dark .ts-qf { border-color: transparent; }

.ts-qf fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}
.ts-qf__legend {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ts-text-muted, #5B6470);
	padding: 0;
	margin-bottom: 18px;
}
.ts-qf__step--2 { margin-top: 8px; }

.ts-qf__row {
	display: grid;
	gap: 14px;
	grid-template-columns: 1fr;
}
@media (min-width: 620px) {
	.ts-qf__row { grid-template-columns: 1fr 1fr; }
}
.ts-qf__field { margin-bottom: 14px; }
.ts-qf__field label {
	display: block;
	font-size: 0.92rem;
	font-weight: 700;
	margin-bottom: 6px;
}
.ts-qf__field input,
.ts-qf__field select,
.ts-qf__field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--ts-line, #E2E6EB);
	border-radius: 10px;
	background: #fff;
	color: var(--ts-text, #14181F);
	font: inherit;
	font-size: 1rem;
}
.ts-qf__field input:focus-visible,
.ts-qf__field select:focus-visible,
.ts-qf__field textarea:focus-visible {
	outline: 2px solid var(--ts-navy, #11387D);
	outline-offset: 1px;
	border-color: var(--ts-navy, #11387D);
}
.ts-qf__field.has-error input,
.ts-qf__field.has-error select,
.ts-qf__field.has-error textarea {
	border-color: var(--ts-red, #EC282D); /* small accent — allowed red use */
}
.ts-qf__req { color: var(--ts-red, #EC282D); font-size: 1.1em; } /* small accent */
.ts-qf__note {
	font-size: 0.85rem;
	color: var(--ts-text-muted, #5B6470);
	margin: -4px 0 14px;
}

/* Residential / Commercial big buttons */
.ts-qf__lanes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 18px;
}
.ts-qf__lane input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.ts-qf__lane-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	padding: 16px 18px;
	border: 1.5px solid var(--ts-line, #E2E6EB);
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
	height: 100%;
}
.ts-qf__lane-card svg { color: var(--ts-navy, #11387D); margin-bottom: 4px; }
.ts-qf__lane-card b { font-size: 1.02rem; }
.ts-qf__lane-card small { color: var(--ts-text-muted, #5B6470); }
.ts-qf__lane input:checked + .ts-qf__lane-card {
	border-color: var(--ts-navy, #11387D);
	background: var(--ts-light, #F7F8FA);
	box-shadow: inset 0 0 0 1px var(--ts-navy, #11387D);
}
.ts-qf__lane input:focus-visible + .ts-qf__lane-card {
	outline: 2px solid var(--ts-navy, #11387D);
	outline-offset: 2px;
}
.ts-qf__lane.has-error .ts-qf__lane-card { border-color: var(--ts-red, #EC282D); }

.ts-qf__consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 0.92rem;
	margin: 4px 0 16px;
	cursor: pointer;
}
.ts-qf__consent input { margin-top: 3px; }

.ts-qf__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ts-qf__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin-top: 6px;
}
.ts-qf__phone {
	font-weight: 700;
	color: var(--ts-navy, #11387D);
	text-decoration: none;
	white-space: nowrap;
}
.ts-qf__phone:hover { text-decoration: underline; }
.ts-qf__next, .ts-qf__back { margin-top: 4px; }

/* JS step machine (expanded forms only) */
.ts-qf[data-qf-state="1"] .ts-qf__step--2,
.ts-qf[data-qf-state="1"] .ts-qf__actions { display: none; }
.ts-qf[data-qf-state="2"] .ts-qf__step--1 { display: none; }

/* Messages + success panel */
.ts-qf__msg,
.ts-qf__notice {
	padding: 14px 18px;
	border-radius: 10px;
	margin-bottom: 18px;
	font-weight: 600;
}
.ts-qf__msg--ok, .ts-qf__notice--ok { background: #eef7f0; color: #1e5b32; }
.ts-qf__msg--err, .ts-qf__notice--err { background: #fdeeee; color: #8a1a1e; }

.ts-qf.is-done .ts-qf__step,
.ts-qf.is-done .ts-qf__actions,
.ts-qf.is-done .ts-qf__note { display: none; }
.ts-qf__success h3 { margin-bottom: 14px; }
.ts-qf__steps {
	list-style: none;
	counter-reset: ts-step;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 12px;
}
.ts-qf__steps li {
	counter-increment: ts-step;
	position: relative;
	padding-left: 44px;
	max-width: none;
}
.ts-qf__steps li::before {
	content: counter(ts-step);
	position: absolute;
	left: 0;
	top: 0;
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--ts-navy, #11387D);
	color: #fff;
	font-weight: 700;
	font-size: 0.9rem;
}

/* Submitting state */
.ts-qf.is-submitting .ts-qf__submit {
	opacity: 0.6;
	pointer-events: none;
}
.ts-qf.is-submitting .ts-qf__submit::after {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-left: 0.5em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	vertical-align: -0.15em;
	animation: ts-spin 0.7s linear infinite;
}
@keyframes ts-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.ts-qf.is-submitting .ts-qf__submit::after { animation: none; }
}
