/*
 * The card form and the cover over it, on every page that takes a card
 * (view_checkout-assets.php): the order pages, the balance deposit, tips, the
 * cart and a subscription's backup card.
 */

/* --- Where the text starts ------------------------------------------------
   .input-group .form-control (styles.css) leaves 35px for an icon inside the
   field. These fields have none, so they take .form-control's own 12px, and
   the gateway's frames start their text on the same line. */
.input-group > .CardHolder.form-control { padding-left: 12px; }
/* Phones draw the fields at 16px (the iOS zoom rule), where the text lands above the middle of the line. */
@media (max-width: 767.98px) { .CardHolder.form-control { padding-top: 3px; } }

/* --- The gateway's card fields --------------------------------------------
   Collect.js puts a frame in each box and sets an inline height on it, 0px
   when the payment step was still hidden: only !important beats that. The
   frame fills the box, so the whole box takes the click, and the text inside
   is centred by the frame's own input (ionPay.js). */
#ccnumber.CardHolder,
#ccexp.CardHolder,
#cvv.CardHolder { display: flex; align-items: center; padding-top: 0; padding-bottom: 0; overflow: hidden; }
#ccnumber.CardHolder iframe,
#ccexp.CardHolder iframe,
#cvv.CardHolder iframe {
	display: block !important;
	width: 100% !important;
	height: 42px !important;
	border: 0 !important;
}

/* Named when Pay was pressed with it empty or wrong. */
.CardHolder.form-control.is-invalid { border-color: #E5536B; box-shadow: 0 0 0 1px #E5536B; }

/* --- The same form everywhere ---------------------------------------------
   The heading keeps the height its badge gives it on a page without one (the
   deposit), and the Pay button is the order page's size on every page. */
.seller-card .pay-card-head { min-height: calc(var(--space-1x) + 24.69px); }
.seller-card .btn.pay-card-btn { font-size: 15px; }

/* --- A payment under way (checkoutBusy.js) --------------------------------- */
[data-checkout-region] { position: relative; }
.checkout-busy {
	position: absolute;
	inset: 0;
	z-index: 1021; /* over the sticky summary (1020), under the site header */
	display: flex;
	justify-content: center;
	align-items: flex-start;
	cursor: progress;
}
.checkout-busy::before { content: ""; position: absolute; inset: 0; background: var(--checkout-busy-ground, var(--secondary-background-color)); opacity: .75; }
/* Stays in the middle of the screen, wherever the buyer was on the page. */
.checkout-busy__spinner { position: sticky; top: calc(50vh - 30px); display: block; margin: 40px 0; color: var(--primary-color); font-size: 60px; line-height: 1; }
.checkout-busy__spinner i { display: block; }

/* --- What the checkout says ------------------------------------------------
   A tinted box with a left bar: icon, a short title, at most one line, and the
   next steps as buttons (checkout_notice.php, checkoutNotice.js).

   One row, the buttons at the right and centred on the title, whenever the
   title and the buttons fit at their natural width; otherwise the buttons take
   the next row and start under the title. The title takes the room that is
   left, so it is what puts the buttons at the right, and the line under it
   wraps without counting. The box's left padding holds the icon, which takes
   no room in the row: that is what puts a second row under the title. */
.pay-note {
	--pay-note-bg: #E2F2FC; --pay-note-fg: #0B4F7C; --pay-note-edge: #3FA9E6;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
	padding: 12px 16px 12px 46px;
	border-left: 3px solid var(--pay-note-edge);
	border-radius: var(--radius-sm, 4px);
	background: var(--pay-note-bg);
	color: var(--pay-note-fg);
	text-align: left;
}
.pay-note[hidden] { display: none; }
.pay-note--warning { --pay-note-bg: #FFF3DC; --pay-note-fg: #7A4B00; --pay-note-edge: #F5A524; }
.pay-note--danger { --pay-note-bg: #FDE7EB; --pay-note-fg: #8A1F35; --pay-note-edge: #E5536B; }
.dark-theme .pay-note { --pay-note-bg: rgba(63, 169, 230, .16); --pay-note-fg: #8CD0F5; }
.dark-theme .pay-note--warning { --pay-note-bg: rgba(245, 165, 36, .16); --pay-note-fg: #FFCB73; }
.dark-theme .pay-note--danger { --pay-note-bg: rgba(229, 83, 107, .16); --pay-note-fg: #FF9DAE; }
.pay-note > i { flex: none; width: 18px; margin-left: -30px; color: var(--pay-note-fg); font-size: 18px; line-height: 1; text-align: center; }
.pay-note__text { flex: 1 1 auto; min-width: 0; }
.pay-note__text strong { display: block; color: var(--pay-note-fg); font-size: 15px; font-weight: 600; line-height: 21px; }
.pay-note__text > span { display: block; width: 0; min-width: 100%; color: var(--pay-note-fg); font-size: 13px; line-height: 19px; overflow-wrap: anywhere; }
.pay-acts { display: flex; flex: 0 1 auto; flex-wrap: wrap; gap: 8px; }
.pay-acts .btn { margin: 0; }
.pay-acts:not(:has(> :not(.d-none))) { display: none; }

/* Over the card limit (openCardLimit.js): the limit's notice is where Pay and the wallets were, and the server's word for the same limit is not said again. */
body.open-card-over #ionPayButton,
body.open-card-over [data-saved-cards="seller"] [data-saved-card-pay],
body.open-card-over .googlePayButton,
body.open-card-over .applePayButton,
body.open-card-over .pay-wallets,
body.open-card-over [data-pay-way="authorize"],
body.open-card-over [data-pay-note-limit],
#modalTopup.open-card-over #topupCardButton { display: none !important; }
@media (max-width: 575.98px) {
	.pay-note { padding: 12px 12px 12px 42px; }
	.pay-acts { flex: 1 1 100%; }
	.pay-acts .btn { flex: 1 1 auto; }
}

/* The same rows on a plain ground: verify first (view_seller-card.php, view_verification-gate.php). */
.pay-gate { --pay-gate-pad: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px var(--pay-gate-pad) 16px calc(var(--pay-gate-pad) + 24px) !important; }
.pay-gate__text { flex: 1 1 auto; min-width: 0; }
.pay-gate__text h6 { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--primary-text-color); }
.pay-gate__text h6 > i { flex: none; width: 18px; margin-left: -24px; text-align: center; }
.pay-gate__text p { width: 0; min-width: 100%; margin: 4px 0 0 !important; color: var(--secondary-color); font-size: 14px; overflow-wrap: anywhere; } /* beats .tab-content p:last-child */
.pay-gate .verification-gate-actions { flex: 0 1 auto; justify-content: flex-start; gap: 8px; margin: 0; padding: 0; }
@media (max-width: 767.98px) {
	.pay-gate { --pay-gate-pad: 14px; }
	.pay-gate .verification-gate-actions { flex: 1 1 100%; margin-left: -24px; }
	.pay-gate .verification-gate-actions .btn,
	.pay-gate .verification-gate-actions > [data-card-verify-tip] { flex: 1 1 100%; }
	.pay-gate .verification-gate-actions > [data-card-verify-tip] > .btn { width: 100%; }
}

/* A fact as a chip, and an information icon: the sentence is in the tooltip. */
.pay-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.pay-chips--field { min-height: 44px; margin: 0; } /* beside a field: centred on it */
.badge.pay-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 9px 5px 12px; font-size: 13px; line-height: 18px; white-space: normal; text-align: left; }
.badge.pay-chip > i { flex: none; margin: 0; line-height: 1; }
.badge.pay-chip[data-toggle="tooltip"], .pay-tip { cursor: help; }
.pay-tip { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: var(--primary-color); font-size: 14px; vertical-align: middle; }
.pay-tip i { line-height: 1; }

/* How each way to pay repeats, beside the payment buttons (view_order-payment.php). */
.pay-repeat-ways { margin: 0; padding: 0; list-style: none; }
.pay-repeat-ways li { display: flex; align-items: center; gap: 8px; min-height: 24px; color: var(--primary-text-color); font-size: 14px; line-height: 20px; }
.pay-repeat-ways li + li { margin-top: 4px; }
.pay-repeat-ways li > i { flex: 0 0 18px; color: var(--secondary-color); line-height: 1; text-align: center; }

/* The top-up on its way, under the payment buttons (topup-modal.js). */
.topup-wait-note { display: flex; align-items: center; justify-content: center; gap: 6px; }
.topup-wait-note > i { line-height: 1; }
