/* TT Audit front end. Everything is scoped to .tt-audit. Colors come from the plugin settings
   (inline custom properties); the :where() defaults only apply if those are missing. */

:where(.tt-audit) {
	--tta-bg: #ffffff;
	--tta-text: #0f172a;
	--tta-accent: #1d4ed8;
	--tta-btn-text: #ffffff;
	--tta-border: #e2e8f0;
	--tta-soft: #eef2f6;
	--tta-radius: 16px;
	--tta-panel: #0b1f3a;
	--tta-panel2: #1d4ed8;
	--tta-panel-text: #ffffff;
}

.tt-audit {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--tta-maxw, 100%);
	margin: 1.5em 0;
	color: var(--tta-text);
	font-size: 16px;
	line-height: 1.55;
}

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

.tt-audit--align-center {
	margin-left: auto;
	margin-right: auto;
}

.tt-audit--align-right {
	margin-left: auto;
	margin-right: 0;
}

.tt-audit__card {
	background: var(--tta-bg);
	border: 1px solid var(--tta-border);
	border-top: 4px solid var(--tta-accent);
	border-radius: var(--tta-radius);
	padding: 28px;
	box-shadow: 0 8px 28px rgba(11, 31, 58, 0.08);
}

.tt-audit [hidden] {
	display: none !important;
}

.tt-audit__title {
	margin: 0 0 8px;
	padding: 0;
	font-size: 1.5rem;
	line-height: 1.25;
	color: var(--tta-text);
	outline: none;
}

.tt-audit__title--q {
	font-size: 1.2rem;
	float: none;
	width: 100%;
}

.tt-audit__title:focus-visible {
	outline: 2px solid var(--tta-accent);
	outline-offset: 4px;
	border-radius: 4px;
}

.tt-audit__sub {
	margin: 0 0 18px;
	opacity: 0.85;
}

.tt-audit__site {
	display: inline-block;
	margin: 0 0 16px;
	padding: 4px 12px;
	background: var(--tta-soft);
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.9rem;
	word-break: break-all;
}

.tt-audit__site:empty {
	display: none;
}

/* Fields */
.tt-audit__field {
	margin: 0 0 16px;
	padding: 0;
	border: 0;
}

.tt-audit__field label,
.tt-audit__field legend {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	font-weight: 600;
	font-size: 0.95rem;
}

.tt-audit input[type="text"],
.tt-audit input[type="email"],
.tt-audit select,
.tt-audit textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 12px 14px;
	font: inherit;
	font-size: 1rem;
	color: var(--tta-text);
	background: #fff;
	border: 1px solid #94a3b8;
	border-radius: calc(var(--tta-radius) * 0.6);
	box-shadow: none;
}

.tt-audit textarea {
	resize: vertical;
	min-height: 96px;
}

.tt-audit input:focus-visible,
.tt-audit select:focus-visible,
.tt-audit textarea:focus-visible,
.tt-audit button:focus-visible,
.tt-audit a:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--tta-accent) 45%, transparent);
	outline-offset: 2px;
}

.tt-audit__field--group {
	margin-bottom: 16px;
}

.tt-audit__check {
	display: flex !important;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 8px !important;
	font-weight: 400 !important;
	font-size: 0.95rem !important;
	line-height: 1.45;
	cursor: pointer;
}

.tt-audit__check input[type="checkbox"] {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--tta-accent);
}

.tt-audit__check a {
	color: var(--tta-accent);
}

.tt-audit__err {
	margin: 6px 0 0;
	font-size: 0.9rem;
	font-weight: 600;
	color: #b42318;
}

/* Honeypot: off screen, not display:none, so simple bots still fill it. */
.tt-audit__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Buttons */
.tt-audit__row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.tt-audit__btn {
	display: inline-block;
	margin: 0;
	padding: 13px 24px;
	font: inherit;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.2;
	color: var(--tta-btn-text);
	background: var(--tta-accent);
	border: 2px solid var(--tta-accent);
	border-radius: calc(var(--tta-radius) * 0.7);
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.15s ease;
}

.tt-audit__btn:hover {
	filter: brightness(1.1);
}

.tt-audit__btn:disabled {
	opacity: 0.6;
	cursor: wait;
}

.tt-audit__btn--ghost {
	color: var(--tta-accent);
	background: transparent;
}

/* Quiz */
.tt-audit__progress {
	margin: 0 0 8px;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tta-accent);
}

.tt-audit__bar {
	height: 6px;
	margin: 0 0 16px;
	background: var(--tta-soft);
	border-radius: 999px;
	overflow: hidden;
}

.tt-audit__bar span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--tta-accent);
	border-radius: 999px;
	transition: width 0.25s ease;
}

.tt-audit__q {
	margin: 0 0 12px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.tt-audit__help {
	margin: 0 0 12px;
	font-size: 0.93rem;
	opacity: 0.8;
}

.tt-audit__options {
	display: grid;
	gap: 10px;
}

.tt-audit__option {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	padding: 13px 14px;
	background: #fff;
	border: 2px solid var(--tta-border);
	border-radius: calc(var(--tta-radius) * 0.7);
	cursor: pointer;
	font-weight: 500;
}

.tt-audit__option:hover {
	border-color: var(--tta-accent);
}

.tt-audit__option:has(input:checked) {
	border-color: var(--tta-accent);
	background: var(--tta-soft);
}

.tt-audit__option input[type="radio"] {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--tta-accent);
}

/* Results */
.tt-audit__areas-title {
	margin: 18px 0 10px;
	font-size: 1.05rem;
}

.tt-audit__areas {
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 10px;
}

.tt-audit__areas li {
	margin: 0;
	padding: 14px 16px;
	background: var(--tta-soft);
	border-left: 4px solid var(--tta-accent);
	border-radius: 8px;
}

.tt-audit__areas p {
	margin: 4px 0 6px;
	font-size: 0.95rem;
}

.tt-audit__areas a {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--tta-accent);
	word-break: break-word;
}

.tt-audit__expect {
	margin: 4px 0 16px;
	padding: 14px 16px;
	background: var(--tta-soft);
	border-left: 4px solid var(--tta-accent);
	border-radius: calc(var(--tta-radius) * 0.6);
}

.tt-audit__expect-title {
	margin: 0 0 6px;
	font-weight: 700;
}

.tt-audit__expect ul {
	margin: 0;
	padding-left: 18px;
	font-size: 0.92rem;
}

.tt-audit__expect li {
	margin: 3px 0;
}

.tt-audit__bridge {
	margin-top: 18px;
	padding: 18px;
	background: var(--tta-soft);
	border-radius: calc(var(--tta-radius) * 0.8);
}

.tt-audit__bridge-text {
	margin: 0 0 12px;
	font-weight: 600;
}

.tt-audit__after {
	margin: 18px 0 0;
	font-size: 0.92rem;
	opacity: 0.85;
}

/* Fine print */
.tt-audit__disc {
	margin: 22px 0 0;
	padding-top: 14px;
	border-top: 1px solid var(--tta-border);
	font-size: 0.8rem;
	line-height: 1.5;
	opacity: 0.75;
}

.tt-audit__noscript {
	margin: 0 0 12px;
	padding: 10px 12px;
	background: #fef3c7;
	border-radius: 8px;
	font-size: 0.9rem;
}

@media (max-width: 520px) {
	.tt-audit__card {
		padding: 20px 16px;
	}

	.tt-audit__row .tt-audit__btn {
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tt-audit__bar span,
	.tt-audit__btn {
		transition: none;
	}
}

/* ------------------------------------------------------------------
   Stepper (top of the card)
   ------------------------------------------------------------------ */
.tt-audit__stepper {
	display: flex;
	align-items: center;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}

.tt-audit__stepper-item {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	margin: 0;
	padding: 0;
	font-size: 0.8rem;
	font-weight: 600;
	color: #64748b;
}

.tt-audit__stepper-item:last-child {
	flex: 0 0 auto;
}

.tt-audit__stepper-item:not(:last-child)::after {
	content: "";
	flex: 1 1 auto;
	min-width: 12px;
	height: 2px;
	margin: 0 10px;
	background: var(--tta-border);
	border-radius: 2px;
	transition: background 0.3s ease;
}

.tt-audit__stepper-dot {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin-right: 8px;
	font-size: 0.78rem;
	font-weight: 700;
	color: #64748b;
	background: var(--tta-soft);
	border: 2px solid var(--tta-border);
	border-radius: 50%;
	transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.tt-audit__stepper-item.is-current {
	color: var(--tta-text);
}

.tt-audit__stepper-item.is-current .tt-audit__stepper-dot {
	color: var(--tta-btn-text);
	background: var(--tta-accent);
	border-color: var(--tta-accent);
	transform: scale(1.1);
}

.tt-audit__stepper-item.is-done {
	color: var(--tta-text);
}

.tt-audit__stepper-item.is-done .tt-audit__stepper-dot {
	color: var(--tta-accent);
	background: #fff;
	border-color: var(--tta-accent);
}

.tt-audit__stepper-item.is-done:not(:last-child)::after {
	background: var(--tta-accent);
}

/* ------------------------------------------------------------------
   Layout: form on the left, companion panel on the right
   ------------------------------------------------------------------ */
.tt-audit__layout {
	display: block;
}

.tt-audit__main {
	min-width: 0;
}

.tt-audit--split .tt-audit__main {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.tt-audit--split .tt-audit__layout {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 32px;
	align-items: stretch;
}

.tt-audit__side {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	padding: 28px;
	color: var(--tta-panel-text);
	background: radial-gradient(circle at 25% 15%, rgba(56, 189, 248, 0.22), transparent 55%), linear-gradient(145deg, var(--tta-panel), var(--tta-panel2));
	border-radius: calc(var(--tta-radius) * 0.9);
}

.tt-audit__panel {
	animation: tta-in 0.4s ease both;
}

.tt-audit__panel-art {
	margin: 0 0 6px;
	text-align: center;
}

.tt-audit__art {
	display: inline-block;
	width: 170px;
	max-width: 100%;
	height: auto;
	animation: tta-float 6s ease-in-out infinite;
}

.tt-audit__art .a-fill { fill: rgba(255, 255, 255, 0.1); }
.tt-audit__art .a-line { fill: none; stroke: #38bdf8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tt-audit__art .a-dot { fill: #38bdf8; }
.tt-audit__art .a-dot--big { fill: #fff; }
.tt-audit__art .a-bar { fill: rgba(255, 255, 255, 0.38); }
.tt-audit__art .a-box { fill: none; stroke: #38bdf8; stroke-width: 2; }
.tt-audit__art .a-ring { fill: none; stroke: #38bdf8; stroke-width: 2; }
.tt-audit__art .a-tick { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tt-audit__art .a-tick--dark { stroke: #0b1f3a; }
.tt-audit__art .a-badge { fill: #38bdf8; }

.tt-audit__panel-title {
	margin: 14px 0 12px;
	font-size: 1.25rem;
	line-height: 1.3;
	color: var(--tta-panel-text);
}

.tt-audit__panel-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tt-audit__panel-list li {
	position: relative;
	margin: 0 0 10px;
	padding: 0 0 0 28px;
	font-size: 0.97rem;
	line-height: 1.5;
	color: var(--tta-panel-text);
}

.tt-audit__panel-list li::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 0.4em;
	width: 12px;
	height: 6px;
	border-left: 2px solid #38bdf8;
	border-bottom: 2px solid #38bdf8;
	transform: rotate(-45deg);
}

.tt-audit__tip {
	margin: 4px 0 0;
	padding: 14px 16px;
	background: rgba(255, 255, 255, 0.1);
	border-left: 3px solid #38bdf8;
	border-radius: 0 12px 12px 0;
}

.tt-audit__tip.is-new {
	animation: tta-in 0.4s ease both;
}

.tt-audit__tip-text {
	margin: 0 0 8px;
	font-size: 0.97rem;
	line-height: 1.55;
	color: var(--tta-panel-text);
}

.tt-audit__tip-src {
	font-size: 0.82rem;
	font-weight: 600;
	color: #7dd3fc;
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}

.tt-audit__panel-brand {
	margin: 14px 0 0;
	padding-top: 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--tta-panel-text);
	opacity: 0.9;
}

@keyframes tta-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@keyframes tta-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-5px); }
}

/* Small screens: the panel steps aside, the stepper stays. */
@media (max-width: 820px) {
	.tt-audit--split .tt-audit__layout {
		display: block;
	}

	.tt-audit__side {
		display: none;
	}
}

@media (max-width: 560px) {
	.tt-audit__stepper-label {
		display: none;
	}

	.tt-audit__stepper-item.is-current .tt-audit__stepper-label {
		display: inline;
	}

	.tt-audit__stepper-item.is-current:not(:last-child)::after {
		min-width: 6px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tt-audit__panel,
	.tt-audit__tip.is-new,
	.tt-audit__art {
		animation: none;
	}

	.tt-audit__stepper-dot,
	.tt-audit__stepper-item::after {
		transition: none;
	}
}

/* ------------------------------------------------------------------
   First screen: one headline, one field, one button
   ------------------------------------------------------------------ */
.tt-audit__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;
}

.tt-audit__title--hero {
	margin: 4px 0 12px;
	font-size: clamp(1.65rem, 3.4vw, 2.2rem);
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.tt-audit__sub--hero {
	margin: 0 0 22px;
	font-size: 1.08rem;
	line-height: 1.55;
	opacity: 0.88;
}

.tt-audit__field--hero {
	margin: 0 0 12px;
}

.tt-audit__inline {
	display: flex;
	gap: 10px;
	align-items: stretch;
}

.tt-audit__inline input[type="text"] {
	flex: 1 1 auto;
	min-width: 0;
	padding: 16px 16px;
	font-size: 1.08rem;
}

.tt-audit__btn--hero {
	flex: 0 0 auto;
	padding: 16px 26px;
	font-size: 1.05rem;
	white-space: nowrap;
}

.tt-audit__note {
	position: relative;
	margin: 0;
	padding: 0 0 0 24px;
	font-size: 0.88rem;
	opacity: 0.8;
}

.tt-audit__note::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 0.35em;
	width: 11px;
	height: 6px;
	border-left: 2px solid var(--tta-accent);
	border-bottom: 2px solid var(--tta-accent);
	transform: rotate(-45deg);
}

@media (max-width: 560px) {
	.tt-audit__inline {
		flex-direction: column;
	}

	.tt-audit__btn--hero {
		width: 100%;
	}
}

/* ------------------------------------------------------------------
   First screen as a full-width hero (navy), then the two-column steps
   ------------------------------------------------------------------ */
.tt-audit[data-view="hero"] .tt-audit__layout {
	display: none;
}

.tt-audit[data-view="hero"] .tt-audit__card {
	padding: 48px 40px 26px;
	color: var(--tta-panel-text);
	background: radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.24), transparent 55%), linear-gradient(145deg, var(--tta-panel), var(--tta-panel2));
	border-color: transparent;
	border-top-color: #38bdf8;
}

.tt-audit__hero {
	text-align: center;
}

.tt-audit__eyebrow {
	display: inline-block;
	margin: 0 0 16px;
	padding: 5px 14px;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #0b1f3a;
	background: #38bdf8;
	border-radius: 999px;
}

.tt-audit[data-view="hero"] .tt-audit__title,
.tt-audit[data-view="hero"] .tt-audit__sub {
	color: var(--tta-panel-text);
}

.tt-audit__hero .tt-audit__title--hero {
	max-width: 760px;
	margin: 0 auto 14px;
	font-size: clamp(1.7rem, 4vw, 2.6rem);
	line-height: 1.12;
}

.tt-audit__hero .tt-audit__sub--hero {
	max-width: 660px;
	margin: 0 auto 28px;
	opacity: 0.92;
}

.tt-audit__hero .tt-audit__field--hero {
	max-width: 660px;
	margin: 0 auto 14px;
	text-align: left;
}

.tt-audit__hero .tt-audit__inline input[type="text"] {
	border-color: transparent;
}

.tt-audit__hero .tt-audit__btn--hero {
	color: #0b1f3a;
	background: #38bdf8;
	border-color: #38bdf8;
}

.tt-audit__hero .tt-audit__err {
	color: #fecaca;
}

.tt-audit__hero .tt-audit__note {
	display: inline-block;
	color: var(--tta-panel-text);
	opacity: 0.9;
}

.tt-audit__hero .tt-audit__note::before {
	border-color: #38bdf8;
}

.tt-audit__why {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 14px;
	margin: 34px 0 0;
	padding: 0;
	list-style: none;
	text-align: left;
}

.tt-audit__why li {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 18px;
	background: rgba(255, 255, 255, 0.09);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: calc(var(--tta-radius) * 0.8);
}

.tt-audit__why-icon {
	flex: 0 0 auto;
	margin-bottom: 4px;
	fill: none;
	stroke: #38bdf8;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tt-audit__why strong {
	font-size: 1.02rem;
	line-height: 1.3;
	color: var(--tta-panel-text);
}

.tt-audit__why span {
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--tta-panel-text);
	opacity: 0.88;
}

.tt-audit[data-view="hero"] .tt-audit__disc {
	color: var(--tta-panel-text);
	border-top-color: rgba(255, 255, 255, 0.2);
	opacity: 0.8;
}

@media (max-width: 560px) {
	.tt-audit[data-view="hero"] .tt-audit__card {
		padding: 32px 18px 20px;
	}
}
