/**
 * Dark styling for Easy Digital Downloads checkout, receipts, and the member portal.
 * Selectors match EDD 3.7 markup, including the theme template overrides.
 */

.fp-commerce .wp-block-post-content,
.fp-edd,
#edd_checkout_wrap,
#edd_checkout_form_wrap {
	max-width: 52rem;
}

#edd_checkout_cart,
#edd_purchase_receipt,
#edd_purchase_receipt_products,
#edd_user_history,
.edd-table,
.fp-commerce table {
	width: 100%;
	border-collapse: collapse;
	background: var(--fp-surface, #12141a);
	color: var(--fp-text, #f4f2ee);
	border: 1px solid var(--fp-line, #2c303a);
	border-radius: 8px;
}

#edd_checkout_cart th,
#edd_checkout_cart td,
#edd_purchase_receipt th,
#edd_purchase_receipt td,
#edd_purchase_receipt_products th,
#edd_purchase_receipt_products td,
#edd_user_history th,
#edd_user_history td,
.edd-table th,
.edd-table td,
.fp-commerce th,
.fp-commerce td {
	padding: 0.8rem 0.9rem;
	border-bottom: 1px solid var(--fp-line, #2c303a);
	text-align: left;
	vertical-align: top;
}

#edd_checkout_cart th,
.edd-table th,
.fp-commerce th {
	color: var(--fp-muted, #a7a8b0);
	font-size: 0.8rem;
	font-weight: 650;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.edd_cart_item_name,
.edd_checkout_cart_item_title {
	color: var(--fp-text, #f4f2ee);
}

.edd_cart_remove_item_btn,
.edd_cart_remove_item_btn:hover {
	color: var(--fp-accent, #ff2d2d);
}

#edd_checkout_cart .edd_cart_actions a {
	color: var(--fp-muted, #a7a8b0);
}

#edd_login_form,
#edd_register_form,
#edd_profile_editor_form,
.edd_form {
	display: grid;
	gap: 0.25rem;
	max-width: 28rem;
}

#edd_login_form legend,
.edd_form legend {
	font-size: 1.4rem;
	font-weight: 650;
	letter-spacing: -0.03em;
	margin-bottom: 0.75rem;
}

.edd-login-username label,
.edd-login-password label,
.edd_form label,
.fp-commerce label:not(.fp-nav-toggle) {
	display: block;
	margin-bottom: 0.3rem;
	color: var(--fp-muted, #a7a8b0);
	font-size: 0.875rem;
}

.edd_errors,
.edd-alert-error {
	padding: 0.8rem 1rem;
	border: 1px solid #ff2d2d;
	border-radius: 6px;
	color: #ffd7d7;
	background: rgba(255, 45, 45, 0.08);
}

.edd_success,
.edd-alert-success,
.edd-account-verified {
	padding: 0.8rem 1rem;
	border: 1px solid #2c303a;
	border-radius: 6px;
	background: #12141a;
	color: #f4f2ee;
}

#edd_final_total,
.edd_cart_amount {
	font-weight: 650;
}

.edd-submit,
#edd_login_submit,
#edd-purchase-button,
.edd-blocks-form__purchase-button,
input.edd-submit {
	background: #ff2d2d;
	color: #0a0a0a;
	border: 0;
	border-radius: 4px;
	padding: 0.75rem 1.1rem;
	font-weight: 650;
	cursor: pointer;
}

.edd-submit:hover,
#edd-purchase-button:hover {
	background: #ff4a4a;
	color: #0a0a0a;
}

.edd_discount_link,
.edd-lost-password a,
.fp-commerce a {
	color: #f4f2ee;
}

#edd_checkout_form_wrap .edd-blocks__row,
.edd-blocks-form {
	color: #f4f2ee;
}

.edd-blocks-form input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
.edd-blocks-form select,
.edd-blocks-form textarea,
#edd_checkout_form_wrap input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
#edd_checkout_form_wrap select,
#edd_checkout_form_wrap textarea,
#edd_profile_editor_form input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
#edd_profile_editor_form select,
#edd_login_form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]) {
	background: #090a0c;
	color: #f4f2ee;
	border: 1px solid #2c303a;
	border-radius: 4px;
}

/*
 * EDD paints the cart header (#fafafa), item cells (#fff), and the discount
 * box (#fafafa) with gray text. These selectors match that stylesheet.
 */
.fp-cart-table {
	border: 1px solid #2c303a;
	border-radius: 8px;
	overflow: hidden;
	background: #12141a;
}

body.fp-commerce #edd_checkout_cart {
	border: 0;
	border-radius: 0;
	background: transparent;
}

body.fp-commerce #edd_checkout_cart td,
body.fp-commerce #edd_checkout_cart th,
body.fp-commerce #edd_checkout_cart .edd_cart_header_row th,
body.fp-commerce #edd_checkout_cart .edd_cart_footer_row th,
body.fp-commerce #edd_checkout_cart .edd_cart_footer_row td {
	background: #12141a;
	color: #f4f2ee;
	border: 0;
	border-bottom: 1px solid #2c303a;
}

body.fp-commerce #edd_checkout_cart tr:last-child th,
body.fp-commerce #edd_checkout_cart tr:last-child td {
	border-bottom: 0;
}

body.fp-commerce #edd_checkout_cart .edd_cart_header_row th {
	background: #1a1d26;
	color: #a7a8b0;
}

body.fp-commerce #edd_checkout_cart .edd_checkout_cart_item_title {
	color: #f4f2ee;
	background: transparent;
}

body.fp-commerce #edd_checkout_cart .edd_cart_item_name .edd_recurring_subscription_terms,
body.fp-commerce #edd_checkout_cart .edd_recurring_terms,
body.fp-commerce #edd_checkout_cart .edd-recurring-terms,
body.fp-commerce #edd_checkout_cart .edd-recurring-details,
body.fp-commerce #edd_checkout_cart .edd_cart_item_name em,
body.fp-commerce #edd_checkout_cart .edd_cart_item_name small {
	display: block;
	margin-top: 0.2rem;
	color: #a7a8b0;
	font-size: 0.85rem;
	font-style: italic;
}

body.fp-commerce #edd_checkout_form_wrap #edd_discount_code {
	background: transparent;
	border: 0;
	margin: 1.25rem 0;
	padding: 0;
}

body.fp-commerce #edd_checkout_form_wrap #edd_show_discount {
	background: #12141a;
	color: #f4f2ee;
	border: 1px solid #2c303a;
	border-radius: 8px;
	padding: 1.1rem 1.15rem;
}

body.fp-commerce #edd_checkout_form_wrap #edd_show_discount .edd_discount_link {
	color: #f4f2ee;
}

body.fp-commerce #edd_checkout_form_wrap #edd_show_discount .edd_discount_link:hover {
	color: #ff4a4a;
}

body.fp-commerce #edd_checkout_form_wrap p#edd-discount-code-wrap.edd-cart-adjustment,
body.fp-commerce #edd_checkout_form_wrap #edd_final_total_wrap,
body.fp-commerce #edd_sl_renewal_form {
	background: #12141a;
	color: #f4f2ee;
	border: 1px solid #2c303a;
	border-radius: 8px;
	padding: 1.1rem 1.15rem;
}

body.fp-commerce #edd_sl_renewal_fields,
body.fp-commerce #edd_sl_renewal_form fieldset {
	background: transparent;
	border: 0;
	margin: 0;
	padding: 0;
}

body.fp-commerce #edd-discount-code-wrap .edd-label,
body.fp-commerce #edd_sl_renewal_form p {
	color: #f4f2ee;
}

body.fp-commerce #edd-discount-code-wrap .edd-description {
	display: block;
	margin: 0.25rem 0 0.85rem;
	color: #a7a8b0;
	background: transparent;
}

body.fp-commerce .edd-discount-code-field-wrap {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
}

body.fp-commerce .edd-discount-code-field-wrap .edd-input {
	flex: 1;
	width: auto;
	max-width: none;
	margin: 0;
}

body.fp-commerce input.edd-submit.button,
body.fp-commerce button.edd-submit.button,
body.fp-commerce input.edd-submit.button:hover,
body.fp-commerce input.edd-submit.button:focus,
body.fp-commerce button.edd-submit.button:hover,
body.fp-commerce button.edd-submit.button:focus,
body.fp-commerce #edd_checkout_form_wrap input.edd-submit,
body.fp-commerce #edd_checkout_form_wrap button.edd-submit,
body.fp-commerce #edd-purchase-button,
body.fp-commerce #edd-purchase-button:hover {
	background: #ff2d2d;
	border: 0;
	color: #0a0a0a;
	border-radius: 4px;
	box-shadow: none;
}

body.fp-commerce input.edd-submit.button:hover,
body.fp-commerce button.edd-submit.button:hover,
body.fp-commerce #edd_checkout_form_wrap input.edd-submit:hover,
body.fp-commerce #edd-purchase-button:hover {
	background: #ff4a4a;
	color: #0a0a0a;
}

body.fp-checkout #edd_checkout_form_wrap #edd-purchase-button,
body.fp-checkout #edd_checkout_form_wrap #edd-purchase-button:hover,
body.fp-checkout #edd_checkout_form_wrap #edd-purchase-button:focus {
	background: #2eb814;
	color: #0a0a0a;
}

body.fp-checkout #edd_checkout_form_wrap #edd-purchase-button:hover,
body.fp-checkout #edd_checkout_form_wrap #edd-purchase-button:focus {
	background: #3ad01f;
}

body.fp-checkout #edd_checkout_wrap,
body.fp-checkout #edd_checkout_form_wrap,
body.fp-checkout #edd_purchase_form.edd_form {
	max-width: none;
}

body.fp-checkout #edd_purchase_form.edd_form {
	display: block;
}

#fp-checkout-columns {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 1rem 1.25rem;
	align-items: start;
	margin-bottom: 1rem;
}

.fp-checkout-col {
	display: grid;
	gap: 1rem;
	align-content: start;
	min-width: 0;
}

body.fp-checkout #edd_register_fields,
body.fp-checkout #edd_payment_mode_select,
body.fp-checkout #edd_checkout_user_info,
body.fp-checkout #edd_register_account_fields,
body.fp-checkout #edd_cc_address,
body.fp-checkout #edd_cc_fields {
	min-width: 0;
	margin: 0;
}

body.fp-checkout #edd_register_fields {
	border: 0;
	padding: 0;
	background: transparent;
}

body.fp-checkout #edd_payment_mode_select,
body.fp-checkout #edd_checkout_user_info,
body.fp-checkout #edd_register_account_fields,
body.fp-checkout #edd_cc_address,
body.fp-checkout #edd_cc_fields {
	padding: 1.25rem 1.3rem 0.35rem;
	background: #12141a;
	border: 1px solid #2c303a;
	border-radius: 8px;
}

body.fp-checkout #edd_purchase_form legend {
	float: none;
	display: block;
	width: 100%;
	margin: 0 0 1rem;
	padding: 0;
	color: #f4f2ee;
	font-size: 1.2rem;
	font-weight: 650;
	letter-spacing: -0.02em;
	line-height: 1.2;
	white-space: normal;
}

body.fp-checkout #edd_checkout_form_wrap label,
body.fp-checkout #edd_checkout_form_wrap .edd-label {
	color: #a7a8b0;
	font-size: 0.875rem;
	font-weight: 650;
}

body.fp-checkout #edd_checkout_form_wrap .edd-description {
	color: #a7a8b0;
	background: transparent;
}

body.fp-checkout #edd_checkout_form_wrap input.edd-input,
body.fp-checkout #edd_checkout_form_wrap select.edd-select,
body.fp-checkout #edd_checkout_form_wrap textarea.edd-input,
body.fp-checkout #edd_checkout_form_wrap input[type="email"],
body.fp-checkout #edd_checkout_form_wrap input[type="password"],
body.fp-checkout #edd_checkout_form_wrap input[type="tel"],
body.fp-checkout #edd_checkout_form_wrap input[type="text"],
body.fp-checkout #edd_checkout_form_wrap select {
	width: 100%;
	max-width: none;
	box-sizing: border-box;
	background: #090a0c;
	color: #f4f2ee;
	border: 1px solid #2c303a;
	border-radius: 4px;
	padding: 0.7rem 0.8rem;
}

body.fp-checkout #edd-payment-mode-wrap {
	display: grid;
	gap: 0.5rem;
}

body.fp-checkout .edd-gateway-option {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0;
	padding: 0.75rem 0.85rem;
	background: #090a0c;
	border: 1px solid #2c303a;
	border-radius: 4px;
	color: #f4f2ee;
	font-size: 0.95rem;
	font-weight: 500;
}

body.fp-checkout .edd-gateway-option-selected {
	border-color: #ff2d2d;
}

body.fp-checkout .edd-gateway-option input {
	width: auto;
	margin: 0;
	accent-color: #ff2d2d;
}

body.fp-checkout #edd_checkout_form_wrap #edd-login-account-wrap {
	margin: 0 0 1rem;
	padding: 0.9rem 1rem;
	background: #12141a;
	color: #f4f2ee;
	border: 1px solid #2c303a;
	border-radius: 8px;
}

body.fp-checkout #edd_secure_site_wrapper {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0 0 1rem;
	color: #a7a8b0;
}

body.fp-checkout #edd_cc_fields .StripeElement,
body.fp-checkout #edd-stripe-payment-element {
	background: #090a0c;
	border: 1px solid #2c303a;
	border-radius: 4px;
	padding: 0.75rem;
}

body.fp-checkout .edd-payment-icons {
	display: flex;
	gap: 0.4rem;
	margin: 0;
	color: #f4f2ee;
}

@media (max-width: 760px) {
	#fp-checkout-columns {
		grid-template-columns: minmax(0, 1fr);
	}
}

.edd-sl-license-row,
.edd_sl_license_key,
#edd_sl_license_keys,
.edd-recurring-table,
.edd-recurring-subscription {
	color: #f4f2ee;
}

body.fp-receipt .wp-block-post-content > h2 {
	display: none;
}

body.fp-receipt .wp-block-post-content > p {
	margin-top: 0;
}

body.fp-receipt.page-child .wp-block-post-content > p {
	margin-bottom: 1.75rem;
}

body.fp-receipt .edd-blocks__confirmation h3,
body.fp-receipt .wp-block-post-content h3 {
	margin: 0.35rem 0 0.7rem;
	color: #f4f2ee;
	font-size: 1.2rem;
	font-weight: 650;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

body.fp-receipt .edd-blocks-receipt__items,
body.fp-receipt .edd-blocks-receipt__totals,
body.fp-receipt #edd_purchase_receipt,
body.fp-receipt #edd_purchase_receipt_products,
body.fp-receipt #edd_subscription_receipt {
	width: 100%;
	margin: 0 0 1rem;
	background: #12141a;
	color: #f4f2ee;
	border: 1px solid #2c303a;
	border-radius: 8px;
	overflow: hidden;
}

body.fp-receipt .edd-blocks-receipt__items,
body.fp-receipt .edd-blocks-receipt__totals {
	display: grid;
	padding: 0.2rem 1.15rem;
}

body.fp-receipt #edd_purchase_receipt,
body.fp-receipt #edd_purchase_receipt_products,
body.fp-receipt #edd_subscription_receipt {
	max-width: var(--wp--style--global--content-size, 42rem);
	margin-left: auto;
	margin-right: auto;
	border-collapse: separate;
	border-spacing: 0;
}

body.fp-receipt .edd-blocks-receipt__row-item,
body.fp-receipt .edd-blocks-receipt__row-header,
body.fp-receipt .edd-blocks-receipt__items .edd-blocks__row {
	border-bottom: 1px solid #2c303a;
	padding: 0.9rem 0;
}

body.fp-receipt .edd-blocks-receipt__row-item:last-child,
body.fp-receipt .edd-blocks-receipt__items .edd-blocks__row:last-child {
	border-bottom: 0;
}

body.fp-receipt .edd-blocks__row {
	align-items: start;
	gap: 1rem;
}

body.fp-receipt .edd-blocks-receipt__item,
body.fp-receipt .edd-blocks-receipt__totals .edd-blocks__row {
	grid-template-columns: minmax(0, 1fr) auto;
}

body.fp-receipt .edd-blocks-receipt__row-item--license-key {
	grid-template-columns: minmax(0, 1fr) minmax(8rem, auto);
	align-items: center;
}

body.fp-receipt .edd-blocks__row-label,
body.fp-receipt .edd-blocks__row-sublabel,
body.fp-receipt #edd_purchase_receipt strong {
	color: #a7a8b0;
	font-weight: 650;
}

body.fp-receipt .edd-blocks-receipt__row-header .edd-blocks__row-label,
body.fp-receipt .edd-blocks-receipt__row-header .edd-blocks__row-value,
body.fp-receipt .edd-blocks-receipt__item > .edd-blocks-receipt__item-details > .edd-blocks__row-label,
body.fp-receipt .edd-blocks__row-value,
body.fp-receipt .edd-blocks-receipt__item-price {
	color: #f4f2ee;
}

body.fp-receipt .edd-blocks-receipt__row-header .edd-blocks__row-label,
body.fp-receipt .edd-blocks-receipt__row-header .edd-blocks__row-value,
body.fp-receipt .edd-blocks-receipt__item > .edd-blocks-receipt__item-details > .edd-blocks__row-label,
body.fp-receipt .edd-blocks-receipt__item-price {
	font-weight: 650;
}

body.fp-receipt .edd_purchase_receipt_product_notes,
body.fp-receipt .edd_purchase_receipt_product_notes p {
	margin: 0.4rem 0 0;
	color: #a7a8b0;
	font-style: normal;
}

body.fp-receipt .edd_purchase_receipt_files {
	margin: 0.55rem 0 0;
	padding-left: 1.1rem;
}

body.fp-receipt .edd_sl_license_key {
	overflow-wrap: anywhere;
}

body.fp-receipt .edd-blocks__confirmation-details {
	margin: 0.35rem 0 0.25rem;
}

body.fp-receipt .edd-blocks__confirmation-details a {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	min-height: 2.75rem;
	padding: 0.55rem 1rem;
	border-radius: 4px;
	background: var(--fp-accent, #ff2d2d);
	color: var(--fp-ink, #0a0a0a);
	font-weight: 650;
	line-height: 1;
	text-decoration: none;
}

body.fp-receipt .edd-blocks__confirmation-details a::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -70%;
	width: 45%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
	transform: skewX(-18deg);
	pointer-events: none;
}

body.fp-receipt .edd-blocks__confirmation-details a:hover {
	background: #ff4a4a;
	color: var(--fp-ink, #0a0a0a);
}

body.fp-receipt .edd-blocks__confirmation-details a:hover::after {
	animation: fp-shine 0.7s ease-out;
}

body.fp-receipt a {
	color: var(--fp-accent, #ff2d2d);
}

body.fp-receipt a:hover {
	color: #ff4a4a;
}

body.fp-receipt #edd_purchase_receipt th,
body.fp-receipt #edd_purchase_receipt td,
body.fp-receipt #edd_purchase_receipt_products th,
body.fp-receipt #edd_purchase_receipt_products td,
body.fp-receipt #edd_subscription_receipt th,
body.fp-receipt #edd_subscription_receipt td {
	padding: 0.9rem 1.1rem;
	border: 0;
	border-bottom: 1px solid #2c303a;
	background: #12141a;
	color: #f4f2ee;
	text-align: left;
	vertical-align: top;
}

body.fp-receipt #edd_purchase_receipt tr:last-child th,
body.fp-receipt #edd_purchase_receipt tr:last-child td,
body.fp-receipt #edd_purchase_receipt_products tr:last-child th,
body.fp-receipt #edd_purchase_receipt_products tr:last-child td,
body.fp-receipt #edd_subscription_receipt tr:last-child th,
body.fp-receipt #edd_subscription_receipt tr:last-child td {
	border-bottom: 0;
}

body.fp-receipt #edd_purchase_receipt td:last-child,
body.fp-receipt #edd_purchase_receipt th:last-child,
body.fp-receipt #edd_purchase_receipt_products td:last-child,
body.fp-receipt #edd_purchase_receipt_products th:last-child {
	text-align: right;
}

body.fp-receipt #edd_purchase_receipt thead th {
	color: #f4f2ee;
	font-size: 1rem;
	font-weight: 650;
	letter-spacing: 0;
	text-transform: none;
}

body.fp-receipt #edd_purchase_receipt_products thead th,
body.fp-receipt #edd_subscription_receipt thead th {
	background: #1a1d26;
	color: #a7a8b0;
	font-size: 0.8rem;
	font-weight: 650;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

@media (max-width: 760px) {
	body.fp-receipt #edd_subscription_receipt {
		display: block;
		width: 100%;
		max-width: 100%;
		overflow-x: auto;
	}

	body.fp-receipt #edd_subscription_receipt thead,
	body.fp-receipt #edd_subscription_receipt tbody,
	body.fp-receipt #edd_subscription_receipt tr {
		width: max-content;
		min-width: 100%;
	}

	body.fp-receipt #edd_subscription_receipt th,
	body.fp-receipt #edd_subscription_receipt td {
		white-space: nowrap;
	}
}
