/**
 * SEO Checker front end styles.
 *
 * Plain CSS, no build step, no external fonts and no CDN dependencies.
 * Status is conveyed by an icon glyph and a text label as well as by colour,
 * so the report is usable by anyone who cannot distinguish the colours.
 */

.seoc {
	--seoc-green: #15803d;
	--seoc-green-bg: #dcfce7;
	--seoc-orange: #b45309;
	--seoc-orange-bg: #fef3c7;
	--seoc-red: #b91c1c;
	--seoc-red-bg: #fee2e2;
	--seoc-grey: #52525b;
	--seoc-grey-bg: #f4f4f5;
	/* Advisory rows are deliberately blue rather than green/orange/red: they
	   are information, not a verdict, and must not read as a pass or a fail. */
	--seoc-advisory: #1d4ed8;
	--seoc-advisory-bg: #dbeafe;
	--seoc-accent: #2563eb;
	--seoc-text: #18181b;
	--seoc-muted: #52525b;
	--seoc-border: #e4e4e7;
	--seoc-surface: #ffffff;
	--seoc-radius: 10px;

	max-width: 860px;
	margin: 0 auto;
	color: var(--seoc-text);
	font-size: 16px;
	line-height: 1.5;
	box-sizing: border-box;
}

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

.seoc--dark {
	--seoc-text: #fafafa;
	--seoc-muted: #a1a1aa;
	--seoc-border: #3f3f46;
	--seoc-surface: #18181b;
	--seoc-grey-bg: #27272a;
	/* Measured: the light-theme grey (#52525b) on the dark grey background
	   gives 1.93:1, far below the 4.5:1 AA requirement — dark grey text on a
	   dark grey panel. The background is overridden for dark theme, so the
	   foreground must be too. */
	--seoc-grey: #d4d4d8;
	/* Same problem for the advisory pill: its light-theme background is not
	   used in dark theme, so both ends of the pair are restated. */
	--seoc-advisory: #93c5fd;
	--seoc-advisory-bg: #1e3a5f;
	--seoc-green-bg: #14321f;
	--seoc-orange-bg: #3a2a10;
	--seoc-red-bg: #3a1717;
	--seoc-green: #86efac;
	--seoc-orange: #fcd34d;
	--seoc-red: #fca5a5;
}

/* ---------------------------------------------------------------- Form */

.seoc__label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 0.9375rem;
}

.seoc__row {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.seoc__input {
	flex: 1 1 260px;
	min-width: 0;
	padding: 12px 14px;
	font-size: 1rem;
	color: var(--seoc-text);
	background: var(--seoc-surface);
	border: 1px solid var(--seoc-border);
	border-radius: var(--seoc-radius);
}

.seoc__input:focus-visible,
.seoc__button:focus-visible,
.seoc__toggle:focus-visible {
	outline: 3px solid var(--seoc-accent);
	outline-offset: 2px;
}

.seoc__button {
	flex: 0 0 auto;
	padding: 12px 22px;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: var(--seoc-accent);
	border: 0;
	border-radius: var(--seoc-radius);
	cursor: pointer;
}

.seoc__button--secondary {
	padding: 6px 14px;
	font-size: 0.875rem;
}

.seoc__retry {
	margin: 10px 0 0;
	font-size: 0.9375rem;
	color: var(--seoc-muted);
	word-break: break-all;
}

.seoc__button:disabled {
	opacity: 0.6;
	cursor: progress;
}

.seoc__error {
	margin: 10px 0 0;
	padding: 10px 12px;
	color: var(--seoc-red);
	background: var(--seoc-red-bg);
	border-radius: var(--seoc-radius);
	font-size: 0.9375rem;
}

/* ---------------------------------------------------------- Lead form */

.seoc__lead {
	margin-top: 22px;
	padding: 18px;
	background: var(--seoc-surface);
	border: 1px solid var(--seoc-border);
	border-radius: var(--seoc-radius);
}

.seoc__consent {
	margin: 12px 0 0;
	font-size: 0.875rem;
	line-height: 1.5;
}

.seoc__consent label {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	cursor: pointer;
}

/* Big enough to hit with a thumb, and it must not shrink beside long
   wording on a narrow screen. */
.seoc__consent-box {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
}

.seoc__lead-message {
	margin: 12px 0 0;
	font-size: 0.9375rem;
	min-height: 1.4em;
}

/* ------------------------------------------------------------ Progress */

.seoc__progress {
	margin-top: 18px;
}

.seoc__progress-track {
	height: 8px;
	background: var(--seoc-grey-bg);
	border-radius: 999px;
	overflow: hidden;
}

.seoc__progress-bar {
	height: 100%;
	width: 0;
	background: var(--seoc-accent);
	border-radius: 999px;
	transition: width 0.35s ease;
}

.seoc__progress-text {
	margin: 8px 0 0;
	font-size: 0.875rem;
	color: var(--seoc-muted);
}

/* --------------------------------------------------------------- Score */

.seoc__results {
	margin-top: 24px;
}

.seoc__analysed {
	margin: 0 0 12px;
	font-size: 0.875rem;
	color: var(--seoc-muted);
	word-break: break-all;
}

.seoc__analysed-url {
	color: var(--seoc-accent);
}

.seoc__analysed-note {
	color: var(--seoc-muted);
	font-style: italic;
}

/* Report-level notices: a capped score and a limited-coverage warning. Both
   must read as statements of fact, not as failures, so they use the neutral
   accent rather than the red/orange status colours. */

.seoc__notice {
	margin: 14px 0 0;
	padding: 12px 14px;
	border-left: 4px solid var(--seoc-accent);
	border-radius: 8px;
	background: var(--seoc-grey-bg);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.seoc__notice--cap {
	border-left-color: var(--seoc-orange);
}

.seoc__notice-aside {
	color: var(--seoc-muted);
}

.seoc__score {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 24px 16px;
	border: 1px solid var(--seoc-border);
	border-radius: var(--seoc-radius);
	background: var(--seoc-surface);
}

.seoc__score:focus {
	outline: none;
}

.seoc__ring {
	width: 150px;
	height: 150px;
	transform: rotate(-90deg);
}

.seoc__ring-track {
	fill: none;
	stroke: var(--seoc-grey-bg);
	stroke-width: 10;
}

.seoc__ring-value {
	fill: none;
	stroke-width: 10;
	stroke-linecap: round;
	transition: stroke-dashoffset 0.9s ease;
}

.seoc__score--green .seoc__ring-value { stroke: var(--seoc-green); }
.seoc__score--orange .seoc__ring-value { stroke: var(--seoc-orange); }
.seoc__score--red .seoc__ring-value { stroke: var(--seoc-red); }
.seoc__score--grey .seoc__ring-value { stroke: var(--seoc-grey); }

.seoc__score-text {
	position: absolute;
	top: 78px;
	display: flex;
	flex-direction: column;
	align-items: center;
	pointer-events: none;
}

.seoc__score-number {
	font-size: 2.75rem;
	font-weight: 700;
	line-height: 1;
}

.seoc__score-out {
	font-size: 0.75rem;
	color: var(--seoc-muted);
}

.seoc__score-summary {
	margin: 14px 0 0;
	display: flex;
	gap: 8px;
}

.seoc__pill {
	display: inline-block;
	min-width: 34px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.8125rem;
	font-weight: 600;
	text-align: center;
}

.seoc__pill--green { color: var(--seoc-green); background: var(--seoc-green-bg); }
.seoc__pill--orange { color: var(--seoc-orange); background: var(--seoc-orange-bg); }
.seoc__pill--red { color: var(--seoc-red); background: var(--seoc-red-bg); }
.seoc__pill--grey { color: var(--seoc-grey); background: var(--seoc-grey-bg); }
.seoc__pill--advisory { color: var(--seoc-accent); background: var(--seoc-advisory-bg); }

/* ----------------------------------------------------- Priority panel */

.seoc__panel {
	margin-top: 18px;
	padding: 18px;
	border: 1px solid var(--seoc-border);
	border-radius: var(--seoc-radius);
	background: var(--seoc-surface);
}

.seoc__panel--ok {
	border-color: var(--seoc-green);
	background: var(--seoc-green-bg);
	color: var(--seoc-green);
}

.seoc__panel--ok p {
	margin: 0;
	font-weight: 600;
}

.seoc__panel-title {
	margin: 0 0 12px;
	font-size: 1.0625rem;
}

.seoc__priority-list {
	margin: 0;
	padding-left: 0;
	list-style: none;
	counter-reset: seoc-fix;
}

.seoc__priority-item {
	display: flex;
	gap: 10px;
	padding: 10px 0;
	border-top: 1px solid var(--seoc-border);
}

.seoc__priority-item:first-child {
	border-top: 0;
}

.seoc__priority-item p {
	margin: 4px 0 0;
	font-size: 0.9375rem;
	color: var(--seoc-muted);
}

/* --------------------------------------------------------- Categories */

.seoc__categories {
	margin-top: 18px;
	border: 1px solid var(--seoc-border);
	border-radius: var(--seoc-radius);
	overflow: hidden;
}

.seoc__category + .seoc__category {
	border-top: 1px solid var(--seoc-border);
}

.seoc__category-head {
	margin: 0;
	font-size: 1rem;
}

.seoc__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 14px 16px;
	font: inherit;
	font-weight: 600;
	color: var(--seoc-text);
	text-align: left;
	background: var(--seoc-surface);
	border: 0;
	cursor: pointer;
}

.seoc__toggle::after {
	content: "\25BC";
	font-size: 0.7rem;
	color: var(--seoc-muted);
	transition: transform 0.2s ease;
}

.seoc__toggle[aria-expanded="true"]::after {
	transform: rotate(180deg);
}

.seoc__category-name {
	flex: 1 1 auto;
}

.seoc__category-score {
	flex: 0 0 auto;
	min-width: 44px;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 0.875rem;
	text-align: center;
}

.seoc__category-score--green { color: var(--seoc-green); background: var(--seoc-green-bg); }
.seoc__category-score--orange { color: var(--seoc-orange); background: var(--seoc-orange-bg); }
.seoc__category-score--red { color: var(--seoc-red); background: var(--seoc-red-bg); }
.seoc__category-score--grey { color: var(--seoc-grey); background: var(--seoc-grey-bg); }

.seoc__category-body {
	padding: 0 16px 16px;
}

.seoc__bar {
	height: 6px;
	margin-bottom: 14px;
	background: var(--seoc-grey-bg);
	border-radius: 999px;
	overflow: hidden;
}

.seoc__bar-fill {
	display: block;
	height: 100%;
	border-radius: 999px;
}

.seoc__bar-fill--green { background: var(--seoc-green); }
.seoc__bar-fill--orange { background: var(--seoc-orange); }
.seoc__bar-fill--red { background: var(--seoc-red); }
.seoc__bar-fill--grey { background: var(--seoc-grey); }

/* ------------------------------------------------------------- Checks */

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

.seoc__check {
	padding: 12px 0;
	border-top: 1px solid var(--seoc-border);
}

.seoc__check:first-child {
	border-top: 0;
}

.seoc__check-head {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.seoc__check-label {
	font-weight: 600;
}

.seoc__check-status {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 2px 8px;
	border-radius: 999px;
}

.seoc__check--green .seoc__check-status { color: var(--seoc-green); background: var(--seoc-green-bg); }
.seoc__check--orange .seoc__check-status { color: var(--seoc-orange); background: var(--seoc-orange-bg); }
.seoc__check--red .seoc__check-status { color: var(--seoc-red); background: var(--seoc-red-bg); }
.seoc__check--grey .seoc__check-status { color: var(--seoc-grey); background: var(--seoc-grey-bg); }
.seoc__check--advisory .seoc__check-status { color: var(--seoc-advisory); background: var(--seoc-advisory-bg); }

.seoc__check--advisory {
	border-left: 3px solid var(--seoc-advisory-bg);
	padding-left: 10px;
}

.seoc__check-note {
	font-size: 0.75rem;
	font-style: italic;
	color: var(--seoc-muted);
}

.seoc__check-value {
	margin-left: auto;
	font-size: 0.875rem;
	color: var(--seoc-muted);
}

.seoc__check-analysis,
.seoc__check-fix {
	margin: 6px 0 0;
	font-size: 0.9375rem;
	color: var(--seoc-muted);
}

.seoc__check-fix {
	padding: 8px 10px;
	background: var(--seoc-grey-bg);
	border-radius: 8px;
	color: var(--seoc-text);
}

/* Status icon. Shape as well as colour, so it survives greyscale. */

.seoc__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
}

.seoc__icon--green { background: var(--seoc-green); }
.seoc__icon--orange { background: var(--seoc-orange); }
.seoc__icon--red { background: var(--seoc-red); }
.seoc__icon--grey { background: var(--seoc-grey); }
.seoc__icon--advisory { background: var(--seoc-advisory); }

.seoc__icon--green::before { content: "\2713"; }
.seoc__icon--orange::before { content: "\0021"; }
.seoc__icon--red::before { content: "\00D7"; }
.seoc__icon--grey::before { content: "\2013"; }
.seoc__icon--advisory::before { content: "\0069"; font-style: italic; font-family: Georgia, serif; }

/* -------------------------------------------------------- Responsive */

@media (max-width: 480px) {
	.seoc__button {
		flex: 1 1 100%;
	}

	.seoc__check-value {
		margin-left: 0;
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.seoc__progress-bar,
	.seoc__ring-value,
	.seoc__toggle::after {
		transition: none;
	}
}
