/**
 * Managed DMARC Protection checkout. Uses the ARMD theme's palette and field styles.
 *
 * @package armd-enhancements
 */

.armd-dmarc {
	--armd-navy: var(--wp--preset--color--accent-1, #052c53);
	--armd-orange: var(--wp--preset--color--accent-2, #ff6900);
	--armd-sky: var(--wp--preset--color--custom-light-blue, #00b2f4);
	--armd-tint: var(--wp--preset--color--custom-blue-background, #d9edfa);
	--armd-muted: var(--wp--preset--color--accent-4, #686868);
	--armd-line: #e0e0e0;
	--armd-error: #b42318;

	margin: 0 0 40px;
	padding: 28px;
	border: 1px solid var(--armd-line);
	border-radius: 8px;
	background: var(--wp--preset--color--base, #fff);
	color: var(--armd-navy);
}

.armd-dmarc h3 {
	margin: 0 0 20px;
	font-family: var(--wp--preset--font-family--gilroy-bold);
	font-size: var(--wp--preset--font-size--large, 24px);
}

/* Billing choice */
.armd-dmarc__plan {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 0 0 28px;
	padding: 0;
	border: 0;
}

.armd-dmarc__plan legend {
	margin: 0 0 10px;
	padding: 0;
	font-family: var(--wp--preset--font-family--gilroy-medium);
	font-size: 16px;
}

.armd-dmarc__option {
	position: relative;
	display: block;
	margin: 0 !important;
	padding: 18px 18px 18px 50px;
	border: 1px solid var(--armd-line);
	border-radius: 6px;
	cursor: pointer;
	line-height: 1.4 !important;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.armd-dmarc__option:hover {
	border-color: var(--armd-sky);
}

.armd-dmarc__option input[type="radio"] {
	position: absolute;
	top: 21px;
	left: 18px;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--armd-navy);
}

.armd-dmarc__option:has(input:checked) {
	border-color: var(--armd-navy);
	background: color-mix(in srgb, var(--armd-tint) 45%, #fff);
	box-shadow: 0 0 0 1px var(--armd-navy);
}

.armd-dmarc__option:has(input:focus-visible) {
	outline: 2px solid var(--armd-sky);
	outline-offset: 2px;
}

.armd-dmarc__option-title {
	display: block;
	font-family: var(--wp--preset--font-family--gilroy-bold);
	font-size: 18px;
}

.armd-dmarc__option-text {
	display: block;
	margin-top: 4px;
	color: var(--armd-muted);
	font-size: 15px;
}

/* The plan's payment methods, on their own line under the billing line (Anthony, 12 Oct 2026) */
.armd-dmarc__option-pay {
	display: block;
}

.armd-dmarc__badge {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--armd-orange);
	color: #fff;
	font-family: var(--wp--preset--font-family--gilroy-medium);
	font-size: 12px;
	letter-spacing: 0.02em;
	vertical-align: middle;
	white-space: nowrap;
}

/* Domain lists */
.armd-dmarc__list + .armd-dmarc__list {
	margin-top: 28px;
	padding-top: 24px;
	border-top: 1px solid var(--armd-line);
}

.armd-dmarc__list-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.armd-dmarc__list-title {
	font-family: var(--wp--preset--font-family--gilroy-medium);
	font-size: 18px;
}

.armd-dmarc__counter {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--armd-line);
	border-radius: 4px;
	overflow: hidden;
}

.armd-dmarc__step {
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: #fff;
	color: var(--armd-navy);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.armd-dmarc__step:hover:not(:disabled) {
	background: var(--armd-tint);
}

.armd-dmarc__step:focus-visible {
	outline: 2px solid var(--armd-sky);
	outline-offset: -2px;
}

.armd-dmarc__step:disabled {
	color: #b9c2cc;
	cursor: not-allowed;
}

.armd-dmarc__count {
	min-width: 48px;
	border-inline: 1px solid var(--armd-line);
	font-family: var(--wp--preset--font-family--gilroy-bold);
	font-size: 18px;
	line-height: 40px;
	text-align: center;
}

.armd-dmarc__help {
	margin: 6px 0 14px;
	color: var(--armd-muted);
	font-size: 15px;
}

.armd-dmarc__rows {
	margin: 0;
	padding: 0;
	list-style: none;
}

.armd-dmarc__row {
	display: grid;
	grid-template-columns: 32px minmax(0, 1fr) 46px;
	align-items: center;
	gap: 10px;
	margin: 0 0 10px;
}

.armd-dmarc__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--armd-navy);
	color: #fff;
	font-family: var(--wp--preset--font-family--gilroy-medium);
	font-size: 14px;
}

.armd-dmarc [data-list="parked"] .armd-dmarc__number {
	background: var(--armd-muted);
}

.woocommerce form .armd-dmarc__input.input-text,
.armd-dmarc__input.input-text {
	box-sizing: border-box; /* the theme's padding would otherwise push the box under the remove button */
	width: 100%;
	margin: 0;
	padding: 12px 12px !important;
	border: 1px solid var(--armd-line);
	border-radius: 4px !important;
	font-size: 17px !important;
	text-transform: lowercase;
}

.armd-dmarc__input:focus {
	border-color: var(--armd-sky);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--armd-sky) 25%, transparent);
}

.armd-dmarc__input::placeholder {
	text-transform: none;
	color: #9aa5b1;
}

.armd-dmarc__row.is-invalid .armd-dmarc__input {
	border-color: var(--armd-error);
}

.armd-dmarc__remove {
	align-self: stretch; /* as tall as the domain box, like the counter's buttons */
	width: 100%;
	min-height: 40px;
	padding: 0;
	border: 1px solid var(--armd-line);
	border-radius: 4px;
	background: #fff;
	color: var(--armd-muted);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.armd-dmarc__remove:hover {
	background: var(--armd-tint);
	color: var(--armd-navy);
}

.armd-dmarc__remove:focus-visible {
	outline: 2px solid var(--armd-sky);
	outline-offset: 0;
}

.armd-dmarc__error {
	grid-column: 2 / 4;
	color: var(--armd-error);
	font-size: 14px;
}

.armd-dmarc__error:empty {
	display: none;
}

.armd-dmarc__limit {
	margin: 4px 0 0;
	color: var(--armd-muted);
	font-size: 14px;
}

/* Coupon code, under the order summary */
.armd-dmarc-coupon {
	margin: 20px 0 0;
	padding: 18px;
	border: 1px solid #eeeeee;
	border-radius: 6px;
}

.armd-dmarc-coupon label {
	display: block;
	font-family: var(--wp--preset--font-family--gilroy-medium);
	font-size: 16px;
}

.armd-dmarc-coupon__row {
	display: flex;
	gap: 10px;
}

.woocommerce form .armd-dmarc-coupon input.input-text,
.armd-dmarc-coupon input.input-text {
	flex: 1 1 auto;
	min-width: 0;
	padding: 12px !important;
	border: 1px solid #e0e0e0;
	border-radius: 4px !important;
	font-size: 17px !important;
	text-transform: uppercase;
}

.woocommerce form .armd-dmarc-coupon .button {
	flex: 0 0 auto;
	padding: 12px 24px;
}

.armd-coupon-note {
	margin: 0;
	padding: 7px 10px;
	border-left: 3px solid #1a7f37;
	border-radius: 4px;
	background: #edf7ef;
	color: #14532d;
	font-size: 13px;
	line-height: 1.4;
}

.armd-coupon-note--error {
	border-left-color: #b42318;
	background: #fdeceb;
	color: #8a1c12;
}

.armd-dmarc-coupon__message:not(:empty) {
	margin-top: 12px;
}

.armd-dmarc-coupon__message .woocommerce-error,
.armd-dmarc-coupon__message .woocommerce-message,
.armd-dmarc-coupon__message .woocommerce-info {
	margin: 0 !important;
}

/* Domains on the thank-you page and in My Account */
table.armd-dmarc-domains {
	margin: 0 0 24px;
}

@media (max-width: 640px) {
	.armd-dmarc {
		padding: 20px 16px;
	}

	.armd-dmarc__plan {
		grid-template-columns: 1fr;
	}

	.armd-dmarc__list-head {
		flex-wrap: wrap;
	}

	.armd-dmarc__row {
		grid-template-columns: 28px minmax(0, 1fr) 44px;
		gap: 8px;
	}
}

/* "Get a quote", under the coupon box */
.armd-dmarc-quote {
	margin: 16px 0 0;
	padding: 18px;
	border: 1px solid #eeeeee;
	border-radius: 6px;
	background: color-mix(in srgb, var(--wp--preset--color--custom-blue-background, #d9edfa) 35%, #fff);
}

.armd-dmarc-quote__text {
	margin: 0 0 12px;
	font-size: 15px;
}

.woocommerce form .armd-dmarc-quote .button {
	padding: 12px 24px;
}

.armd-dmarc-quote__message:not(:empty) {
	margin-top: 12px;
}

.armd-dmarc-quote__message .woocommerce-error,
.armd-dmarc-quote__message .woocommerce-message {
	margin: 0 !important;
}

/* ------------------------------------------------------------------ */
/* Two-pane checkout: the plan box is step 1, a little more compact    */
/* ------------------------------------------------------------------ */

.armd-checkout .armd-dmarc {
	--armd-muted: #5f6b7a;
	--armd-line: #e0e5eb;
	--armd-soft: color-mix(in srgb, var(--armd-tint) 45%, #fff);
	border-radius: 10px;
}

.armd-checkout .armd-dmarc__plan {
	gap: 12px;
	margin: 0 0 18px;
}

/* The plan cards speak for themselves; "Billing" stays for screen readers. */
.armd-checkout .armd-dmarc__plan legend {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.armd-checkout .armd-dmarc__option {
	padding: 12px 14px 12px 42px;
	border-radius: 8px;
	background: #fff;
}

.armd-checkout .armd-dmarc__option input[type="radio"] {
	top: 14px;
	left: 14px;
	width: 17px;
	height: 17px;
}

.armd-checkout .armd-dmarc__option:has(input:checked) {
	background: var(--armd-soft);
}

.armd-checkout .armd-dmarc__option-title {
	font-size: 16px;
	line-height: 1.3;
}

.armd-checkout .armd-dmarc__option-text {
	margin-top: 3px;
	font-family: var(--wp--preset--font-family--gilroy-regular);
	font-size: 13.5px;
	line-height: 1.4;
}

.armd-checkout .armd-dmarc__badge {
	padding: 2px 7px;
	font-size: 11px;
	line-height: 1.4;
	vertical-align: 1px;
}

.armd-checkout .armd-dmarc__list + .armd-dmarc__list {
	margin-top: 16px;
	padding-top: 14px;
}

/* The counter stays beside its title on phones; a long title wraps instead. */
.armd-checkout .armd-dmarc__list-head {
	flex-wrap: nowrap;
	gap: 12px;
}

.armd-checkout .armd-dmarc__list-title {
	min-width: 0;
	font-family: var(--wp--preset--font-family--gilroy-bold);
	font-size: 15px;
	line-height: 1.3;
}

.armd-checkout .armd-dmarc__counter {
	flex: none;
}

.armd-checkout .armd-dmarc__counter {
	border-radius: 6px;
}

.armd-checkout .armd-dmarc__step {
	width: 34px;
	height: 34px;
	font-size: 19px;
}

.armd-checkout .armd-dmarc__count {
	min-width: 40px;
	font-size: 15px;
	line-height: 34px;
}

.armd-checkout .armd-dmarc__help {
	margin: 2px 0 10px;
	font-family: var(--wp--preset--font-family--gilroy-regular);
	font-size: 13.5px;
	line-height: 1.4;
}

.armd-checkout .armd-dmarc__rows {
	display: grid;
	gap: 8px;
}

/* No parked domains yet: no empty gap under the help text. */
.armd-checkout .armd-dmarc__rows:not(:has(> li)) {
	display: none;
}

.armd-checkout .armd-dmarc__help:has(+ .armd-dmarc__rows:not(:has(> li))) {
	margin-bottom: 0;
}

.armd-checkout .armd-dmarc__row {
	grid-template-columns: 26px minmax(0, 1fr) 40px;
	gap: 4px 8px;
	margin: 0;
}

.armd-checkout .armd-dmarc__number {
	width: 24px;
	height: 24px;
	font-size: 12px;
}

.woocommerce form.armd-checkout .armd-dmarc__input.input-text {
	height: 40px;
	padding: 0 12px !important;
	border-color: var(--armd-line);
	border-radius: 6px !important;
	font-family: var(--wp--preset--font-family--gilroy-regular);
	font-size: 15px !important;
}

.armd-checkout .armd-dmarc__remove {
	min-height: 40px;
	border-color: var(--armd-line);
	border-radius: 6px;
	font-size: 20px;
}

.armd-checkout .armd-dmarc__error {
	font-size: 13px;
}

.armd-checkout .armd-dmarc__limit {
	margin-top: 8px;
	font-size: 13px;
}

@media (max-width: 560px) {
	.armd-checkout .armd-dmarc__row {
		grid-template-columns: 24px minmax(0, 1fr) 40px;
	}
}
