/*
 * v1.7.763 - Individual campaign credits ([efm_credit_sale]).
 *
 * The packs stylesheet (efm-package-pack.css) is the dependency and does nearly all of the
 * work: surfaces, steps, result rows, fields, summary and the buy button are shared, so the
 * two pages cannot drift apart and a restyle only has to happen once. Everything here is a
 * rule the packs page has no use for.
 *
 * WHAT IS CREDIT-ONLY
 *   1  the quantity stepper and the quick-pick chips
 *   2  the live price block, which is the whole argument of the page
 *   3  .efm-credit-was, the struck-through normal price, used in three places
 *
 * COLOUR
 * The saving is the one thing on the page that has to be seen before it is read, so it is
 * the only warm colour, and it is used in exactly one place per screen. Contrast on the
 * dark surface is kept above 4.5:1.
 */

.efm-credit-sale-noop { display: none; }

/* ------------------------------------------------------------------ *
 * The struck-through normal price
 * ------------------------------------------------------------------ */

.efm-credit-was {
	color: #93A0AB;
	text-decoration: line-through;
	/* The browser's default strike sits too low over tabular figures. */
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	font-weight: 500;
	margin-right: 8px;
	white-space: nowrap;
}

/* In the area list the struck price sits beside the sale price on one line. */
.efm-pack-result-from .efm-credit-was {
	display: inline;
	font-size: 0.9em;
}

/* In the summary it sits ABOVE the total, right-aligned with it. */
.efm-credit-sum-right {
	text-align: right;
}
.efm-credit-sum-right .efm-credit-was {
	display: block;
	margin: 0 0 2px;
	font-size: 0.95rem;
}

/* ------------------------------------------------------------------ *
 * The quantity stepper
 * ------------------------------------------------------------------ */

.efm-credit-stepper {
	display: flex;
	align-items: stretch;
	justify-content: center;
	gap: 10px;
	margin: 18px 0 14px;
}

.efm-credit-step {
	width: 56px;
	min-height: 56px;
	border: 1px solid #39424B;
	border-radius: 12px;
	background: #20262C;
	color: #F2F5F7;
	font-size: 1.5rem;
	line-height: 1;
	font-weight: 600;
	cursor: pointer;
	transition: background .12s ease, border-color .12s ease;
}
.efm-credit-step:hover:not(:disabled) {
	background: #2A323A;
	border-color: #4C5863;
}
.efm-credit-step:focus-visible {
	outline: 2px solid #7FB2E5;
	outline-offset: 2px;
}
.efm-credit-step:disabled {
	opacity: .35;
	cursor: not-allowed;
}

.efm-credit-qty {
	width: 110px;
	text-align: center;
	font-size: 1.75rem;
	font-weight: 700;
	padding: 8px 4px;
	border: 1px solid #39424B;
	border-radius: 12px;
	background: #171C21;
	color: #FFFFFF;
	font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
}
.efm-credit-qty::-webkit-outer-spin-button,
.efm-credit-qty::-webkit-inner-spin-button {
	/* The native spinners are far too small to hit on a phone, which is why the
	   stepper buttons exist; showing both just makes the control ambiguous. */
	-webkit-appearance: none;
	margin: 0;
}
.efm-credit-qty:focus-visible {
	outline: 2px solid #7FB2E5;
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * Quick picks
 * ------------------------------------------------------------------ */

.efm-credit-quick {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0 0 18px;
}

.efm-credit-chip {
	min-width: 48px;
	padding: 8px 14px;
	border: 1px solid #39424B;
	border-radius: 999px;
	background: transparent;
	color: #C7D0D8;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	font-variant-numeric: tabular-nums;
	transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.efm-credit-chip:hover {
	border-color: #6A7681;
	color: #FFFFFF;
}
.efm-credit-chip.is-on {
	background: #F2F5F7;
	border-color: #F2F5F7;
	color: #12161A;
}
.efm-credit-chip:focus-visible {
	outline: 2px solid #7FB2E5;
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * The live price block
 *
 * This is the page's argument, so it gets the one panel that is visibly its own
 * thing rather than another row inside the surface.
 * ------------------------------------------------------------------ */

.efm-credit-price {
	background: linear-gradient(180deg, #1E2226, #121518);
	border: 1px solid #343C44;
	border-radius: 14px;
	padding: 18px 16px;
	margin: 0 0 18px;
	text-align: center;
}

.efm-credit-price-head {
	display: flex;
	align-items: baseline;
	justify-content: center;
	flex-wrap: wrap;
	gap: 2px;
}

.efm-credit-now {
	font-size: 2.25rem;
	font-weight: 800;
	line-height: 1.1;
	color: #FFFFFF;
	font-variant-numeric: tabular-nums;
}
.efm-credit-price-head .efm-credit-was {
	font-size: 1.15rem;
}

.efm-credit-rate {
	margin: 6px 0 0;
	font-size: 0.95rem;
	color: #A9B4BE;
}

.efm-credit-save {
	margin: 12px auto 0;
	display: inline-block;
	padding: 7px 14px;
	border-radius: 999px;
	background: #3A2A10;
	border: 1px solid #6B4E18;
	color: #FFD489;
	font-size: 0.98rem;
}
.efm-credit-save strong {
	color: #FFE3AE;
	font-weight: 700;
}

/* ------------------------------------------------------------------ *
 * Phones
 * ------------------------------------------------------------------ */

@media (max-width: 760px) {
	.efm-credit-step { width: 52px; min-height: 52px; }
	.efm-credit-qty  { width: 92px; font-size: 1.5rem; }
	.efm-credit-now  { font-size: 1.9rem; }

	/* With the struck price on its own line the two numbers stop competing for the
	   same baseline on a narrow screen. */
	.efm-credit-price-head { display: block; }
	.efm-credit-price-head .efm-credit-was { display: block; margin: 0 0 2px; }
}
