/**
 * PMPro checkout of a credit pack (features 090, 091): the payment button
 * takes the charter's `cta` role, the pack's name and price share a line, the
 * reassurance box is a charter box, the card fields share a line on a wide
 * screen.
 *
 * Colours are brand tokens only (CreapulseTools\Brand, injected inline as CSS
 * variables next to this sheet); see brand/visual-identity.md, sections
 * Boutons and Encadrés. Selectors start with `.pmpro`: PMPro's variation
 * sheet styles its fields with nested `.pmpro …` rules, and Enfold's merged
 * sheet resets list items with `.entry-content-wrapper li` (0,1,1), loaded
 * after this one.
 */

/* stylelint-disable selector-class-pattern, selector-id-pattern -- PMPro's own names. */

/* The pack's card: name and price on a line, then the description, then a
   discount note. PMPro prints the three as siblings; its cost block is
   dissolved so that the price and the note are placed apart. */
.pmpro #pmpro_pricing_fields .pmpro_card_content {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 1em;
}

.pmpro #pmpro_pricing_fields .pmpro_card_content > * {
	order: 5;
	flex-basis: 100%;
}

.pmpro #pmpro_pricing_fields .pmpro_card_content .pmpro_level_name_text {
	order: 1;
	flex-basis: auto;
	margin: 0;
}

.pmpro #pmpro_pricing_fields .pmpro_card_content #pmpro_level_cost {
	display: contents;
}

.pmpro #pmpro_pricing_fields .pmpro_card_content .pmpro_level_cost_text {
	order: 2;
	flex-basis: auto;
	font-weight: 700;
	font-size: 1.25em;
	margin: 0;
}

.pmpro #pmpro_pricing_fields .pmpro_level_cost_text p {
	margin: 0;
}

.pmpro #pmpro_pricing_fields .pmpro_card_content .pmpro_level_description_text {
	order: 3;
	flex-basis: 100%;
}

.pmpro #pmpro_pricing_fields .pmpro_card_content .pmpro_level_discount_applied {
	order: 4;
	flex-basis: 100%;
}

/* The discount code is asked once, in the payment fields: the card's own
   prompt is hidden while those fields are shown (when a code makes the order
   free they are hidden, and the card's prompt comes back to change it). */
.pmpro_form:not(:has(#pmpro_payment_information_fields[style*="display: none"])) #pmpro_pricing_fields .pmpro_card_actions {
	display: none;
}

/* The discount code's field and its button side by side: the theme puts a
   bottom margin under every text input, which PMPro's centred row counts, so
   the button sat lower than the field. Same height for both, no margin. */
.pmpro #pmpro_payment_information_fields .pmpro_payment-discount-code .pmpro_form_fields-inline {
	align-items: stretch;
}

.pmpro #pmpro_payment_information_fields .pmpro_payment-discount-code .pmpro_form_fields-inline input {
	margin: 0;
}

/* « Appliquer »: a utility action, the charter's `quiet` role, so that it
   does not compete with the payment button. On hover the label turns white
   with the fill, or it would read at 1:1; focus keeps the ring alone. */
.pmpro #discount_code_button {
	background-color: transparent;
	color: var(--cp-primary-fill);
	font-weight: 600;
	text-transform: none;
	border: 1px solid var(--cp-primary);
	border-radius: 6px;
	box-shadow: none;
}

.pmpro #discount_code_button:focus {
	background-color: transparent;
	color: var(--cp-primary-fill);
	box-shadow: none;
}

.pmpro #discount_code_button:hover {
	background-color: var(--cp-primary-fill);
	color: var(--cp-on-fill);
}

.pmpro #discount_code_button:focus-visible {
	outline: 2px solid var(--cp-primary-fill);
	outline-offset: 2px;
}

/* The payment button: the charter's `cta` role. */
.pmpro #pmpro_btn-submit {
	background-color: var(--cp-accent-fill);
	color: var(--cp-on-fill);
	font-weight: 600;
	text-transform: none;
	border: 0;
	border-radius: 6px;
	box-shadow: none;
}

/* Focus keeps the fill: the charter marks it with the ring alone. */
.pmpro #pmpro_btn-submit:focus {
	background-color: var(--cp-accent-fill);
	color: var(--cp-on-fill);
	box-shadow: none;
}

.pmpro #pmpro_btn-submit:hover {
	background-color: var(--cp-accent-hover);
	color: var(--cp-on-fill);
	box-shadow: none;
}

.pmpro #pmpro_btn-submit:focus-visible {
	outline: 2px solid var(--cp-accent-fill);
	outline-offset: 2px;
}

.pmpro #pmpro_btn-submit:disabled {
	opacity: 0.5;
}

/* Card number, then expiry and CVC (already a 50/50 `.pmpro_cols-2` above
   767 px): half and half, so expiry and CVC are a quarter each. The discount
   code keeps its own line. PMPro's breakpoint is `max-width: 767px`. */
@media (min-width: 768px) {

	.pmpro #pmpro_payment_information_fields .pmpro_form_fields {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.pmpro #pmpro_payment_information_fields .pmpro_payment-account-number,
	#pmpro_payment_information_fields .pmpro_cols-2:has(.pmpro_payment-expiration) {
		flex: 1 1 0;
		min-width: 0;
	}

	#pmpro_payment_information_fields .pmpro_cols-2:has(.pmpro_payment-discount-code) {
		flex-basis: 100%;
	}
}

/* stylelint-enable selector-class-pattern, selector-id-pattern */

/* A pack's confirmation page (092): the button to the tools, the charter's
   `cta` role, as the payment button. */
.pmpro .cpt-confirmation-actions {
	margin: 1.5em 0;
}

.pmpro a.cpt-confirmation-button {
	display: inline-block;
	padding: 0.75em 1.5em;
	background-color: var(--cp-accent-fill);
	color: var(--cp-on-fill);
	font-weight: 600;
	border-radius: 6px;
}

/*
 * A button, not a link: no underline. The theme underlines every link of the
 * content with a selector carrying an id (`#top .entry-content-wrapper
 * .entry-content a:not(…)`, seen 2026-11-15), which no class of ours can
 * outweigh: hence !important, on this one property of our own button.
 */
.pmpro a.cpt-confirmation-button,
.pmpro a.cpt-confirmation-button:hover,
.pmpro a.cpt-confirmation-button:focus {
	text-decoration: none !important;
}

.pmpro a.cpt-confirmation-button:hover {
	background-color: var(--cp-accent-hover);
	color: var(--cp-on-fill);
}

.pmpro a.cpt-confirmation-button:focus {
	color: var(--cp-on-fill);
}

.pmpro a.cpt-confirmation-button:focus-visible {
	outline: 2px solid var(--cp-accent-fill);
	outline-offset: 2px;
}

/* The two consent boxes before the button (092). */
.cpt-checkout-consents {
	margin: 1.5em 0;
}

.cpt-checkout-consent small {
	color: var(--cp-ink-muted);
}

/* The reassurance at the top of the form. */
.cpt-checkout-lead {
	margin: 1em 0;
}

/* The reassurance box, before the button. */
.cpt-checkout-reassurance {
	margin: 1.5em 0;
	padding: 1em 1.25em;
	background-color: var(--cp-surface-subtle);
	border: 1px solid var(--cp-rule);
	border-left: 4px solid var(--cp-primary);
	border-radius: 8px;
}

.pmpro .cpt-checkout-reassurance ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pmpro .cpt-checkout-reassurance li {
	display: flex;
	gap: 0.5em;
	list-style: none;
	margin-left: 0;
	padding-left: 0;
	margin-top: 0.25em;
	margin-bottom: 0.25em;
}

.cpt-checkout-icon {
	flex: none;
}

/* A discount code that makes the order free: PMPro hides the payment fields
   (jQuery writes `display: none`; another `none`, a border say, must not match). */
/* stylelint-disable selector-class-pattern, selector-id-pattern -- PMPro's own names. */
.pmpro_form:has(#pmpro_payment_information_fields[style*="display: none"]) .cpt-checkout-reassurance,
.pmpro_form:has(#pmpro_payment_information_fields[style*="display: none"]) .cpt-checkout-lead {
	display: none;
}
/* stylelint-enable selector-class-pattern, selector-id-pattern */
