/**
 * SA — Mobile-Friendliness Self-Check widget, used only on
 * /tools/mobile-friendliness-self-check/ (see the `data-sa-tool` markup
 * rendered by sa_mobile_friendliness_shortcode() in inc/tools.php).
 * Self-contained; reuses the --tool-* tokens from tools.css, which is a
 * declared dependency so it always loads first.
 */

.sa-mfc-checker {
	background: #fff;
	border: 1px solid var(--tool-border);
	border-radius: 1rem;
	padding: 1.75rem;
	box-shadow: 0 14px 32px -20px rgba(23, 35, 61, 0.3);
	margin: 2rem 0;
}
@media (min-width: 768px) {
	.sa-mfc-checker {
		padding: 2.25rem;
	}
}

.sa-mfc-checker__field label {
	display: block;
	font-weight: 700;
	font-size: 0.85rem;
	color: var(--tool-ink);
	margin-bottom: 0.5rem;
}

.sa-mfc-url-row {
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
}
.sa-mfc-url-row input[type="text"] {
	flex: 1 1 14rem;
	border: 1px solid var(--tool-border);
	border-radius: 0.6rem;
	padding: 0.7rem 0.9rem;
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--tool-ink);
}
.sa-mfc-url-row input[type="text"]:focus {
	outline: none;
	border-color: var(--tool-yellow);
	box-shadow: 0 0 0 3px var(--tool-yellow-glow);
}
.sa-mfc-check-btn {
	flex: 0 0 auto;
	border: none;
	border-radius: 0.6rem;
	padding: 0.7rem 1.25rem;
	font-family: inherit;
	font-weight: 700;
	font-size: 0.9rem;
	white-space: nowrap;
	background: var(--tool-yellow);
	color: #14110a;
	cursor: pointer;
	transition: box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.sa-mfc-check-btn:hover:not(:disabled) {
	box-shadow: 0 0 16px 2px var(--tool-yellow-glow);
	transform: translateY(-1px);
}
.sa-mfc-check-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.sa-mfc-status {
	display: block;
	margin-top: 0.75rem;
	font-size: 0.85rem;
	color: var(--tool-muted);
	min-height: 1.2em;
}
.sa-mfc-status.is-error {
	color: #c23f3f;
}

/* ==========================================================================
   Score bar
   ========================================================================== */

.sa-mfc-score {
	margin-top: 1.75rem;
}
.sa-mfc-score__row {
	display: flex;
	align-items: center;
	gap: 1rem;
}
.sa-mfc-score__outstanding {
	margin: 0.6rem 0 0;
	font-size: 0.85rem;
	color: var(--tool-muted);
	line-height: 1.5;
}
.sa-mfc-score__outstanding.is-complete {
	color: #2e7d32;
	font-weight: 600;
}
.sa-mfc-score__bar {
	flex: 1 1 auto;
	height: 0.6rem;
	border-radius: 999px;
	background: var(--tool-bg-alt);
	overflow: hidden;
}
.sa-mfc-score__fill {
	display: block;
	height: 100%;
	width: 0%;
	border-radius: 999px;
	background: #c23f3f;
	transition: width 0.25s ease, background-color 0.25s ease;
}
.sa-mfc-score__fill.is-mid {
	background: #d18a2b;
}
.sa-mfc-score__fill.is-good {
	background: #2e7d32;
}
.sa-mfc-score__label {
	flex: 0 0 auto;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--tool-ink);
	white-space: nowrap;
}

/* ==========================================================================
   Sections (automated checks / manual checklist)
   ========================================================================== */

.sa-mfc-section {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--tool-border);
}
.sa-mfc-section__title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--tool-ink);
	margin: 0 0 0.35rem;
}
.sa-mfc-section__hint {
	font-size: 0.85rem;
	color: var(--tool-muted);
	margin: 0 0 1rem;
}

.sa-mfc-automated,
.sa-mfc-manual {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.sa-mfc-check {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	background: var(--tool-bg-alt);
	border-radius: 0.6rem;
	padding: 0.85rem 1rem;
}
.sa-mfc-check__badge {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.4rem;
	height: 1.4rem;
	margin-top: 0.1rem;
	border-radius: 50%;
	font-size: 0.7rem;
	font-weight: 800;
	color: #fff;
	background: var(--tool-muted);
}
.sa-mfc-check__badge.is-pass {
	background: #2e7d32;
}
.sa-mfc-check__badge.is-pass::before {
	content: '\2713';
}
.sa-mfc-check__badge.is-warn {
	background: #d18a2b;
}
.sa-mfc-check__badge.is-warn::before {
	content: '!';
}
.sa-mfc-check__badge.is-fail {
	background: #c23f3f;
}
.sa-mfc-check__badge.is-fail::before {
	content: '\2715';
}
.sa-mfc-check__body {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}
.sa-mfc-check__title {
	font-weight: 700;
	font-size: 0.9rem;
	color: var(--tool-ink);
}
.sa-mfc-check__detail {
	font-size: 0.85rem;
	color: var(--tool-muted);
	line-height: 1.5;
}

.sa-mfc-manual-item {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	background: var(--tool-bg-alt);
	border-radius: 0.6rem;
	padding: 0.85rem 1rem;
	font-size: 0.9rem;
	color: var(--tool-ink);
	cursor: pointer;
}
.sa-mfc-manual-item input[type="checkbox"] {
	flex-shrink: 0;
	width: 1.15rem;
	height: 1.15rem;
	margin-top: 0.1rem;
	accent-color: var(--tool-yellow);
	cursor: pointer;
}
