/* Alfatih Website Health Checker - gaya alat (skop .afhc), selaras dengan kad tool alfatihstudio.com */
.afhc {
	--afhc-accent: #1960b9;
	--afhc-good: #067647;
	--afhc-mid: #b54708;
	--afhc-bad: #b42318;
	--afhc-ink: #172b44;
	--afhc-muted: #53657a;
	--afhc-line: #e4e9ef;
	--afhc-bg: #ffffff;
	max-width: 880px;
	margin: 0 auto;
	color: var(--afhc-ink);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	box-sizing: border-box;
}
.afhc *, .afhc *::before, .afhc *::after { box-sizing: border-box; }

.afhc [hidden] { display: none !important; }

.afhc-card {
	background: var(--afhc-bg);
	border: 1px solid #dde5ed;
	border-radius: 14px;
	padding: 24px;
}

.afhc-title { margin: 0 0 6px; font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.02em; color: var(--afhc-ink); outline: none; }
.afhc-sub { margin: 0 0 18px; color: var(--afhc-muted); }
.afhc-h3 { margin: 26px 0 10px; font-size: 1.1rem; color: var(--afhc-ink); }
.afhc-note { margin: 10px 0 0; font-size: 0.85rem; color: var(--afhc-muted); }
.afhc-ok { margin: 14px 0; padding: 10px 14px; border-radius: 10px; background: #ecfdf3; color: var(--afhc-good); font-size: 0.92rem; }

.afhc-label, .afhc-field span { display: block; margin-bottom: 6px; font-weight: 650; font-size: 14px; }
.afhc-row { display: flex; gap: 10px; }
.afhc input[type="text"], .afhc input[type="tel"], .afhc input[type="email"] {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid #c3cfdc;
	border-radius: 9px;
	font-size: 16px;
	background: #fff;
	color: var(--afhc-ink);
}
.afhc input:focus-visible, .afhc button:focus-visible, .afhc a:focus-visible, .afhc summary:focus-visible {
	outline: 3px solid #8ec5ff;
	outline: 3px solid color-mix(in srgb, var(--afhc-accent) 40%, transparent);
	outline-offset: 2px;
}
.afhc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.afhc-error { min-height: 1.2em; margin-top: 10px; color: var(--afhc-bad); font-size: 0.92rem; }
.afhc-ts { margin-top: 12px; }

.afhc-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 46px; padding: 11px 18px;
	border: 1px solid transparent; border-radius: 9px;
	font-size: 14px; font-weight: 650; text-decoration: none; cursor: pointer;
	transition: transform 0.08s ease, opacity 0.15s ease;
}
.afhc-btn:active { transform: translateY(1px); }
.afhc-btn[disabled] { opacity: 0.6; cursor: wait; }
.afhc-btn-primary { background: var(--afhc-accent); color: #fff; white-space: nowrap; }
.afhc-btn-primary:hover { background: #124f9a; }
.afhc-btn-block { width: 100%; margin-top: 14px; }
.afhc-btn-wa { background: #128c7e; color: #fff; }
.afhc-btn-ghost { background: #fff; color: var(--afhc-accent); border-color: var(--afhc-accent); }
.afhc-link { background: none; border: 0; padding: 6px 0; margin-top: 14px; color: var(--afhc-accent); font-weight: 600; cursor: pointer; text-decoration: underline; font-size: 0.95rem; }
.afhc-actions { display: flex; gap: 20px; flex-wrap: wrap; }

/* progres */
.afhc-spinner { width: 42px; height: 42px; margin: 6px auto 14px; border: 4px solid var(--afhc-line); border-top-color: var(--afhc-accent); border-radius: 50%; animation: afhc-spin 0.9s linear infinite; }
.afhc-spinner-sm { width: 18px; height: 18px; margin: 0; border-width: 3px; flex: none; }
@keyframes afhc-spin { to { transform: rotate(360deg); } }
[data-afhc-ready] .afhc-view[aria-live] { text-align: center; padding: 18px 0; }
.afhc-progress-msg { color: var(--afhc-muted); margin: 6px 0 0; }

/* ringkasan */
.afhc-summary { display: flex; align-items: center; gap: 22px; margin: 16px 0 8px; }
.afhc-ring { flex: none; }
.afhc-ring-bg { fill: none; stroke: var(--afhc-line); stroke-width: 10; }
.afhc-ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.afhc-ring-num { font-size: 34px; font-weight: 800; fill: var(--afhc-ink); }
.afhc-ring.afhc-good .afhc-ring-fg { stroke: var(--afhc-good); }
.afhc-ring.afhc-mid .afhc-ring-fg { stroke: var(--afhc-mid); }
.afhc-ring.afhc-bad .afhc-ring-fg { stroke: var(--afhc-bad); }
.afhc-grade { font-size: 1.25rem; font-weight: 800; }
.afhc-grade.afhc-good { color: var(--afhc-good); }
.afhc-grade.afhc-mid { color: var(--afhc-mid); }
.afhc-grade.afhc-bad { color: var(--afhc-bad); }
.afhc-counts { margin: 2px 0 0; color: var(--afhc-muted); font-size: 0.92rem; }

.afhc-speed-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f9fafb; border-radius: 10px; font-size: 0.92rem; color: var(--afhc-muted); }

/* kategori */
.afhc-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 22px; margin: 18px 0 4px; }
.afhc-cat-top { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 4px; }
.afhc-bar { display: block; height: 8px; border-radius: 99px; background: var(--afhc-line); overflow: hidden; }
.afhc-bar-fill { display: block; height: 100%; border-radius: 99px; transition: width 0.9s ease; }
.afhc-bar-fill.afhc-good { background: var(--afhc-good); }
.afhc-bar-fill.afhc-mid { background: var(--afhc-mid); }
.afhc-bar-fill.afhc-bad { background: var(--afhc-bad); }

/* lencana */
.afhc-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: 99px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; flex: none; }
.afhc-b-ic { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 11px; line-height: 1; }
.afhc-b-fail { background: #fef3f2; color: var(--afhc-bad); } .afhc-b-fail .afhc-b-ic { background: var(--afhc-bad); }
.afhc-b-warn { background: #fffaeb; color: var(--afhc-mid); } .afhc-b-warn .afhc-b-ic { background: var(--afhc-mid); }
.afhc-b-pass { background: #ecfdf3; color: var(--afhc-good); } .afhc-b-pass .afhc-b-ic { background: var(--afhc-good); }
.afhc-b-info { background: #f2f4f7; color: #344054; } .afhc-b-info .afhc-b-ic { background: #667085; }

.afhc-issue-list, .afhc-plain { list-style: none; margin: 0; padding: 0; }
.afhc-issue-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--afhc-line); }
.afhc-plain { list-style: disc; padding-left: 20px; color: #475467; font-size: 0.92rem; }
.afhc-issue-title { font-weight: 600; }

/* item laporan */
.afhc-item { border: 1px solid var(--afhc-line); border-left-width: 4px; border-radius: 10px; margin-bottom: 10px; background: #fff; }
.afhc-i-fail { border-left-color: var(--afhc-bad); }
.afhc-i-warn { border-left-color: var(--afhc-mid); }
.afhc-i-pass { border-left-color: var(--afhc-good); }
.afhc-item summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.afhc-item summary::-webkit-details-marker { display: none; }
.afhc-item summary::after { content: '+'; margin-left: auto; color: var(--afhc-muted); font-weight: 700; }
.afhc-item[open] summary::after { content: '\2212'; }
.afhc-item-body { padding: 0 14px 12px; font-size: 0.93rem; color: #344054; }
.afhc-item-body p { margin: 6px 0 0; }
.afhc-detail { white-space: pre-line; color: #475467; margin: 6px 0 0; font-size: 0.92rem; }

/* borang lead */
.afhc-lead { margin-top: 26px; padding: 22px; border: 2px solid var(--afhc-accent); border-radius: 14px; background: #f5f9ff; background: color-mix(in srgb, var(--afhc-accent) 5%, #fff); }
.afhc-lead .afhc-h3 { margin-top: 0; }
.afhc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.afhc-field { display: block; margin-bottom: 12px; }
.afhc-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; color: #344054; margin-top: 4px; }
.afhc-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--afhc-accent); }
.afhc-check a { color: var(--afhc-accent); }

/* CTA */
.afhc-cta { margin-top: 28px; padding: 22px; border-radius: 14px; background: #eef5ff; border: 1px solid #c9dcf5; background: color-mix(in srgb, var(--afhc-accent) 8%, #fff); border: 1px solid color-mix(in srgb, var(--afhc-accent) 30%, #fff); }
.afhc-cta .afhc-h3 { margin-top: 0; }
.afhc-cta p { margin: 0 0 14px; color: #344054; }
.afhc-cta-row { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 600px) {
	.afhc-card { padding: 18px; }
	.afhc-row { flex-direction: column; }
	.afhc-btn-primary { width: 100%; }
	.afhc-grid, .afhc-cats { grid-template-columns: 1fr; }
	.afhc-summary { flex-direction: column; text-align: center; }
	.afhc-cta-row .afhc-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.afhc-spinner { animation-duration: 3s; }
	.afhc-ring-fg, .afhc-bar-fill { transition: none; }
}

@media print {
	.afhc-lead, .afhc-link, .afhc-actions, .afhc-ts { display: none !important; }
	.afhc-card { box-shadow: none; border: 0; }
	.afhc-item > .afhc-item-body { display: block; }
}
