/**
 * Frontend styles for the TechDigitally SEO Analyzer public UI.
 */

.td-seo {
	--td-primary: #1c75bc;
	--td-secondary: #21409a;
	--td-accent: #27aae1;
	--td-brand: #2b4dff;
	--td-black: #231f20;
	--td-muted: #5b6470;
	--td-bg: #f4f7fb;
	--td-card: #ffffff;
	--td-border: #d9e2ec;
	--td-ok: #1a7f37;
	--td-warn: #b45309;
	--td-bad: #b42318;
	--td-gradient: linear-gradient(90deg, #21409a 0%, #27aae1 100%);
	font-family: Inter, Arial, Helvetica, sans-serif;
	color: var(--td-black);
	background: var(--td-bg);
	border: 1px solid var(--td-border);
	border-radius: 24px;
	padding: 36px 32px 40px;
	max-width: 920px;
	margin: 0 auto 40px;
	box-sizing: border-box;
	box-shadow: 0 18px 48px rgba(33, 64, 154, 0.08);
}

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

.td-seo--embed {
	background: transparent;
	border: 0;
	box-shadow: none;
	padding: 20px 16px 24px;
	margin: 0;
	max-width: none;
}

.td-seo__hero {
	text-align: center;
	margin-bottom: 28px;
}

.td-seo--embed .td-seo__hero {
	margin-bottom: 20px;
}

.td-seo__logo {
	display: inline-block;
	height: 36px;
	width: auto;
	margin-bottom: 16px;
}

.td-seo__eyebrow {
	margin: 0 0 8px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-size: 12px;
	font-weight: 700;
	color: var(--td-secondary);
}

.td-seo__title {
	margin: 0 0 10px;
	font-size: 32px;
	line-height: 1.2;
}

.td-seo--embed .td-seo__title {
	font-size: clamp(22px, 2.2vw, 30px);
}

.td-seo__lead {
	margin: 0 auto;
	max-width: 560px;
	color: var(--td-muted);
	font-size: 16px;
	line-height: 1.6;
}

.td-seo__form {
	margin: 0 auto 24px;
	max-width: 720px;
}

.td-seo__label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
}

.td-seo__row {
	display: flex;
	gap: 10px;
}

.td-seo__input {
	flex: 1;
	min-width: 0;
	border: 1px solid var(--td-border);
	border-radius: 12px;
	padding: 16px 18px;
	font-size: 16px;
	background: #fff;
	box-shadow: inset 0 1px 2px rgba(33, 64, 154, 0.04);
}

.td-seo__input:focus {
	outline: 2px solid rgba(39, 170, 225, 0.35);
	border-color: var(--td-accent);
}

.td-seo__btn,
.td-seo__btn-secondary {
	appearance: none;
	border: 0;
	border-radius: 12px;
	padding: 16px 22px;
	font-weight: 700;
	cursor: pointer;
	color: #fff;
	background: var(--td-gradient);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
}

.td-seo__btn:hover,
.td-seo__btn-secondary:hover {
	opacity: 0.94;
	color: #fff;
}

.td-seo__btn:disabled {
	opacity: 0.65;
	cursor: wait;
}

.td-seo__btn-secondary {
	background: var(--td-black);
}

.td-seo__panel {
	background: var(--td-card);
	border: 1px solid var(--td-border);
	border-radius: 16px;
	padding: 24px;
	margin-top: 16px;
}

.td-seo__panel--hidden[hidden] {
	display: none;
}

.td-seo__progress-title {
	font-weight: 700;
	margin: 0 0 12px;
}

.td-seo__progress-track {
	height: 6px;
	border-radius: 999px;
	background: #e8eef6;
	overflow: hidden;
	margin: 0 0 16px;
}

.td-seo__progress-bar {
	display: block;
	height: 100%;
	width: 35%;
	border-radius: inherit;
	background: var(--td-gradient);
	animation: td-seo-progress 1.4s ease-in-out infinite;
}

@keyframes td-seo-progress {
	0% {
		transform: translateX(-120%);
	}
	100% {
		transform: translateX(320%);
	}
}

.td-seo__steps {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 4px 16px;
}

.td-seo__steps li {
	padding: 8px 0 8px 28px;
	position: relative;
	color: var(--td-muted);
}

.td-seo__steps li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 12px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid #c9d6e5;
	background: #fff;
}

.td-seo__steps li.is-active {
	color: var(--td-secondary);
	font-weight: 700;
}

.td-seo__steps li.is-active::before {
	border-color: var(--td-accent);
	background: var(--td-accent);
	box-shadow: 0 0 0 4px rgba(39, 170, 225, 0.18);
}

.td-seo__steps li.is-done {
	color: var(--td-ok);
}

.td-seo__steps li.is-done::before {
	border-color: var(--td-ok);
	background: var(--td-ok);
}

.td-seo__panel--error h3 {
	margin-top: 0;
	color: var(--td-bad);
}

.td-seo__results {
	margin-top: 20px;
	padding-top: 8px;
	scroll-margin-top: 110px;
}

.td-seo__score {
	text-align: center;
	padding: 8px 0 28px;
}

.td-seo__score-kicker {
	margin: 0 0 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 12px;
	color: var(--td-muted);
}

.td-seo__score-ring {
	--td-score: 0;
	width: 168px;
	height: 168px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: conic-gradient(#21409a calc(var(--td-score) * 1%), #e8eef6 0);
	display: grid;
	place-items: center;
}

.td-seo__score-ring-inner {
	width: 128px;
	height: 128px;
	border-radius: 50%;
	background: #fff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-shadow: inset 0 0 0 1px #eef3f8;
}

.td-seo__score-value {
	font-size: 42px;
	font-weight: 800;
	line-height: 1;
	background: var(--td-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.td-seo__score-denom {
	font-size: 13px;
	font-weight: 700;
	color: var(--td-muted);
	margin-top: 2px;
}

.td-seo__score-label {
	margin-top: 4px;
	font-size: 18px;
	font-weight: 700;
}

.td-seo__groups {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin: 0 0 24px;
}

.td-seo__group {
	background: #fff;
	border: 1px solid var(--td-border);
	border-radius: 14px;
	padding: 16px;
	text-align: center;
}

.td-seo__group span {
	color: var(--td-muted);
	font-size: 13px;
	font-weight: 700;
}

.td-seo__group strong {
	display: block;
	font-size: 28px;
	margin-top: 6px;
}

.td-seo__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 24px;
}

.td-seo__meta span {
	background: #f4f7fb;
	border: 1px solid var(--td-border);
	border-radius: 999px;
	padding: 8px 12px;
	color: var(--td-muted);
	font-size: 13px;
	font-weight: 600;
}

.td-seo__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 8px 0 28px;
}

.td-seo__issues-title {
	margin: 0 0 14px;
	font-size: 22px;
}

.td-seo__issue {
	border: 1px solid var(--td-border);
	border-radius: 14px;
	padding: 16px 18px;
	margin: 0 0 12px;
	background: #fff;
}

.td-seo__sev {
	display: inline-block;
	border-radius: 999px;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.td-seo__sev--critical,
.td-seo__sev--high {
	background: #fee4e2;
	color: var(--td-bad);
}

.td-seo__sev--medium {
	background: #fef0c7;
	color: var(--td-warn);
}

.td-seo__sev--low {
	background: #d1fadf;
	color: var(--td-ok);
}

.td-seo__issue h4 {
	margin: 0 0 8px;
}

.td-seo__issue p {
	margin: 0 0 8px;
	color: var(--td-muted);
}

@media (max-width: 720px) {
	.td-seo {
		padding: 24px 16px;
	}

	.td-seo__row,
	.td-seo__groups,
	.td-seo__actions,
	.td-seo__steps {
		grid-template-columns: 1fr;
		display: flex;
		flex-direction: column;
	}

	.td-seo__title {
		font-size: 26px;
	}
}
