/**
 * Conversion helpers (inc/cro.php, assets/js/cro.js): plan microcopy, period
 * badge, objections, plan recommender, mobile sticky bar, focused checkout.
 * Tokens only (STYLEGUIDE.md); every block reads the canvas it sits on.
 */

/* =========================================================================
 * 1. Plan cards & period selector
 * ====================================================================== */

.hw-cro-assure {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 0.4em;
	margin: 0.15rem 0 0;
	color: var(--hw-text-muted);
	font-size: var(--hw-fs-xs);
	line-height: 1.45;
	text-align: center;
}

.hw-cro-assure .hw-icon {
	flex: 0 0 auto;
	width: 1.05em;
	height: 1.05em;
	margin-top: 0.12em;
	color: var(--hw-success-text, var(--hw-cyan));
}

/* .hw-period__pop ("Le plus choisi" over the period pill): main.css, render-critical
 * since the period selector shows in the first screen of /tarifs/ (CLS). */

.hw-term__flag--pop,
.hw-plan-v2 .hw-term__flag--pop { background: var(--hw-light-text, var(--hw-surface-3)); color: #fff; }

/* Recommended card (after the recommender). */
.hw-plan.is-reco {
	outline: 2px solid var(--hw-cyan);
	outline-offset: 4px;
}

.hw-plan__reco-badge {
	position: absolute;
	top: -0.85rem;
	right: 1rem;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.3em 0.75em;
	border-radius: var(--hw-radius-pill);
	background: var(--hw-cyan);
	color: #031a29;
	font-size: var(--hw-fs-2xs, 0.72rem);
	font-weight: 800;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

/* =========================================================================
 * 2. Under the plans: recommender + objections
 * ====================================================================== */

.hw-plans__more > .hw-reco,
.hw-plans__more > .hw-cro-obj { flex: 1 1 100%; }

.hw-reco {
	max-width: 880px;
	margin: 0 auto;
	border: 1px solid var(--hw-border);
	border-radius: var(--hw-radius-lg);
	background: var(--hw-glass, rgba(255, 255, 255, 0.04));
	box-shadow: var(--hw-inner-hl);
}

.hw-reco__toggle {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-height: 56px;
	padding: 0.85rem 1.25rem;
	border-radius: inherit;
	color: var(--hw-text);
	font-family: var(--hw-font-head);
	font-weight: 700;
	cursor: pointer;
	list-style: none;
}

.hw-reco__toggle::-webkit-details-marker { display: none; }

.hw-reco__toggle:focus-visible { outline: 2px solid var(--hw-cyan); outline-offset: 3px; }

.hw-reco__toggle-icon {
	display: inline-grid;
	flex: 0 0 auto;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 12px;
	background: rgba(1, 200, 239, 0.14);
	color: var(--hw-cyan);
}

.hw-reco__toggle-text { flex: 1 1 auto; }

.hw-reco__chevron { flex: 0 0 auto; transition: transform var(--hw-dur) var(--hw-ease); }

.hw-reco[open] .hw-reco__chevron { transform: rotate(180deg); }

.hw-reco__body { padding: 0 1.25rem 1.25rem; }

.hw-reco__title {
	margin: 0.25rem 0 0.35rem;
	color: var(--hw-text);
	font-family: var(--hw-font-head);
	font-size: var(--hw-fs-lg);
	font-weight: 800;
}

.hw-reco__intro { margin: 0 0 1rem; color: var(--hw-text-muted); font-size: var(--hw-fs-sm); }

.hw-reco__form { display: grid; gap: 1rem; }

.hw-reco__q { margin: 0; padding: 0; border: 0; min-width: 0; }

.hw-reco__legend {
	margin-bottom: 0.5rem;
	padding: 0;
	color: var(--hw-text);
	font-size: var(--hw-fs-sm);
	font-weight: 700;
}

.hw-reco__opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }

.hw-reco__opt { position: relative; display: block; cursor: pointer; }

.hw-reco__opt input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.hw-reco__opt span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--hw-border);
	border-radius: var(--hw-radius);
	background: rgba(255, 255, 255, 0.03);
	color: var(--hw-text-muted);
	font-size: var(--hw-fs-sm);
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	transition: border-color var(--hw-dur-fast) var(--hw-ease), background-color var(--hw-dur-fast) var(--hw-ease), color var(--hw-dur-fast) var(--hw-ease);
}

.hw-reco__opt:hover span { border-color: var(--hw-border-strong); color: var(--hw-text); }

.hw-reco__opt input:checked + span {
	border-color: var(--hw-cyan);
	background: rgba(1, 200, 239, 0.12);
	color: var(--hw-text);
	box-shadow: inset 0 0 0 1px var(--hw-cyan);
}

.hw-reco__opt input:focus-visible + span { outline: 2px solid var(--hw-cyan); outline-offset: 2px; }

.hw-reco__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }

.hw-reco__msg { margin: 0; color: var(--hw-text-muted); font-size: var(--hw-fs-sm); }

.hw-reco__msg:empty { display: none; }

.hw-reco__result {
	margin-top: 1rem;
	padding: 1.1rem 1.2rem;
	border: 1px solid rgba(1, 200, 239, 0.35);
	border-radius: var(--hw-radius);
	background: rgba(1, 200, 239, 0.07);
}

.hw-reco__result:focus { outline: none; }

.hw-reco__result:focus-visible { outline: 2px solid var(--hw-cyan); outline-offset: 3px; }

.hw-reco__result-title {
	margin: 0 0 0.75rem;
	color: var(--hw-text);
	font-family: var(--hw-font-head);
	font-size: var(--hw-fs-lg);
	font-weight: 800;
}

.hw-reco__why { margin: 0 0 1rem; text-align: left; }

.hw-reco__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; }

.hw-cro-obj {
	max-width: 1120px;
	margin: var(--hw-space-4, 1rem) auto 0;
}

.hw-cro-obj__list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hw-cro-obj__item {
	display: flex;
	gap: 0.7rem;
	padding: 1rem;
	border: 1px solid var(--hw-border-soft, var(--hw-border));
	border-radius: var(--hw-radius);
	background: rgba(255, 255, 255, 0.025);
	color: var(--hw-text-muted);
	font-size: var(--hw-fs-xs);
	line-height: 1.5;
	text-align: left;
}

.hw-cro-obj__item strong { display: block; margin-bottom: 0.15rem; color: var(--hw-text); font-size: var(--hw-fs-sm); }

.hw-cro-obj__icon {
	display: inline-grid;
	flex: 0 0 auto;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 10px;
	background: rgba(1, 200, 239, 0.12);
	color: var(--hw-cyan);
}

.hw-cro-obj__vat {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 0.45rem;
	max-width: 760px;
	margin: 0.9rem auto 0;
	color: var(--hw-text-faint);
	font-size: var(--hw-fs-xs);
	text-align: left;
}

.hw-cro-obj__vat .hw-icon { flex: 0 0 auto; margin-top: 0.15em; }

@media (max-width: 999.98px) {
	.hw-cro-obj__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
	.hw-cro-obj__list { grid-template-columns: minmax(0, 1fr); }

	.hw-reco__opts { grid-template-columns: minmax(0, 1fr); }

	.hw-reco__opt span { justify-content: flex-start; min-height: 44px; text-align: left; }

	.hw-reco__toggle { padding: 0.75rem 1rem; font-size: var(--hw-fs-sm); }

	.hw-reco__body { padding: 0 1rem 1rem; }
}

/* =========================================================================
 * 3. Mobile sticky bar (home, pricing, landings) — never on desktop
 * ====================================================================== */

.hw-cro-sticky {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.7rem max(var(--hw-gutter), env(safe-area-inset-right)) calc(0.7rem + env(safe-area-inset-bottom)) max(var(--hw-gutter), env(safe-area-inset-left));
	border-top: 1px solid var(--hw-border);
	background: rgba(5, 6, 49, 0.95);
	box-shadow: 0 -12px 30px -18px rgba(0, 0, 0, 0.8);
	transform: translateY(110%);
	visibility: hidden;
	transition: transform var(--hw-dur) var(--hw-ease), visibility 0s linear var(--hw-dur);
}

.hw-cro-sticky.is-visible {
	transform: translateY(0);
	visibility: visible;
	transition: transform var(--hw-dur) var(--hw-ease), visibility 0s;
}

.hw-cro-sticky[hidden] { display: none; }

.hw-cro-sticky__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 0.3em;
	min-width: 0;
	margin: 0;
	color: var(--hw-text-muted);
	font-size: var(--hw-fs-xs);
	line-height: 1.3;
}

.hw-cro-sticky__price strong { color: #fff; font-family: var(--hw-font-head); font-size: var(--hw-fs-lg); font-variant-numeric: tabular-nums; }

.hw-cro-sticky__from { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--hw-cyan); }

.hw-cro-sticky .hw-btn { flex: 0 0 auto; }

@media (min-width: 1000px) {
	.hw-cro-sticky { display: none !important; }
}

/* Plan page bar: hidden while the hero button is on screen (cro.js). */
.hw-plan-sticky.is-visible.hw-cro-hide { transform: translateY(110%); }

@media (prefers-reduced-motion: reduce) {
	.hw-cro-sticky,
	.hw-cro-sticky.is-visible,
	.hw-reco__chevron { transition: none; }
}

@media print {
	.hw-cro-sticky,
	.hw-reco { display: none !important; }
}

/* =========================================================================
 * 4. Focused checkout (body.hw-checkout-focus)
 * ====================================================================== */

.hw-checkout-focus .hw-header__nav,
.hw-checkout-focus .hw-header__cta,
.hw-checkout-focus .hw-header__burger { display: none !important; }

.hw-cro-focus__secure,
.hw-cro-focus__help {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	color: var(--hw-text-muted);
	font-size: var(--hw-fs-sm);
	font-weight: 600;
	white-space: nowrap;
}

.hw-cro-focus__secure .hw-icon { color: var(--hw-success, #37c267); }

.hw-cro-focus__help { margin-right: var(--hw-space-2); color: var(--hw-text); text-decoration: none; }

.hw-cro-focus__help:hover { color: var(--hw-cyan); }

@media (max-width: 640px) {
	/* Phones: the hero already says "Paiement sécurisé"; the help link becomes an icon button. */
	.hw-cro-focus__secure { display: none; }

	.hw-cro-focus__help > span:not(.hw-visually-hidden) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

	.hw-cro-focus__help { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-right: 0; border: 1px solid var(--hw-border); border-radius: 12px; }

	/* Optional domain step: one line of hint, it must not push the form down. */
	.hw-domain-step--checkout .hw-domain-step__hint { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
}

/* Under the pay button. */
.hw-cro-paynote {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 0.45em;
	margin: 0.85rem 0 0;
	color: var(--hw-text-muted);
	font-size: var(--hw-fs-xs);
	line-height: 1.5;
	text-align: center;
}

.hw-cro-paynote .hw-icon { flex: 0 0 auto; width: 1em; height: 1em; margin-top: 0.2em; color: var(--hw-success-text, var(--hw-text-muted)); }

/* Company / VAT switch. */
.hw-cro-company {
	grid-column: 1 / -1;
	margin: -0.2rem 0 1.05rem;
}

.hw-cro-company label {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.6rem;
	color: var(--hw-text);
	font-size: var(--hw-fs-sm);
	font-weight: 600;
	cursor: pointer;
}

.hw-cro-company input { width: 1.15rem; height: 1.15rem; margin: 0.12rem 0 0; accent-color: var(--hw-light-accent, var(--hw-accent)); }

/* Inline validation. */
.hw-cro-field-error {
	margin: 0.4rem 0 0;
	color: var(--hw-danger-text, #b4183a);
	font-size: var(--hw-fs-xs);
	font-weight: 600;
}

.woocommerce form .form-row.woocommerce-validated input.input-text { border-color: var(--hw-success-text, #157a3c); }

/* Collapsible summary on phones. */
.hw-cro-summary-toggle { display: none; }

@media (max-width: 999.98px) {
	.hw-cro-summary-toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
		width: 100%;
		min-height: 52px;
		margin: 0 0 0.25rem;
		padding: 0.75rem 1rem;
		border: 1px solid var(--hw-border);
		border-radius: var(--hw-radius);
		background: var(--hw-surface);
		color: var(--hw-text);
		font: inherit;
		font-weight: 700;
		text-align: left;
		cursor: pointer;
	}

	.hw-cro-summary-toggle__label { display: inline-flex; align-items: center; gap: 0.5rem; }

	.hw-cro-summary-toggle__total { font-family: var(--hw-font-head); font-size: var(--hw-fs-lg); font-variant-numeric: tabular-nums; }

	.hw-cro-summary-toggle .hw-icon { transition: transform var(--hw-dur) var(--hw-ease); }

	.hw-cro-summary-toggle[aria-expanded="true"] .hw-icon { transform: rotate(180deg); }

	.hw-checkout__aside.is-collapsed .hw-checkout__summary { display: none; }
}

/* Express checkout (Stripe Apple Pay / Google Pay) above the details. */
.hw-checkout #wc-stripe-express-checkout-element:not(:empty) { margin-bottom: 0.5rem; }
