/**
 * eBay Account Health Checker - self-contained, theme-friendly styles.
 *
 * Scoped under .a2ehc. Colours read the host theme's own design tokens (A2E Prime
 * exposes --surface, --text, --line, --brand, --r, etc.) so the tool matches the site
 * and follows its light / dark toggle. When no theme defines those tokens, the local
 * *-d defaults are used, and only those follow the visitor's OS colour scheme.
 */

.a2ehc {
	/* Standalone (no theme) light defaults - flipped for OS dark further down. */
	--hc-bg-d: #ffffff;
	--hc-panel-d: #f6f7fc;
	--hc-panel2-d: #eef1f8;
	--hc-ink-d: #0b1030;
	--hc-muted-d: #5a6484;
	--hc-line-d: rgba( 17, 24, 64, 0.11 );

	--hc-bg: var( --surface, var( --hc-bg-d ) );
	--hc-panel: var( --surface-2, var( --hc-panel-d ) );
	--hc-panel2: var( --surface-3, var( --hc-panel2-d ) );
	--hc-ink: var( --text, var( --hc-ink-d ) );
	--hc-muted: var( --text-2, var( --hc-muted-d ) );
	--hc-line: var( --line, var( --hc-line-d ) );
	--hc-brand: var( --brand, #2b4cf2 );
	--hc-brand-2: var( --brand-2, #1d8cf8 );
	--hc-brand-3: var( --brand-3, #7a3cf0 );
	--hc-good: #12b76a;
	--hc-warn: #f5a524;
	--hc-bad: #f04438;
	--hc-wa: #25d366;
	--hc-radius: var( --r, 16px );
	--hc-radius-l: var( --r-l, 22px );
	--hc-shadow: var( --shadow-2, 0 18px 50px rgba( 15, 27, 45, 0.10 ) );

	box-sizing: border-box;
	max-width: 1040px;
	margin: 0 auto;
	padding: clamp( 18px, 3vw, 30px );
	color: var( --hc-ink );
	background: var( --hc-bg );
	border: 1px solid var( --hc-line );
	border-radius: var( --hc-radius-l );
	font-family: var( --font, inherit );
	line-height: 1.55;
}

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

.a2ehc .a2ehc-ic { width: 20px; height: 20px; flex: 0 0 auto; }

/* Highlighted standout container. */
.a2ehc--highlight {
	position: relative;
	padding: clamp( 20px, 3.2vw, 34px );
	background:
		linear-gradient( var( --hc-bg ), var( --hc-bg ) ) padding-box,
		linear-gradient( 125deg, var( --hc-brand-2 ), var( --hc-brand ) 46%, var( --hc-brand-3 ) ) border-box;
	border: 2px solid transparent;
	box-shadow: var( --hc-shadow );
}

.a2ehc--highlight::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 2px;
	background: linear-gradient( 125deg, var( --hc-brand-2 ), var( --hc-brand ) 46%, var( --hc-brand-3 ) );
	-webkit-mask: linear-gradient( #000 0 0 ) content-box, linear-gradient( #000 0 0 );
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	opacity: 0.55;
	pointer-events: none;
}

/* Head */
.a2ehc__head { text-align: center; max-width: 760px; margin: 0 auto 22px; }

.a2ehc__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --hc-brand );
	background: color-mix( in srgb, var( --hc-brand ) 12%, transparent );
	padding: 5px 12px 5px 10px;
	border-radius: 999px;
	margin-bottom: 12px;
}
.a2ehc__badge .a2ehc-ic { width: 15px; height: 15px; }

.a2ehc__title { margin: 0 0 8px; font-size: clamp( 22px, 3.4vw, 32px ); line-height: 1.12; color: var( --hc-ink ); }
.a2ehc__intro { margin: 0; color: var( --hc-muted ); font-size: 15px; }

/* Layout */
.a2ehc__grid {
	display: grid;
	grid-template-columns: minmax( 0, 0.96fr ) minmax( 0, 1.04fr );
	gap: clamp( 16px, 2.4vw, 26px );
	align-items: stretch;
}
@media ( max-width: 860px ) { .a2ehc__grid { grid-template-columns: 1fr; } }

/* Form */
.a2ehc__form { margin: 0; display: grid; gap: 16px; align-content: start; }
.a2ehc__form fieldset { margin: 0; padding: 16px; border: 1px solid var( --hc-line ); border-radius: 14px; background: var( --hc-panel ); }
.a2ehc__form legend {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 0 8px; font-weight: 700; font-size: 12.5px; letter-spacing: 0.04em;
	text-transform: uppercase; color: var( --hc-muted );
}
.a2ehc__form legend .a2ehc-ic { width: 16px; height: 16px; color: var( --hc-brand ); }

.a2ehc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; margin-bottom: 12px; }
.a2ehc-row .a2ehc-field { margin-bottom: 0; }
@media ( max-width: 420px ) { .a2ehc-row { grid-template-columns: 1fr; } }

.a2ehc-field { margin: 0 0 12px; display: grid; gap: 6px; align-content: start; }
.a2ehc-field:last-child { margin-bottom: 0; }
.a2ehc-field label { font-size: 13.5px; font-weight: 600; color: var( --hc-ink ); }

.a2ehc-input { position: relative; display: flex; align-items: center; }
.a2ehc-input input, .a2ehc-input select {
	width: 100%; padding: 10px 12px; font-size: 15px; color: var( --hc-ink );
	background: var( --hc-bg ); border: 1px solid var( --hc-line ); border-radius: 10px;
	appearance: none; -webkit-appearance: none; font-variant-numeric: tabular-nums;
}
.a2ehc-input input:focus, .a2ehc-input select:focus {
	outline: none; border-color: var( --hc-brand );
	box-shadow: 0 0 0 3px color-mix( in srgb, var( --hc-brand ) 22%, transparent );
}
.a2ehc-input--suffix .a2ehc-suffix { position: absolute; right: 12px; color: var( --hc-muted ); font-weight: 600; pointer-events: none; }
.a2ehc-input--suffix input { padding-right: 34px; }
.a2ehc-help { font-size: 12px; color: var( --hc-muted ); }

.a2ehc-check { margin: 14px 0 0; font-size: 13px; color: var( --hc-muted ); display: flex; }
.a2ehc-check label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.a2ehc-check input { margin-top: 2px; accent-color: var( --hc-brand ); }

/* Results */
.a2ehc__results {
	display: grid; gap: 16px; align-content: start;
	padding: clamp( 16px, 2.2vw, 22px );
	background: var( --hc-panel ); border: 1px solid var( --hc-line ); border-radius: 14px;
}

/* Level + meter */
.a2ehc-level { display: grid; gap: 14px; }
.a2ehc-level__top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }

.a2ehc-level__pill {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: clamp( 17px, 2.4vw, 20px ); font-weight: 800; letter-spacing: -0.01em;
	padding: 7px 16px; border-radius: 999px;
	color: var( --hc-muted ); background: var( --hc-panel2 );
	transition: background 0.3s ease, color 0.3s ease;
}
.a2ehc-level__pill::before {
	content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: 0.9;
}
.a2ehc-level[data-level="below"] .a2ehc-level__pill { color: var( --hc-bad ); background: color-mix( in srgb, var( --hc-bad ) 13%, transparent ); }
.a2ehc-level[data-level="above"] .a2ehc-level__pill { color: var( --hc-brand ); background: color-mix( in srgb, var( --hc-brand ) 13%, transparent ); }
.a2ehc-level[data-level="top"] .a2ehc-level__pill { color: var( --hc-good ); background: color-mix( in srgb, var( --hc-good ) 15%, transparent ); }

.a2ehc-level__eval { font-size: 12.5px; color: var( --hc-muted ); font-variant-numeric: tabular-nums; }

.a2ehc-meter { display: grid; gap: 8px; }
.a2ehc-meter__track {
	position: relative; height: 10px; border-radius: 999px;
	background: var( --hc-panel2 ); overflow: hidden;
}
.a2ehc-meter__fill {
	display: block; height: 100%; width: 0; border-radius: 999px;
	background: linear-gradient( 90deg, var( --hc-brand-2 ), var( --hc-brand ) );
	transition: width 0.8s cubic-bezier( 0.22, 1, 0.36, 1 ), background 0.4s ease;
}
.a2ehc-meter[data-level="below"] .a2ehc-meter__fill { background: linear-gradient( 90deg, color-mix( in srgb, var( --hc-bad ) 70%, #000 0% ), var( --hc-bad ) ); }
.a2ehc-meter[data-level="above"] .a2ehc-meter__fill { background: linear-gradient( 90deg, var( --hc-brand-2 ), var( --hc-brand ) ); }
.a2ehc-meter[data-level="top"] .a2ehc-meter__fill { background: linear-gradient( 90deg, var( --hc-brand ), var( --hc-good ) ); }

.a2ehc-meter__ticks { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; gap: 8px; }
.a2ehc-meter__ticks li {
	font-size: 11.5px; font-weight: 600; color: var( --hc-muted ); opacity: 0.6;
	position: relative; padding-top: 12px; flex: 1; text-align: center; transition: color 0.3s ease, opacity 0.3s ease;
}
.a2ehc-meter__ticks li:first-child { text-align: left; }
.a2ehc-meter__ticks li:last-child { text-align: right; }
.a2ehc-meter__ticks li::before {
	content: ""; position: absolute; top: 0; left: 50%; transform: translateX( -50% );
	width: 8px; height: 8px; border-radius: 50%; background: var( --hc-line ); transition: background 0.3s ease, transform 0.3s ease;
}
.a2ehc-meter__ticks li:first-child::before { left: 4px; }
.a2ehc-meter__ticks li:last-child::before { left: auto; right: 4px; transform: none; }
.a2ehc-meter__ticks li.is-on { opacity: 1; }
.a2ehc-meter__ticks li.is-on::before { background: var( --hc-brand ); }
.a2ehc-meter[data-level="below"] li.is-current { color: var( --hc-bad ); }
.a2ehc-meter[data-level="below"] li.is-current::before { background: var( --hc-bad ); }
.a2ehc-meter[data-level="above"] li.is-current { color: var( --hc-brand ); }
.a2ehc-meter[data-level="top"] li.is-current { color: var( --hc-good ); }
.a2ehc-meter[data-level="top"] li.is-current::before { background: var( --hc-good ); transform: translateX( -50% ) scale( 1.3 ); }

.a2ehc-level__text { margin: 0; font-size: 13.5px; color: var( --hc-muted ); }

/* Metrics */
.a2ehc-metrics { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.a2ehc-metric { display: grid; gap: 7px; }
.a2ehc-metric__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.a2ehc-metric__label { font-size: 13.5px; font-weight: 600; color: var( --hc-ink ); }
.a2ehc-metric__chip {
	font-size: 11px; font-weight: 700; letter-spacing: 0.02em; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.a2ehc-metric.is-pass .a2ehc-metric__chip { color: var( --hc-good ); background: color-mix( in srgb, var( --hc-good ) 15%, transparent ); }
.a2ehc-metric.is-warn .a2ehc-metric__chip { color: var( --hc-warn ); background: color-mix( in srgb, var( --hc-warn ) 17%, transparent ); }
.a2ehc-metric.is-fail .a2ehc-metric__chip { color: var( --hc-bad ); background: color-mix( in srgb, var( --hc-bad ) 14%, transparent ); }

.a2ehc-metric__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.a2ehc-metric__val { font-size: 17px; font-weight: 800; color: var( --hc-ink ); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.a2ehc-metric__target { font-size: 12px; color: var( --hc-muted ); font-weight: 600; }

.a2ehc-metric__bar { display: block; height: 7px; border-radius: 999px; background: var( --hc-panel2 ); overflow: hidden; }
.a2ehc-metric__fill { display: block; height: 100%; border-radius: 999px; background: var( --hc-good ); transition: width 0.6s cubic-bezier( 0.22, 1, 0.36, 1 ), background 0.3s ease; }
.a2ehc-metric.is-warn .a2ehc-metric__fill { background: var( --hc-warn ); }
.a2ehc-metric.is-fail .a2ehc-metric__fill { background: var( --hc-bad ); }

.a2ehc-metric__need { font-size: 12px; font-weight: 600; color: var( --hc-brand ); }

/* Panels */
.a2ehc__panels { margin-top: clamp( 16px, 2.4vw, 24px ); display: grid; gap: clamp( 16px, 2.4vw, 22px ); }

.a2ehc-recover { padding: clamp( 16px, 2.2vw, 22px ); border-radius: 14px; background: var( --hc-panel ); border: 1px dashed color-mix( in srgb, var( --hc-brand ) 40%, var( --hc-line ) ); }
.a2ehc-recover__title, .a2ehc-fix__title {
	display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
	font-size: 15px; font-weight: 700; color: var( --hc-ink );
}
.a2ehc-recover__title .a2ehc-ic, .a2ehc-fix__title .a2ehc-ic { width: 22px; height: 22px; color: var( --hc-brand ); }

.a2ehc-recover__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media ( max-width: 540px ) { .a2ehc-recover__grid { grid-template-columns: 1fr; } }

.a2ehc-rc { padding: 16px; border-radius: 12px; background: var( --hc-bg ); border: 1px solid var( --hc-line ); }
.a2ehc-rc.is-top { border-color: color-mix( in srgb, var( --hc-brand ) 40%, var( --hc-line ) ); }
.a2ehc-rc.is-good { border-color: color-mix( in srgb, var( --hc-good ) 45%, var( --hc-line ) ); background: color-mix( in srgb, var( --hc-good ) 7%, var( --hc-bg ) ); }
.a2ehc-rc__label {
	display: flex; align-items: center; gap: 6px; margin: 0 0 8px;
	font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var( --hc-muted );
}
.a2ehc-rc__label .a2ehc-ic { width: 16px; height: 16px; color: var( --hc-brand ); }
.a2ehc-rc.is-good .a2ehc-rc__label .a2ehc-ic { color: var( --hc-good ); }
.a2ehc-rc__big { margin: 0; font-size: 34px; font-weight: 800; line-height: 1; color: var( --hc-brand ); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.a2ehc-rc.is-good .a2ehc-rc__big { color: var( --hc-good ); font-size: 26px; }
.a2ehc-rc__lead { margin: 6px 0 0; font-size: 13px; color: var( --hc-ink ); }
.a2ehc-rc__bind { margin: 8px 0 0; font-size: 12.5px; color: var( --hc-warn ); font-weight: 600; }
.a2ehc-rc__sub { margin: 8px 0 0; font-size: 12.5px; color: var( --hc-muted ); }
.a2ehc-recover__note { margin: 12px 0 0; font-size: 12px; color: var( --hc-muted ); }

/* Suggestions */
.a2ehc-fix { padding: clamp( 16px, 2.2vw, 22px ); border-radius: 14px; background: var( --hc-panel ); border: 1px solid var( --hc-line ); }
.a2ehc-fix__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px 22px; }
@media ( min-width: 680px ) { .a2ehc-fix__list { grid-template-columns: 1fr 1fr; } }
.a2ehc-fix__item { display: flex; gap: 10px; font-size: 13px; color: var( --hc-muted ); }
.a2ehc-fix__item strong { color: var( --hc-ink ); }
.a2ehc-fix__item .a2ehc-ic { width: 20px; height: 20px; margin-top: 1px; color: var( --hc-brand ); }

.a2ehc-trplus { display: flex; gap: 10px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var( --hc-line ); font-size: 12.5px; color: var( --hc-muted ); }
.a2ehc-trplus strong { color: var( --hc-ink ); }
.a2ehc-trplus .a2ehc-ic { width: 18px; height: 18px; margin-top: 1px; color: var( --hc-good ); }
.a2ehc-trplus:empty { display: none; }

/* Hire CTA */
.a2ehc-hire {
	margin-top: 22px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
	padding: clamp( 18px, 2.6vw, 26px ); border-radius: 16px; color: #ffffff;
	background: linear-gradient( 135deg, var( --hc-brand-2 ), var( --hc-brand ) 42%, var( --hc-brand-3 ) );
}
.a2ehc-hire__copy { flex: 1 1 320px; }
.a2ehc-hire__copy h3 { margin: 0 0 6px; font-size: clamp( 18px, 2.4vw, 22px ); color: inherit; }
.a2ehc-hire__copy p { margin: 0; font-size: 14px; opacity: 0.94; }
.a2ehc-hire__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Buttons */
.a2ehc-btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px;
	font-size: 15px; font-weight: 700; text-decoration: none; border: 0; border-radius: 10px; cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.a2ehc-btn:hover { transform: translateY( -1px ); }
.a2ehc-btn .a2ehc-ic { width: 20px; height: 20px; }
.a2ehc-btn--wa { background: var( --hc-wa ); color: #06351a; box-shadow: 0 10px 24px rgba( 37, 211, 102, 0.35 ); }
.a2ehc-btn--ghost { background: rgba( 255, 255, 255, 0.14 ); color: #fff; border: 1px solid rgba( 255, 255, 255, 0.45 ); }
.a2ehc-btn--primary { background: var( --hc-brand ); color: #fff; }
.a2ehc-btn.is-busy { opacity: 0.7; cursor: progress; }
.a2ehc-btn[disabled] { cursor: not-allowed; }

/* Capture */
.a2ehc-capture {
	margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center;
	padding: clamp( 16px, 2.4vw, 22px ); border: 1px solid var( --hc-line ); border-radius: 16px; background: var( --hc-panel );
}
@media ( max-width: 720px ) { .a2ehc-capture { grid-template-columns: 1fr; } }
.a2ehc-capture__copy h3 { margin: 0 0 6px; font-size: 18px; color: var( --hc-ink ); }
.a2ehc-capture__copy p { margin: 0; font-size: 13.5px; color: var( --hc-muted ); }
.a2ehc-capture__form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.a2ehc-capture__form input[type="text"], .a2ehc-capture__form input[type="email"] {
	width: 100%; padding: 11px 13px; font-size: 15px; color: var( --hc-ink );
	background: var( --hc-bg ); border: 1px solid var( --hc-line ); border-radius: 10px;
}
.a2ehc-capture__form input:focus { outline: none; border-color: var( --hc-brand ); box-shadow: 0 0 0 3px color-mix( in srgb, var( --hc-brand ) 22%, transparent ); }
.a2ehc-capture__form .a2ehc-btn--primary { grid-column: 1 / -1; justify-content: center; }
.a2ehc-result { grid-column: 1 / -1; font-size: 13.5px; padding: 10px 12px; border-radius: 10px; }
.a2ehc-result.is-ok { color: #06351a; background: color-mix( in srgb, var( --hc-good ) 16%, transparent ); }
.a2ehc-result.is-err { color: #5a1511; background: color-mix( in srgb, var( --hc-bad ) 14%, transparent ); }

.a2ehc-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect( 0 0 0 0 ); white-space: nowrap; border: 0; }
.a2ehc-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.a2ehc__fine { margin: 16px 0 0; font-size: 12px; color: var( --hc-muted ); text-align: center; }

/* Entrance animation (plays once when the engine reveals results). */
.a2ehc.is-revealed .a2ehc__results { animation: a2ehc-rise 0.55s cubic-bezier( 0.22, 1, 0.36, 1 ) both; }
.a2ehc.is-revealed .a2ehc__panels { animation: a2ehc-rise 0.55s cubic-bezier( 0.22, 1, 0.36, 1 ) 0.08s both; }
@keyframes a2ehc-rise { from { opacity: 0; transform: translateY( 10px ); } to { opacity: 1; transform: none; } }

@media ( prefers-reduced-motion: reduce ) {
	.a2ehc *, .a2ehc *::before, .a2ehc *::after { animation: none !important; transition: none !important; }
}

/* color-mix fallback for older browsers. */
@supports not ( color: color-mix( in srgb, #000 10%, #fff ) ) {
	.a2ehc__badge { background: #eaf1ff; }
	.a2ehc-level[data-level="below"] .a2ehc-level__pill { background: #fdecea; }
	.a2ehc-level[data-level="above"] .a2ehc-level__pill { background: #eaf1ff; }
	.a2ehc-level[data-level="top"] .a2ehc-level__pill { background: #e7f6ef; }
	.a2ehc-metric.is-pass .a2ehc-metric__chip { background: #e7f6ef; }
	.a2ehc-metric.is-warn .a2ehc-metric__chip { background: #fdf0da; }
	.a2ehc-metric.is-fail .a2ehc-metric__chip { background: #fdecea; }
	.a2ehc-input input:focus, .a2ehc-input select:focus, .a2ehc-capture__form input:focus { box-shadow: 0 0 0 3px rgba( 31, 111, 235, 0.22 ); }
	.a2ehc-result.is-ok { background: #e7f6ef; }
	.a2ehc-result.is-err { background: #fdecea; }
}

/* Standalone dark mode (only when the host theme defines no tokens). */
@media ( prefers-color-scheme: dark ) {
	.a2ehc {
		--hc-bg-d: #0c1024;
		--hc-panel-d: #10152d;
		--hc-panel2-d: #171d3b;
		--hc-ink-d: #eef1ff;
		--hc-muted-d: #a7afd2;
		--hc-line-d: rgba( 160, 175, 255, 0.14 );
	}
}
