﻿/**
 * Checkout UX — clean ecommerce layout (inspired by polished Greek checkouts).
 */

body.fsa-checkout-ux,
body.edd-checkout.fsa-checkout-ux,
body.fsa-checkout-ux .fsa-main,
body.fsa-checkout-ux .fsa-main--singular {
	background: var(--fsa-surface-alt, #f7f8fa);
}

/* Flatten page card — no white inset box / grey gutter */
body.fsa-checkout-ux .fsa-page-layout,
body.fsa-checkout-ux .fsa-page-layout__main,
body.fsa-checkout-ux .fsa-content,
body.fsa-checkout-ux .fsa-content--page,
body.fsa-checkout-ux .fsa-prose,
body.fsa-checkout-ux #edd_checkout_wrap,
body.fsa-checkout-ux #edd_checkout_form_wrap {
	background: transparent !important;
	box-shadow: none !important;
	border: 0 !important;
	border-radius: 0 !important;
}

body.fsa-checkout-ux .fsa-content,
body.fsa-checkout-ux .fsa-content--page {
	padding-left: 0 !important;
	padding-right: 0 !important;
	padding-top: 0.5rem !important;
	padding-bottom: 1rem !important;
	max-width: none !important;
	width: 100% !important;
}

body.fsa-checkout-ux .fsa-content--page .fsa-prose,
body.fsa-checkout-ux .fsa-page-layout--no-sidebar .fsa-prose,
body.fsa-checkout-ux .fsa-page-layout__main {
	max-width: var(--fsa-container, 1694px);
	width: 100%;
	margin-left: auto;
	margin-right: auto;
}

body.fsa-checkout-ux .fsa-page-layout__main,
body.fsa-checkout-ux .fsa-content--page {
	padding-left: var(--fsa-container-padding-x, clamp(1rem, 2vw, 2rem));
	padding-right: var(--fsa-container-padding-x, clamp(1rem, 2vw, 2rem));
}

/* Page title bar */
.fsa-checkout-page-title {
	margin: 0.35rem 0 1rem;
	padding: 0.85rem 1rem;
	background: #eef0f3;
	border: 1px solid rgba(51, 51, 51, 0.08);
	border-radius: 2px;
	text-align: center;
}

.fsa-checkout-page-title__text {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--fsa-secondary, #1a2b4a);
}

/* —— Main checkout grid: 3 columns —— */
.fsa-checkout-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 0.95fr);
	gap: 0.75rem 0.85rem;
	align-items: start;
	margin: 0 0 2rem;
	width: 100%;
	max-width: none;
}

.fsa-checkout-grid.has-auth,
.fsa-checkout-grid:not(.has-auth) {
	grid-template-areas:
		"errors errors errors"
		"account payment sidebar"
		"bank bank bank";
}

.fsa-checkout-grid > .edd-blocks__purchase-form,
.fsa-checkout-grid .fsa-purchase-form--grid {
	display: contents;
}

.fsa-checkout-grid #fsa-checkout-errors {
	grid-area: errors;
	min-width: 0;
}

.fsa-checkout-grid #fsa-checkout-account {
	grid-area: account;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.fsa-checkout-grid #fsa-checkout-auth {
	min-width: 0;
}

.fsa-checkout-grid #fsa-checkout-details {
	min-width: 0;
}

.fsa-checkout-grid #fsa-checkout-details.is-hidden,
.fsa-checkout-details.is-hidden,
.fsa-checkout-details[hidden],
.fsa-checkout-bank.is-hidden,
.fsa-checkout-bank[hidden],
#fsa-checkout-bank[hidden] {
	display: none !important;
}

.fsa-checkout-grid #fsa-checkout-payment-col {
	grid-area: payment;
	min-width: 0;
}

.fsa-checkout-grid #fsa-checkout-billing-col {
	min-width: 0;
}

.fsa-checkout-grid #fsa-checkout-bank,
.fsa-checkout-grid .fsa-checkout-bank {
	grid-area: bank;
	min-width: 0;
	width: 100%;
}

.fsa-checkout-bank:not([hidden]) {
	margin-top: 0.15rem;
}

/* Never show bank-transfer instructions unless that gateway is selected */
body.fsa-checkout-ux:not(.fsa-gateway-bank_transfer) #fsa-checkout-bank,
body.fsa-checkout-ux:not(.fsa-gateway-bank_transfer) .edd-bt-checkout-details,
body.fsa-checkout-ux:not(.fsa-gateway-bank_transfer) .edd-bt-checkout-notice {
	display: none !important;
}

/* No classic card form — Viva is redirect / Smart Checkout; bank has its own block */
body.fsa-checkout-ux #edd_cc_fields:not(.edd-bt-checkout-details):not(.edd-bt-checkout-notice),
body.fsa-checkout-ux .edd-card-details,
body.fsa-checkout-ux #edd_purchase_form_wrap .card-expiration,
body.fsa-checkout-ux #edd_purchase_form_wrap #card_name,
body.fsa-checkout-ux #edd_purchase_form_wrap #card_number,
body.fsa-checkout-ux #edd_purchase_form_wrap #card_cvc,
body.fsa-checkout-ux #edd_purchase_form_wrap #card_exp_month {
	display: none !important;
}

body.fsa-checkout-ux.fsa-gateway-viva_wallet #edd_purchase_form_wrap legend {
	display: none !important;
}

/* Hide default EDD terms/privacy — we render one Greek checkbox */
body.fsa-checkout-ux #edd_terms_agreement,
body.fsa-checkout-ux #edd_privacy_agreement,
body.fsa-checkout-ux #edd-privacy-policy-agreement,
body.fsa-checkout-ux .edd-terms-agreement:not(.fsa-legal-agreement),
body.fsa-checkout-ux .edd-show-terms,
body.fsa-checkout-ux #edd_show_terms,
body.fsa-checkout-ux #edd_show_privacy_policy {
	display: none !important;
}

/* Empty / leftover payment wrap (Viva has no inline CC form) */
body.fsa-checkout-ux.fsa-gateway-viva_wallet #edd_purchase_form_wrap,
body.fsa-checkout-ux #edd_purchase_form_wrap:empty {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	min-height: 0 !important;
	background: transparent !important;
}

/* Keep a single confirm button in the sidebar */
body.fsa-checkout-ux #fsa-checkout-payment-col #edd_purchase_submit,
body.fsa-checkout-ux #fsa-checkout-payment-col #edd-purchase-button,
body.fsa-checkout-ux #edd_purchase_form_wrap #edd_purchase_submit,
body.fsa-checkout-ux #edd_purchase_form_wrap .edd-submit {
	display: none !important;
}

/* Avoid duplicate payment headings */
body.fsa-checkout-ux #fsa-checkout-payment-col #edd_payment_mode_select > legend,
body.fsa-checkout-ux #fsa-checkout-payment-col #edd-payment-mode-wrap > legend {
	display: none !important;
}

.fsa-checkout-ux .fsa-checkout-bank .edd-bt-checkout-details,
.fsa-checkout-ux .fsa-checkout-bank .edd-bt-checkout-notice {
	width: 100%;
	margin: 0;
}

.fsa-checkout-grid > .fsa-checkout-sidebar {
	grid-area: sidebar;
	position: static;
	align-self: start;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

body.fsa-checkout-ux #edd_checkout_form_wrap.fsa-checkout-grid-host.wp-block-edd-checkout,
body.fsa-checkout-ux .wp-block-edd-checkout.fsa-checkout-grid-host {
	display: block !important;
	max-width: none;
	background: transparent;
}

.fsa-checkout-sidebar .fsa-checkout-section-label--order {
	margin: 0 0 0.55rem;
}

.fsa-checkout-sidebar #edd_checkout_cart_form,
.fsa-checkout-sidebar .edd-blocks-form__cart,
.fsa-checkout-sidebar .edd-blocks__cart {
	background: #f4f5f7;
	border: 1px solid rgba(51, 51, 51, 0.1);
	border-radius: 2px;
	padding: 0.85rem 1rem;
	box-shadow: none;
	margin: 0;
}

.fsa-checkout-sidebar #fsa-legal-agreement,
.fsa-checkout-sidebar #edd_purchase_submit {
	margin: 0;
}

.fsa-checkout-errors:empty {
	display: none;
}

.fsa-checkout-ux .fsa-checkout-errors .edd_errors,
.fsa-checkout-ux .fsa-checkout-errors .edd-alert {
	margin: 0 0 0.35rem;
}

.fsa-checkout-ux #edd_register_fields:not(.fsa-register-fields) {
	display: none !important;
}

.fsa-checkout-ux legend {
	max-width: 100%;
}

/* Hide English EDD helper blurbs only */
.fsa-checkout-ux .edd-description {
	display: none !important;
}

/* —— Auth tabs (underline segmented control) —— */
.fsa-checkout-auth-card {
	padding-top: 0.55rem;
	height: 100%;
}

.fsa-checkout-auth-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	margin: 0 0 0.85rem;
	padding: 0;
	border-radius: 0;
	background: transparent;
	border-bottom: 1px solid rgba(51, 51, 51, 0.14);
}

.fsa-checkout-auth-tab {
	appearance: none;
	border: 0;
	border-radius: 0;
	padding: 0.65rem 0.5rem;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	background: transparent;
	color: rgba(51, 51, 51, 0.55);
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.fsa-checkout-auth-tab.is-active {
	background: transparent;
	color: var(--fsa-secondary, #1a2b4a);
	box-shadow: none;
	border-bottom-color: var(--fsa-primary, #03a9f4);
}

.fsa-checkout-auth-tab:focus-visible {
	outline: 2px solid rgba(3, 169, 244, 0.45);
	outline-offset: 1px;
}

.fsa-checkout-auth__panel[hidden] {
	display: none !important;
}

.fsa-checkout-auth__intro {
	margin: 0 0 0.75rem;
	font-size: 0.88rem;
	line-height: 1.45;
	color: rgba(51, 51, 51, 0.72);
}

.fsa-checkout-auth__lost {
	margin: 0.65rem 0 0;
	font-size: 0.88rem;
}

.fsa-checkout-auth__lost a {
	color: var(--fsa-primary);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.12em;
}

.fsa-checkout-login-submit,
.fsa-checkout-ux .fsa-checkout-login-submit {
	width: 100%;
	border: 0;
	border-radius: 2px;
	padding: 0.75rem 1rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	background: var(--fsa-secondary);
	color: #fff;
}

.fsa-checkout-login-submit:hover {
	filter: brightness(1.08);
}

.fsa-register-fields {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.fsa-register-fields p,
.fsa-checkout-login-form > p:not(.edd-login-remember):not(.edd-login-submit):not(.fsa-checkout-auth__lost) {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	margin: 0 0 0.55rem;
	min-width: 0;
}

.fsa-checkout-login-form > p.edd-login-remember {
	margin: 0.35rem 0 0.65rem;
}

body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-checkout-login-form > p.edd-login-remember label {
	display: inline-flex !important;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem !important;
	font-weight: 500 !important;
	margin: 0 !important;
	cursor: pointer;
}

.fsa-checkout-login-form > p.edd-login-remember input {
	width: auto !important;
	min-height: 0 !important;
	margin: 0;
}

/* Soft grey section panels */
.fsa-checkout-ux #edd_checkout_user_info,
.fsa-checkout-ux #tc-company-fields,
.fsa-checkout-ux #edd_cc_address,
.fsa-checkout-ux #edd_payment_mode_select,
.fsa-checkout-ux #edd_purchase_form_wrap,
.fsa-checkout-ux .fsa-checkout-billing-mode,
.fsa-checkout-ux #edd_terms_agreement,
.fsa-checkout-ux #edd-privacy-policy-agreement,
.fsa-checkout-ux #fsa-legal-agreement,
.fsa-checkout-ux #edd_purchase_submit,
.fsa-checkout-ux .edd-bt-checkout-details,
.fsa-checkout-ux .edd-bt-checkout-notice,
.fsa-checkout-ux .fsa-checkout-auth-card {
	background: #f4f5f7;
	border: 1px solid rgba(51, 51, 51, 0.1);
	border-radius: 2px;
	padding: 0.9rem 1rem;
	margin: 0 0 0.65rem;
	box-shadow: none;
}

.fsa-checkout-ux #edd_checkout_user_info legend,
.fsa-checkout-ux #tc-company-fields legend,
.fsa-checkout-ux #edd_cc_address legend,
.fsa-checkout-ux #edd_payment_mode_select legend {
	display: block;
	font-size: 1rem;
	font-weight: 700;
	color: var(--fsa-secondary);
	padding: 0 0 0.45rem;
	margin: 0 0 0.65rem;
	width: 100%;
	max-width: 100%;
	border-bottom: 1px solid rgba(51, 51, 51, 0.14);
	float: none;
}

/* —— Section labels —— */
.fsa-checkout-section-label {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0 0 0.65rem;
	padding: 0 0 0.45rem;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--fsa-secondary);
	border-bottom: 1px solid rgba(51, 51, 51, 0.14);
}

.fsa-checkout-section-label__icon {
	display: none;
}

/* —— Order summary —— */
.fsa-checkout-ux #edd_checkout_cart_form,
.fsa-checkout-ux .fsa-checkout-summary {
	background: #f4f5f7;
	border: 1px solid rgba(51, 51, 51, 0.1);
	border-radius: 2px;
	padding: 1rem 1.05rem 1.1rem;
	box-shadow: none;
}

.fsa-checkout-ux #edd_checkout_cart {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

.fsa-checkout-ux #edd_checkout_cart th,
.fsa-checkout-ux #edd_checkout_cart td {
	border: 0;
	border-bottom: 1px solid rgba(51, 51, 51, 0.08);
	padding: 0.65rem 0.3rem;
	text-align: left;
	vertical-align: top;
	font-size: 0.92rem;
}

.fsa-checkout-ux #edd_checkout_cart thead th {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: rgba(51, 51, 51, 0.62);
	font-weight: 700;
}

.fsa-checkout-ux #edd_checkout_cart .edd_cart_footer_row th,
.fsa-checkout-ux #edd_checkout_cart .edd_cart_footer_row td {
	border-bottom: 0;
	padding-top: 0.85rem;
}

.fsa-checkout-ux #edd_checkout_cart .edd_cart_total {
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--fsa-secondary);
}

.fsa-checkout-ux .edd_cart_remove_item_btn {
	color: var(--fsa-primary);
	font-size: 0.8rem;
}

.fsa-checkout-ux .fsa-summary-payment {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: 0.85rem;
	padding-top: 0.85rem;
	border-top: 1px solid rgba(51, 51, 51, 0.12);
	font-size: 0.88rem;
}

.fsa-checkout-ux .fsa-summary-payment__label {
	color: rgba(51, 51, 51, 0.65);
}

.fsa-checkout-ux .fsa-summary-payment__value {
	font-weight: 700;
	text-align: right;
}

/* Company details grid */
.fsa-checkout-ux #tc-company-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 0.75rem;
	row-gap: 0.45rem;
	align-items: stretch;
}

.fsa-checkout-ux #tc-company-fields > legend {
	grid-column: 1 / -1;
	margin: 0 0 0.15rem;
	float: none;
	width: auto;
}

.fsa-checkout-ux #tc-company-fields > p {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	margin: 0;
	min-width: 0;
	height: 100%;
}

.fsa-checkout-ux #tc-company-fields > p:has(#tc_company_address),
.fsa-checkout-ux #tc-company-fields > p:has(#tc_company_notes),
.fsa-checkout-ux #tc-company-fields > p:has([name="tc_company_address"]),
.fsa-checkout-ux #tc-company-fields > p:has([name="tc_company_notes"]),
.fsa-checkout-ux #tc-company-fields .fsa-field--full {
	grid-column: 1 / -1;
}

.fsa-checkout-ux #tc-company-fields .fsa-field {
	margin: 0;
}

/* Fields — unified look (auth + personal + company)
   Beat EDD `#edd_checkout_form_wrap label|input` (ID specificity). */
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_purchase_form label,
body.fsa-checkout-ux #edd_checkout_form_wrap #tc-company-fields label,
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-checkout-auth-card label,
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-checkout-login-form label,
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-register-fields label,
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_checkout_user_info label,
body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-checkout-details label,
body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-checkout-account label {
	display: block;
	margin: 0 0 0.28rem;
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--fsa-secondary, #1a2b4a);
}

body.fsa-checkout-ux #edd_checkout_form_wrap #edd_purchase_form .edd-input,
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_purchase_form input[type="text"],
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_purchase_form input[type="email"],
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_purchase_form input[type="tel"],
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_purchase_form input[type="password"],
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_purchase_form input[type="number"],
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_purchase_form select,
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_purchase_form textarea,
body.fsa-checkout-ux #edd_checkout_form_wrap #tc-company-fields input,
body.fsa-checkout-ux #edd_checkout_form_wrap #tc-company-fields select,
body.fsa-checkout-ux #edd_checkout_form_wrap #tc-company-fields textarea,
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-checkout-login-form .edd-input,
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-checkout-login-form input[type="text"],
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-checkout-login-form input[type="password"],
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-register-fields .edd-input,
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-register-fields input[type="text"],
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-register-fields input[type="password"],
body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-checkout-account .edd-input,
body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-checkout-account input[type="text"],
body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-checkout-account input[type="password"],
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_checkout_user_info .edd-input,
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_checkout_user_info input[type="text"],
body.fsa-checkout-ux #edd_checkout_form_wrap #edd_checkout_user_info input[type="email"],
body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-checkout-details .edd-input,
body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-checkout-details input[type="text"],
body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-checkout-details input[type="email"] {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	border: 1px solid rgba(51, 51, 51, 0.2);
	border-radius: 2px;
	padding: 0.5rem 0.65rem;
	font-size: 0.9rem;
	line-height: 1.3;
	min-height: 2.2rem;
	background: #fff;
	color: var(--fsa-text, #333);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.fsa-checkout-ux #edd_checkout_user_info > p,
.fsa-checkout-ux #edd_checkout_user_info .edd-blocks-form__group,
.fsa-checkout-ux #fsa-checkout-details .edd-blocks-form__group {
	display: flex;
	flex-direction: column;
	margin: 0 0 0.55rem;
	min-width: 0;
}

.fsa-checkout-ux #tc-company-fields input,
.fsa-checkout-ux #tc-company-fields select,
.fsa-checkout-ux #tc-company-fields textarea {
	flex: 1 1 auto;
	min-height: 2.2rem;
}

.fsa-checkout-ux #tc-company-fields textarea {
	min-height: 4.25rem;
	resize: vertical;
}

.fsa-checkout-ux #edd_purchase_form .edd-input:hover,
.fsa-checkout-ux #tc-company-fields input:hover,
.fsa-checkout-ux #edd_purchase_form select:hover,
.fsa-checkout-ux .fsa-checkout-login-form .edd-input:hover,
.fsa-checkout-ux .fsa-register-fields .edd-input:hover,
.fsa-checkout-ux #edd_checkout_user_info .edd-input:hover {
	border-color: rgba(3, 169, 244, 0.45);
}

.fsa-checkout-ux #edd_purchase_form .edd-input:focus,
.fsa-checkout-ux #edd_purchase_form input:focus,
.fsa-checkout-ux #edd_purchase_form select:focus,
.fsa-checkout-ux #edd_purchase_form textarea:focus,
.fsa-checkout-ux #tc-company-fields input:focus,
.fsa-checkout-ux #tc-company-fields select:focus,
.fsa-checkout-ux #tc-company-fields textarea:focus,
.fsa-checkout-ux .fsa-checkout-login-form input:focus,
.fsa-checkout-ux .fsa-register-fields input:focus,
.fsa-checkout-ux #edd_checkout_user_info input:focus,
.fsa-checkout-ux .fsa-field-focus {
	outline: none;
	border-color: var(--fsa-primary);
	box-shadow: 0 0 0 2px rgba(3, 169, 244, 0.16);
}

.fsa-checkout-ux .fsa-field-invalid,
.fsa-checkout-ux .edd-invalid,
.fsa-checkout-ux input.fsa-field-invalid,
.fsa-checkout-ux select.fsa-field-invalid,
.fsa-checkout-ux textarea.fsa-field-invalid {
	border-color: #d32f2f !important;
	box-shadow: 0 0 0 1px rgba(211, 47, 47, 0.35) !important;
	background-color: #fff7f7;
}

.fsa-checkout-ux .fsa-field-invalid:focus,
.fsa-checkout-ux .edd-invalid:focus {
	outline: 2px solid rgba(211, 47, 47, 0.45);
	outline-offset: 1px;
}

.fsa-checkout-ux .fsa-field-valid {
	border-color: #2f9e6b !important;
	box-shadow: 0 0 0 2px rgba(47, 158, 107, 0.12) !important;
}

/* Billing mode — radio list rows */
.fsa-checkout-billing-mode .fsa-billing-mode-fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0;
}

.fsa-billing-mode-title {
	margin: 0 0 0.65rem;
	padding: 0 0 0.4rem;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--fsa-secondary);
	border-bottom: 1px solid rgba(51, 51, 51, 0.12);
}

.fsa-billing-mode-option {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	margin: 0;
	padding: 0.7rem 0.15rem;
	border: 0;
	border-bottom: 1px solid rgba(51, 51, 51, 0.1);
	border-radius: 0;
	cursor: pointer;
	background: transparent;
	transition: background 0.12s ease;
}

.fsa-billing-mode-option:last-of-type {
	border-bottom: 0;
}

.fsa-billing-mode-option:hover {
	background: rgba(255, 255, 255, 0.55);
}

.fsa-billing-mode-option:has(input:checked) {
	background: rgba(255, 255, 255, 0.7);
}

.fsa-billing-mode-option input {
	margin-top: 0.15rem;
	accent-color: var(--fsa-primary);
}

.fsa-billing-mode-option__text {
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.35;
}

.fsa-billing-mode-hint {
	margin: 0.65rem 0 0;
	font-size: 0.82rem;
	color: rgba(51, 51, 51, 0.62);
}

body.fsa-billing-mode-company #edd_cc_address,
.fsa-checkout-billing-mode.is-company #edd_cc_address {
	max-height: 0;
	opacity: 0;
	margin: 0 !important;
	padding: 0 !important;
	border-width: 0 !important;
	overflow: hidden;
	pointer-events: none;
	transform: translateY(-4px);
	transition: max-height 0.3s ease, opacity 0.22s ease, margin 0.22s ease, padding 0.22s ease, transform 0.22s ease;
}

body.fsa-billing-mode-different #edd_cc_address,
.fsa-checkout-billing-mode.is-different #edd_cc_address,
#edd_cc_address.fsa-billing-panel-open {
	max-height: 1600px;
	opacity: 1;
	pointer-events: auto;
	margin-top: 0.75rem !important;
	padding: 0.9rem 1rem !important;
	border-width: 1px !important;
	overflow: visible;
	transform: none;
}

/* Payment method list */
.fsa-checkout-ux #edd-payment-mode-wrap,
.fsa-checkout-ux #edd_payment_mode_select .edd-gateway-option {
	display: grid;
	gap: 0;
}

.fsa-checkout-ux #edd-payment-mode-wrap {
	grid-template-columns: 1fr;
}

.fsa-checkout-ux .fsa-gateway-card,
.fsa-checkout-ux label.edd-gateway-option {
	display: grid !important;
	grid-template-columns: auto 1fr;
	align-items: start;
	gap: 0.45rem 0.7rem;
	margin: 0 !important;
	padding: 0.75rem 0.15rem !important;
	border: 0;
	border-bottom: 1px solid rgba(51, 51, 51, 0.1);
	border-radius: 0;
	background: transparent;
	cursor: pointer;
	box-shadow: none;
	transition: background 0.12s ease;
	position: relative;
}

.fsa-checkout-ux .fsa-gateway-card:last-child,
.fsa-checkout-ux label.edd-gateway-option:last-child {
	border-bottom: 0;
}

.fsa-checkout-ux .fsa-gateway-card:hover,
.fsa-checkout-ux label.edd-gateway-option:hover {
	background: rgba(255, 255, 255, 0.55);
	box-shadow: none;
	border-color: transparent;
}

.fsa-checkout-ux .fsa-gateway-card.is-selected,
.fsa-checkout-ux label.edd-gateway-option:has(input:checked) {
	background: rgba(255, 255, 255, 0.75);
	box-shadow: none;
	border-color: transparent;
}

.fsa-checkout-ux .fsa-gateway-card input,
.fsa-checkout-ux label.edd-gateway-option input {
	margin-top: 0.15rem;
	accent-color: var(--fsa-primary);
	opacity: 1 !important;
	position: static !important;
	width: 1rem;
	height: 1rem;
}

.fsa-checkout-ux .fsa-gateway-card__desc {
	grid-column: 2;
	display: block;
	margin-top: 0.1rem;
	font-size: 0.8rem;
	line-height: 1.4;
	color: rgba(51, 51, 51, 0.62);
	font-weight: 400;
}

.fsa-checkout-ux .fsa-gateway-card[data-gateway="viva_wallet"]::after,
.fsa-checkout-ux .fsa-gateway-card[data-gateway="bank_transfer"]::after {
	display: none;
}

@media (max-width: 61.99875rem) {
	.fsa-checkout-grid,
	.fsa-checkout-grid.has-auth,
	.fsa-checkout-grid:not(.has-auth) {
		grid-template-columns: 1fr 1fr;
		grid-template-areas:
			"errors errors"
			"account payment"
			"sidebar sidebar"
			"bank bank";
	}

	.fsa-checkout-grid > .fsa-checkout-sidebar {
		position: static;
	}
}

@media (max-width: 47.99875rem) {
	.fsa-checkout-grid,
	.fsa-checkout-grid.has-auth,
	.fsa-checkout-grid:not(.has-auth) {
		grid-template-columns: 1fr;
		grid-template-areas:
			"errors"
			"account"
			"payment"
			"sidebar"
			"bank";
	}
}

/* Terms — simple confirmation block */
.fsa-checkout-ux #fsa-legal-agreement {
	background: #f4f5f7;
	border: 1px solid rgba(51, 51, 51, 0.1);
	border-radius: 2px;
	padding: 0.9rem 1rem;
	margin: 0;
	box-shadow: none;
}

.fsa-checkout-ux #fsa-legal-agreement .fsa-checkout-section-label--legal {
	margin: 0 0 0.65rem;
	color: var(--fsa-secondary);
}

.fsa-checkout-ux .fsa-legal-agreement {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.fsa-checkout-ux .fsa-legal-agreement input {
	margin-top: 0.15rem;
	accent-color: var(--fsa-primary);
	width: 1.05rem;
	height: 1.05rem;
	flex: 0 0 auto;
}

/* Beat EDD `#edd_checkout_form_wrap label` (font-size 95% / line-height 100%). */
body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-legal-agreement .fsa-legal-agreement label,
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-legal-agreement > label {
	display: block;
	font-size: 0.72rem;
	font-weight: 500;
	line-height: 1.85;
	color: var(--fsa-secondary);
	margin: 0;
}

body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-legal-agreement .fsa-legal-agreement label a,
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-legal-agreement > label a {
	color: var(--fsa-primary);
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-legal-agreement .fsa-legal-agreement label a:hover,
body.fsa-checkout-ux #edd_checkout_form_wrap #fsa-legal-agreement .fsa-legal-agreement label a:focus-visible,
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-legal-agreement > label a:hover,
body.fsa-checkout-ux #edd_checkout_form_wrap .fsa-legal-agreement > label a:focus-visible {
	color: #0290d1;
}

/* Success / failure notices */
.fsa-checkout-notice {
	border-radius: 2px;
	padding: 1.25rem 1.35rem;
	margin: 0 0 1.25rem;
	border: 1px solid transparent;
}

.fsa-checkout-notice__title {
	margin: 0 0 0.65rem;
	font-size: 1.35rem;
	font-weight: 750;
	color: var(--fsa-secondary);
}

.fsa-checkout-notice p {
	margin: 0 0 0.55rem;
	line-height: 1.55;
	color: rgba(51, 51, 51, 0.88);
}

.fsa-checkout-notice p:last-child {
	margin-bottom: 0;
}

.fsa-checkout-notice a {
	color: var(--fsa-primary);
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: 0.12em;
}

.fsa-checkout-notice--success {
	background: rgba(46, 160, 67, 0.08);
	border-color: rgba(46, 160, 67, 0.3);
}

.fsa-checkout-notice--error {
	background: rgba(200, 60, 60, 0.08);
	border-color: rgba(200, 60, 60, 0.3);
}

body.fsa-checkout-success .fsa-prose,
body.fsa-checkout-failure .fsa-prose {
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
}

/* Purchase button */
.fsa-checkout-ux #edd_purchase_submit,
.fsa-checkout-ux #edd_purchase_form input[type="submit"],
.fsa-checkout-ux #edd_purchase_form button[type="submit"],
.fsa-checkout-ux #edd-purchase-button,
.fsa-checkout-ux .edd-submit {
	width: 100%;
	border: 0;
	border-radius: 2px;
	padding: 1rem 1.2rem;
	font-size: 1.02rem;
	font-weight: 750;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	background: var(--fsa-primary);
	color: #fff;
	transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.fsa-checkout-ux #edd_purchase_form input[type="submit"]:hover,
.fsa-checkout-ux #edd-purchase-button:hover,
.fsa-checkout-ux .edd-submit:hover {
	background: #0290d1;
	box-shadow: 0 4px 14px rgba(3, 169, 244, 0.22);
}

.fsa-checkout-ux #edd_purchase_form input[type="submit"]:focus-visible,
.fsa-checkout-ux #edd-purchase-button:focus-visible {
	outline: 3px solid rgba(3, 169, 244, 0.35);
	outline-offset: 2px;
}

.fsa-checkout-ux #edd_purchase_form input[type="submit"]:active {
	transform: translateY(1px);
}

.fsa-checkout-ux .edd_errors,
.fsa-checkout-ux .edd-alert {
	border-radius: 2px;
	padding: 0.85rem 1rem;
	margin-bottom: 1rem;
}

.fsa-checkout-ux #edd_checkout_form_wrap > *:empty {
	display: none;
}

.fsa-checkout-ux .edd-no-js {
	display: none;
}

@media (max-width: 61.99875rem) {
	.fsa-checkout-shell,
	#edd_checkout_wrap.fsa-checkout-shell {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.fsa-checkout-shell > #edd_checkout_cart_form,
	.fsa-checkout-shell > .fsa-checkout-summary {
		grid-column: 1;
		grid-row: 2;
		position: static;
		order: 2;
	}

	.fsa-checkout-shell > #edd_checkout_form_wrap,
	.fsa-checkout-shell > .fsa-checkout-main {
		grid-column: 1;
		grid-row: 1;
		order: 1;
	}

	.fsa-checkout-ux #tc-company-fields,
	.fsa-checkout-ux #tc-company-fields.fsa-company-grid {
		grid-template-columns: 1fr;
		column-gap: 0;
		row-gap: 0.4rem;
	}

	.fsa-checkout-ux #tc-company-fields > p:has(#tc_company_address),
	.fsa-checkout-ux #tc-company-fields > p:has(#tc_company_notes),
	.fsa-checkout-ux #tc-company-fields > p:has([name="tc_company_address"]),
	.fsa-checkout-ux #tc-company-fields > p:has([name="tc_company_notes"]),
	.fsa-checkout-ux #tc-company-fields .fsa-field--full {
		grid-column: 1;
	}
}

@media (max-width: 35.99875rem) {
	.fsa-checkout-ux #edd_checkout_user_info,
	.fsa-checkout-ux #tc-company-fields,
	.fsa-checkout-ux #edd_cc_address,
	.fsa-checkout-ux .fsa-checkout-billing-mode,
	.fsa-checkout-ux #edd_payment_mode_select {
		padding: 0.75rem 0.8rem;
	}

	.fsa-checkout-section-label {
		font-size: 0.95rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.fsa-billing-mode-company #edd_cc_address,
	body.fsa-billing-mode-different #edd_cc_address,
	.fsa-checkout-ux * {
		transition: none !important;
	}
}

.fsa-checkout-ux .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.is-hidden {
	display: none !important;
}
