/* WO SEO Audit — frontend styles
   Palette:
   --wo-primary       #F8B588  (pesca — colore del brand, richiesto)
   --wo-primary-dark  #E2894F  (arancio bruciato — accenti/hover)
   --wo-secondary     #2D2A26  (carbone caldo — testo/header)
   --wo-bg            #FFF8F3  (crema caldo — sfondo card)
   --wo-success       #4CAF50
   --wo-warn          #F2A93C
   --wo-fail          #EB5757
   --wo-info          #3FA796  (verde-teal — terzo accento)
*/

.wo-seo-audit-wrap {
	--wo-success: #4CAF50;
	--wo-warn: #F2A93C;
	--wo-fail: #EB5757;
	--wo-info: #3FA796;
	--wo-line: #EFE3D8;
	max-width: 780px;
	margin: 0 auto;
	padding: 8px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--wo-secondary);
	box-sizing: border-box;
}
.wo-seo-audit-wrap *, .wo-seo-audit-wrap *::before, .wo-seo-audit-wrap *::after {
	box-sizing: inherit;
}

/* ---------- HERO ---------- */
.wo-seo-audit-hero {
	background: linear-gradient(165deg, var(--wo-bg) 0%, #ffffff 65%);
	border: 1px solid var(--wo-line);
	border-radius: 20px;
	padding: 40px 32px;
	text-align: center;
}
.wo-seo-audit-title {
	font-size: 30px;
	line-height: 1.25;
	margin: 0 0 14px;
	font-weight: 800;
	color: var(--wo-secondary);
}
.wo-seo-audit-title span {
	color: var(--wo-primary-dark);
}
.wo-seo-audit-subtitle {
	max-width: 520px;
	margin: 0 auto 28px;
	color: #6b645c;
	font-size: 15px;
	line-height: 1.6;
}
.wo-seo-audit-form {
	display: flex;
	gap: 10px;
	max-width: 460px;
	margin: 0 auto;
	flex-wrap: wrap;
	justify-content: center;
}
.wo-seo-audit-form input[type="text"] {
	flex: 1 1 220px;
	padding: 13px 16px;
	border-radius: 10px;
	border: 1.5px solid var(--wo-line);
	font-size: 14px;
	outline: none;
	background: #fff;
}
.wo-seo-audit-form input[type="text"]:focus {
	border-color: var(--wo-primary);
	box-shadow: 0 0 0 3px rgba(248,181,136,0.35);
}
.wo-btn-primary {
	background: linear-gradient(135deg, var(--wo-primary) 0%, var(--wo-primary-dark) 100%);
	color: #fff;
	border: none;
	padding: 13px 22px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: transform .15s ease, box-shadow .15s ease;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.wo-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(226,137,79,0.35);
}
.wo-btn-primary:disabled {
	opacity: .6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}
.wo-seo-audit-error {
	margin-top: 16px;
	color: var(--wo-fail);
	font-size: 13px;
	font-weight: 600;
}

/* ---------- LOADING ---------- */
.wo-seo-audit-loading {
	text-align: center;
	padding: 48px 0;
	color: #8a8177;
}
.wo-spinner {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 4px solid var(--wo-line);
	border-top-color: var(--wo-primary-dark);
	margin: 0 auto 14px;
	animation: wo-spin 0.8s linear infinite;
}
@keyframes wo-spin { to { transform: rotate(360deg); } }

/* ---------- GATE / LEAD FORM ---------- */
.wo-seo-audit-gate {
	background: #fff;
	border: 1px solid var(--wo-line);
	border-radius: 18px;
	padding: 32px;
	margin-top: 24px;
}
.wo-gate-intro {
	text-align: center;
	font-size: 16px;
	font-weight: 600;
	color: var(--wo-secondary);
	max-width: 460px;
	margin: 0 auto 24px;
	line-height: 1.5;
}
.wo-field-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}
.wo-field {
	flex: 1 1 200px;
	margin-bottom: 16px;
}
.wo-field label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 6px;
	color: var(--wo-secondary);
}
.wo-field input[type="text"],
.wo-field input[type="email"],
.wo-field input[type="tel"] {
	width: 100%;
	padding: 11px 14px;
	border-radius: 8px;
	border: 1.5px solid var(--wo-line);
	font-size: 14px;
	background: #fffaf6;
}
.wo-field input:focus {
	outline: none;
	border-color: var(--wo-primary);
	box-shadow: 0 0 0 3px rgba(248,181,136,0.3);
}
.wo-field.wo-has-error input {
	border-color: var(--wo-fail);
}
.wo-field-error {
	display: block;
	color: var(--wo-fail);
	font-size: 12px;
	margin-top: 4px;
	min-height: 14px;
}
.wo-field-checkbox label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 13px;
	font-weight: 400;
	color: #6b645c;
	cursor: pointer;
}
.wo-field-checkbox input {
	margin-top: 3px;
}
.wo-field-checkbox a { color: var(--wo-primary-dark); }
#wo-lead-submit { width: 100%; justify-content: center; margin-top: 6px; }

/* ---------- THANK YOU CARD ---------- */
.wo-seo-audit-thankyou { margin-top: 24px; }
.wo-thankyou-card {
	text-align: center;
	background: linear-gradient(165deg, var(--wo-bg) 0%, #ffffff 70%);
	border: 1.5px solid var(--wo-primary);
	border-radius: 18px;
	padding: 36px 28px;
	animation: wo-thankyou-in .45s ease;
}
.wo-thankyou-icon {
	width: 62px;
	height: 62px;
	line-height: 62px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--wo-primary) 0%, var(--wo-primary-dark) 100%);
	font-size: 28px;
	margin: 0 auto 16px;
	box-shadow: 0 8px 20px rgba(226,137,79,0.3);
}
.wo-thankyou-text {
	max-width: 460px;
	margin: 0 auto;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.6;
	color: var(--wo-secondary);
}
@keyframes wo-thankyou-in {
	from { opacity: 0; transform: translateY(10px) scale(.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- RESULTS ---------- */
.wo-seo-audit-results { margin-top: 28px; }

.wo-score-card {
	text-align: center;
	padding: 30px 20px 10px;
}
.wo-score-ring {
	--pct: 0;
	--tier-color: var(--wo-success);
	width: 150px;
	height: 150px;
	border-radius: 50%;
	margin: 0 auto 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: conic-gradient(var(--tier-color) calc(var(--pct) * 1%), var(--wo-line) 0);
	position: relative;
}
.wo-score-ring::before {
	content: "";
	position: absolute;
	inset: 10px;
	border-radius: 50%;
	background: #fff;
}
.wo-score-ring-inner {
	position: relative;
	z-index: 1;
	text-align: center;
}
.wo-score-number {
	font-size: 40px;
	font-weight: 800;
	color: var(--wo-secondary);
	line-height: 1;
}
.wo-score-max { font-size: 12px; color: #a39a8e; display:block; margin-top: 2px;}
.wo-score-label {
	font-size: 18px;
	font-weight: 700;
	color: var(--wo-secondary);
	margin: 6px 0 4px;
}
.wo-score-sub {
	color: #8a8177;
	font-size: 13px;
	max-width: 380px;
	margin: 0 auto 8px;
}
.wo-cat-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin: 20px 0 26px;
}
.wo-cat-card {
	background: var(--wo-bg);
	border: 1px solid var(--wo-line);
	border-radius: 12px;
	padding: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 13px;
	font-weight: 700;
	color: var(--wo-secondary);
	cursor: pointer;
	transition: border-color .15s ease;
}
.wo-cat-card:hover { border-color: var(--wo-primary); }
.wo-cat-card .wo-cat-name { display:flex; align-items:center; gap:6px; }
.wo-cat-badge {
	font-size: 12px;
	font-weight: 800;
	padding: 3px 9px;
	border-radius: 20px;
	color: #fff;
}
.wo-cat-badge.tier-good { background: var(--wo-success); }
.wo-cat-badge.tier-mid { background: var(--wo-warn); }
.wo-cat-badge.tier-bad { background: var(--wo-fail); }

.wo-accordion { border: 1px solid var(--wo-line); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.wo-accordion-header {
	background: var(--wo-bg);
	padding: 14px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	font-weight: 700;
	font-size: 14.5px;
	color: var(--wo-secondary);
}
.wo-accordion-header .wo-chevron { transition: transform .2s ease; color: var(--wo-primary-dark); }
.wo-accordion.open .wo-chevron { transform: rotate(180deg); }
.wo-accordion-body { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.wo-accordion.open .wo-accordion-body { max-height: 2000px; }
.wo-check-row {
	display: flex;
	gap: 12px;
	padding: 14px 18px;
	border-top: 1px solid var(--wo-line);
	align-items: flex-start;
}
.wo-check-icon {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	color: #fff;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	margin-top: 2px;
}
.wo-check-icon.pass { background: var(--wo-success); }
.wo-check-icon.warn { background: var(--wo-warn); }
.wo-check-icon.fail { background: var(--wo-fail); }
.wo-check-icon.info { background: var(--wo-info); }
.wo-check-text .wo-check-label { font-weight: 700; font-size: 14px; color: var(--wo-secondary); }
.wo-check-text .wo-check-detail { font-size: 13px; color: #8a8177; margin-top: 2px; line-height: 1.5; }
.wo-check-text .wo-check-value { font-size: 12.5px; color: var(--wo-primary-dark); background: rgba(248,181,136,0.15); padding: 5px 8px; border-radius: 6px; margin-top: 6px; display: inline-block; word-break: break-all; }

/* ---------- FAQ ---------- */
.wo-seo-audit-faq { margin-top: 44px; }
.wo-faq-title { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 20px; color: var(--wo-secondary); }
.wo-faq-group { margin-bottom: 18px; }
.wo-faq-group-label { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; color: var(--wo-primary-dark); margin-bottom: 8px; }
.wo-faq-item {
	border: 1px solid var(--wo-line);
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 8px;
	background: #fff;
}
.wo-faq-item summary {
	cursor: pointer;
	font-weight: 700;
	font-size: 14px;
	color: var(--wo-secondary);
	list-style: none;
	display: flex;
	justify-content: space-between;
}
.wo-faq-item summary::-webkit-details-marker { display: none; }
.wo-faq-item summary::after { content: "+"; color: var(--wo-primary-dark); font-size: 18px; font-weight: 800; }
.wo-faq-item[open] summary::after { content: "−"; }
.wo-faq-item p { margin: 10px 0 0; font-size: 13.5px; color: #6b645c; line-height: 1.6; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
	.wo-seo-audit-title { font-size: 24px; }
	.wo-cat-grid { grid-template-columns: repeat(2, 1fr); }
	.wo-seo-audit-hero { padding: 28px 18px; }
	.wo-field-row { flex-direction: column; gap: 0; }
}

/* Accessibility: focus visibility */
.wo-seo-audit-wrap a:focus-visible,
.wo-seo-audit-wrap button:focus-visible,
.wo-seo-audit-wrap input:focus-visible,
.wo-seo-audit-wrap summary:focus-visible {
	outline: 2px solid var(--wo-primary-dark);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.wo-spinner { animation: none; }
	.wo-btn-primary, .wo-accordion-body, .wo-chevron { transition: none; }
	.wo-thankyou-card { animation: none; }
}
