/**
 * Brand Razorpay widget.
 *
 * Structure: a payment stub. An ink panel carries the identity and the amount,
 * a torn edge separates it from the paper half below, and the paper half takes
 * the payer's details. The amount is the largest thing on the card because it
 * is the only decision the payer actually makes.
 *
 * Tokens sit on .brand-pay-wrapper rather than :root so the widget cannot
 * collide with a theme's own custom properties. Re-brand by overriding
 * --brzp-accent and --brzp-ink; everything else derives from them.
 *
 * Typography ships with the plugin. Inheriting a host theme's font means the
 * widget renders differently on every site, and no amount of testing tells you
 * what a donor will actually see. Inter is self-hosted here under the SIL Open
 * Font License (assets/fonts/OFL.txt) -- nothing is fetched from a third party,
 * which also keeps the form clear of the GDPR questions a font CDN raises.
 */

@font-face {
	font-family: "BrandRzpSans";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/inter-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
		U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
		U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The rupee sign, U+20B9, lives in this subset -- it is not optional here. */
@font-face {
	font-family: "BrandRzpSans";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/inter-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
		U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
		U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
		U+A720-A7FF;
}

.brand-pay-wrapper.brand-pay-wrapper.brand-pay-wrapper {
	--brzp-ink: #14181F;
	--brzp-ink-2: #1F262F;
	--brzp-paper: #FFFFFF;
	--brzp-text: #14181F;
	--brzp-muted: #6E7278;
	--brzp-line: #E8E5E0;
	--brzp-field: #FBFAF8;
	--brzp-accent: #D98C3C;
	--brzp-accent-2: #BE762A;
	--brzp-accent-ink: #1A1207;

	/* Used by one thing only: the tricolour hairline across the card's top edge. */
	--brzp-saffron: #FF9933;
	--brzp-green: #138808;

	--brzp-on-ink: #FFFFFF;
	--brzp-on-ink-soft: rgba(255, 255, 255, 0.60);
	--brzp-on-ink-line: rgba(255, 255, 255, 0.16);
	--brzp-font: "BrandRzpSans", -apple-system, BlinkMacSystemFont, "Segoe UI",
		Roboto, "Helvetica Neue", Arial, sans-serif;
	--brzp-radius: 18px;
	--brzp-shadow:
		0 1px 2px rgba(20, 24, 31, 0.05),
		0 14px 30px -14px rgba(20, 24, 31, 0.24),
		0 44px 64px -44px rgba(20, 24, 31, 0.30);
	--brzp-focus: 0 0 0 3px rgba(217, 140, 60, 0.45);
	--brzp-focus-ink: 0 0 0 3px rgba(20, 24, 31, 0.28);

	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 28px 15px;
	color: var(--brzp-text);
	line-height: 1.45;

	/* The bundled face, so the form renders identically on every site.
	   Switch to the theme's own under Settings -> Branding if you would rather
	   it blended in than stayed predictable. */
	font-family: var(--brzp-font);
	font-synthesis: none;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;

	/* The widget decides its own width. A theme's constrained-layout rule
	   would otherwise clamp it to the content column. */
	width: 100%;
	max-width: none;

	/* The desktop split keys off the width this element actually has, not the
	   width of the window -- see the container query below. */
	container-type: inline-size;
	container-name: brzp;
}

.brand-pay-wrapper.brand-pay-wrapper[data-font="theme"] {
	font-family: inherit;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-card {
	width: 100%;
	max-width: 460px;
	background: var(--brzp-paper);
	border-radius: var(--brzp-radius);
	box-shadow: var(--brzp-shadow);
	overflow: hidden;
	box-sizing: border-box;
	position: relative;
}



.brand-pay-wrapper.brand-pay-wrapper .brand-pay-card *,
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-card *::before,
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-card *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------
 * Theme armour
 *
 * Every selector in this sheet carries .brand-pay-wrapper twice. That is not
 * a typo: a block theme styling bare elements reaches (0,2,1) with selectors
 * like input:is([type=text], ...) or .entry-content a, which ties or beats a
 * single class. Repeating the class puts the widget at (0,3,0) or better, so
 * the cascade is decided by specificity rather than by which stylesheet the
 * host happened to print last — something a caching or optimisation plugin
 * can change without warning.
 * ------------------------------------------------------------------ */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-footer a,
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-secondary a {
	color: var(--brzp-muted);
	text-decoration: none;
	box-shadow: none;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-footer a:hover,
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-footer a:focus-visible {
	color: var(--brzp-text);
}

/* Every control, cleared back to a known state.
 *
 * Blocksy's form reset is input:is([type=text], [type=email], ...) -- (0,2,1),
 * which outranks a single class and sets twenty-odd properties, from
 * letter-spacing to outline-offset. The selectors below are element-qualified
 * and carry the wrapper class twice, so they land at (0,3,1) and win outright
 * rather than by load order. Nothing here is a design decision: each
 * declaration returns a property to its default so the component rules further
 * down are the only thing choosing how the widget looks. */

.brand-pay-wrapper.brand-pay-wrapper input.brand-pay-input,
.brand-pay-wrapper.brand-pay-wrapper input.brand-pay-field,
.brand-pay-wrapper.brand-pay-wrapper button.preset-pill,
.brand-pay-wrapper.brand-pay-wrapper :is(button, a).brand-pay-submit-btn,
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-toggle label {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	width: auto;
	min-width: 0;
	max-width: none;
	height: auto;
	min-height: 0;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	background-image: none;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	font-style: normal;
	font-stretch: normal;
	letter-spacing: inherit;
	line-height: normal;
	text-align: inherit;
	text-transform: none;
	text-indent: 0;
	-webkit-text-decoration: none;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	outline: none;
	outline-offset: 0;
	vertical-align: baseline;
	float: none;
	position: static;
	transform: none;
	opacity: 1;
	cursor: auto;
}

/* ---------------------------------------------------------------------
 * Stub — identity, frequency, amount
 * ------------------------------------------------------------------ */

/* The one place the tricolour appears: a hoist down the ink panel's leading
   edge. Along the card's top edge instead, the white band would sit against
   the white page and read as a gap between two stray coloured bars. */
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-stub::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 4px;
	z-index: 2;
	background: linear-gradient(
		to bottom,
		var(--brzp-saffron) 0 33.34%,
		#FFFFFF 33.34% 66.66%,
		var(--brzp-green) 66.66% 100%
	);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-stub {
	position: relative;
	background:
		repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 5px),
		linear-gradient(165deg, var(--brzp-ink-2), var(--brzp-ink) 62%);
	color: var(--brzp-on-ink);
	padding: 26px 26px 24px;
}

/* Identity lockup — left aligned; a centred stack is the one thing every
   payment widget already does. */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-lockup {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 22px;
}

/* Shown as supplied. Height is pinned so the lockup cannot shift as the
   image loads; width follows the artwork's own proportions, so a wordmark
   stays a wordmark and a round mark stays round. */
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-logo {
	width: auto;
	height: 52px;
	max-width: 190px;
	flex: 0 0 auto;
	object-fit: contain;
	object-position: left center;
	border-radius: 0;
	background: none;
	box-shadow: none;
}

/* The initials fallback still needs a shape -- letters alone on the ink panel
   would read as a stray word rather than a mark. */
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-monogram {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	flex: 0 0 auto;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-monogram {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--brzp-accent);
	background: rgba(217, 140, 60, 0.14);
	box-shadow: inset 0 0 0 1px rgba(217, 140, 60, 0.28);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-identity {
	display: block;
	min-width: 0;
}

/* Both are spans, so they need to be told to stack. */
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-title {
	display: block;
	font-size: 18px;
	font-weight: 650;
	letter-spacing: -0.008em;
	margin: 0;
	color: var(--brzp-on-ink);
	line-height: 1.25;
	text-wrap: balance;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-subtitle {
	display: block;
	font-size: 14.5px;
	color: var(--brzp-on-ink-soft);
	margin: 3px 0 0;
	line-height: 1.35;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-testmode {
	display: inline-block;
	margin: 14px 0 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--brzp-accent);
	background: rgba(217, 140, 60, 0.12);
	border: 1px solid rgba(217, 140, 60, 0.32);
	border-radius: 6px;
	padding: 5px 9px;
}

/* Frequency — a real radio group, styled as a segmented track */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-frequency {
	border: 0;
	padding: 0;
	margin: 0 0 20px;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-frequency legend {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-toggle {
	display: flex;
	gap: 2px;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid var(--brzp-on-ink-line);
	border-radius: 10px;
	padding: 3px;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-toggle input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-toggle label {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 0;
	height: 44px;
	padding: 0 10px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-align: center;
	color: var(--brzp-on-ink-soft);
	border-radius: 7px;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
	user-select: none;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-toggle label:hover {
	color: var(--brzp-on-ink);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-toggle input[type="radio"]:checked + label {
	background: var(--brzp-on-ink);
	color: var(--brzp-ink);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-toggle input[type="radio"]:focus-visible + label {
	box-shadow: var(--brzp-focus);
}

/* A quiet marker on the recommended option. The argument itself is made by
   the line below the switcher; this is just a visual anchor for it. */
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-rec-dot {
	flex: 0 0 auto;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--brzp-accent);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-toggle input[type="radio"]:checked + label .brand-pay-rec-dot {
	background: var(--brzp-accent-2);
}

/* The case for the chosen frequency. */
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-pitch {
	margin: -12px 0 20px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--brzp-on-ink-soft);
	max-width: 46ch;
}

/* Amount — the hero. Tabular figures and tight tracking do the work of a
   display face without shipping a webfont to every visitor. */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-amount-label,
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-field-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1.3;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-amount-label {
	color: var(--brzp-on-ink-soft);
	margin-bottom: 8px;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-amount {
	display: flex;
	align-items: baseline;
	gap: 8px;
	border-bottom: 2px solid var(--brzp-on-ink-line);
	padding-bottom: 8px;
	transition: border-color 0.18s ease;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-amount:focus-within {
	border-bottom-color: var(--brzp-accent);
}

.brand-pay-wrapper.brand-pay-wrapper .currency-symbol {
	font-size: 24px;
	font-weight: 600;
	color: var(--brzp-on-ink-soft);
	flex: 0 0 auto;
	pointer-events: none;
}

.brand-pay-wrapper.brand-pay-wrapper input.brand-pay-input {
	flex: 0 1 auto;
	min-width: 2ch;
	/* JS narrows this to the digit count; this is the no-JS fallback. */
	width: 5ch;
	border: 0;
	background: transparent;
	color: var(--brzp-on-ink);
	font-family: inherit;
	font-size: 46px;
	font-weight: 700;
	letter-spacing: -0.035em;
	font-variant-numeric: tabular-nums;
	line-height: 1.05;
	padding: 0;
	outline: none;
	caret-color: var(--brzp-accent);
	-moz-appearance: textfield;
	appearance: textfield;
}

.brand-pay-wrapper.brand-pay-wrapper input.brand-pay-input::-webkit-outer-spin-button,
.brand-pay-wrapper.brand-pay-wrapper input.brand-pay-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Locked to dashboard slabs: the figure is chosen with the pills below, so
   the field reads as a display rather than an invitation to type. */
.brand-pay-wrapper.brand-pay-wrapper input.brand-pay-input[readonly] {
	caret-color: transparent;
	cursor: default;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-period {
	font-size: 15px;
	font-weight: 600;
	color: var(--brzp-on-ink-soft);
	flex: 0 0 auto;
	white-space: nowrap;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-period[hidden] {
	display: none;
}

/* One slot, two states: the amount spelled out, or the minimum when the
   payer is under it. Writing the sum in words is how a rupee receipt has
   always confirmed itself. */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-hint {
	margin: 10px 0 0;
	min-height: 20px;
	font-size: 13.5px;
	letter-spacing: 0.015em;
	color: var(--brzp-on-ink-soft);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-hint.is-warning {
	color: var(--brzp-accent);
	font-weight: 600;
}

/* Presets — quick fills, deliberately small and subordinate to the field */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 16px;
}

.brand-pay-wrapper.brand-pay-wrapper button.preset-pill {
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	padding: 8px 13px;
	border-radius: 999px;
	border: 1px solid var(--brzp-on-ink-line);
	background: transparent;
	color: var(--brzp-on-ink-soft);
	cursor: pointer;
	transition: background 0.16s, border-color 0.16s, color 0.16s;
}

.brand-pay-wrapper.brand-pay-wrapper button.preset-pill:hover {
	color: var(--brzp-on-ink);
	border-color: rgba(255, 255, 255, 0.34);
}

.brand-pay-wrapper.brand-pay-wrapper button.preset-pill:focus-visible {
	outline: none;
	box-shadow: var(--brzp-focus);
}

.brand-pay-wrapper.brand-pay-wrapper button.preset-pill[aria-pressed="true"] {
	background: var(--brzp-accent);
	border-color: var(--brzp-accent);
	color: var(--brzp-accent-ink);
}

/* ---------------------------------------------------------------------
 * Torn edge between stub and paper
 * Masked, so the colour still follows --brzp-ink. Browsers without mask
 * support get a flush 10px ink band, which reads as intentional.
 * ------------------------------------------------------------------ */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-tear {
	height: 10px;
	background: var(--brzp-ink);
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='M0 0 H14 V4 L7 10 L0 4 Z' fill='%23000'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='M0 0 H14 V4 L7 10 L0 4 Z' fill='%23000'/%3E%3C/svg%3E");
	-webkit-mask-size: 14px 10px;
	mask-size: 14px 10px;
	-webkit-mask-repeat: repeat-x;
	mask-repeat: repeat-x;
}

/* ---------------------------------------------------------------------
 * Paper — payer details, action, footer
 * ------------------------------------------------------------------ */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-body {
	padding: 24px 26px 20px;
	background: var(--brzp-paper);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-required-note {
	margin: 0 0 16px;
	font-size: 13.5px;
	line-height: 1.4;
	color: var(--brzp-muted);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-fields {
	display: flex;
	flex-direction: column;
	gap: 13px;
	margin-bottom: 20px;
}

/* First and last name sit side by side; they stack with everything else at
   phone width. */
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 13px;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-field-label {
	color: var(--brzp-muted);
	margin-bottom: 6px;
}

.brand-pay-wrapper.brand-pay-wrapper input.brand-pay-field {
	width: 100%;
	height: 48px;
	padding: 0 13px;
	border: 1px solid var(--brzp-line);
	border-radius: 9px;
	font-family: inherit;
	font-size: 16px;
	color: var(--brzp-text);
	background: var(--brzp-field);
	outline: none;
	transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}

.brand-pay-wrapper.brand-pay-wrapper input.brand-pay-field::placeholder {
	color: #A8A59F;
}

.brand-pay-wrapper.brand-pay-wrapper input.brand-pay-field:focus {
	border-color: var(--brzp-ink);
	background: var(--brzp-paper);
	box-shadow: var(--brzp-focus-ink);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.brand-pay-wrapper.brand-pay-wrapper :is(button, a).brand-pay-submit-btn {
	width: 100%;
	height: 54px;
	background: var(--brzp-ink);
	color: var(--brzp-on-ink);
	border: none;
	border-radius: 11px;
	font-family: inherit;
	font-size: 16.5px;
	font-weight: 650;
	letter-spacing: -0.005em;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	/* On the result page this control is an <a>, and Blocksy ships
	   `a { transition: none !important }`, which no specificity can outrank --
	   the button would snap rather than settle. The only declaration here that
	   has to answer !important with !important. */
	transition: background 0.18s ease, transform 0.08s ease !important;
}

.brand-pay-wrapper.brand-pay-wrapper :is(button, a).brand-pay-submit-btn:hover:not(:disabled) {
	background: #232A34;
}

.brand-pay-wrapper.brand-pay-wrapper :is(button, a).brand-pay-submit-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.brand-pay-wrapper.brand-pay-wrapper :is(button, a).brand-pay-submit-btn:focus-visible {
	outline: none;
	box-shadow: var(--brzp-focus);
}

.brand-pay-wrapper.brand-pay-wrapper :is(button, a).brand-pay-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.brand-pay-wrapper.brand-pay-wrapper :is(button, a).brand-pay-submit-btn .btn-arrow {
	flex: 0 0 auto;
	opacity: 0.55;
	transition: transform 0.18s ease;
}

.brand-pay-wrapper.brand-pay-wrapper :is(button, a).brand-pay-submit-btn:hover:not(:disabled) .btn-arrow {
	transform: translateX(3px);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-security-notice {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 13px 0 0;
	font-size: 13px;
	color: var(--brzp-muted);
	text-align: center;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-security-notice svg {
	stroke: var(--brzp-muted);
	flex: 0 0 auto;
}

/* Alerts */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-alert {
	margin-top: 14px;
	padding: 11px 13px;
	border-radius: 9px;
	font-size: 14.5px;
	font-weight: 500;
	line-height: 1.45;
	border: 1px solid;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-alert[hidden] {
	display: none;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-alert.error {
	background: #FDF3F2;
	color: #8E2019;
	border-color: #F0BFBA;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-alert.success {
	background: #F2FAF4;
	color: #17603A;
	border-color: #B5DEC3;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-alert.info {
	background: #F6F7F9;
	color: #37414F;
	border-color: #DCE0E6;
}

/* Loader */

.brand-pay-wrapper.brand-pay-wrapper .btn-loader {
	width: 17px;
	height: 17px;
	border: 2px solid currentColor;
	border-bottom-color: transparent;
	border-radius: 50%;
	display: inline-block;
	animation: brzp-rotation 0.8s linear infinite;
}

/* Explicit, in case a theme resets the UA [hidden] rule. */
.brand-pay-wrapper.brand-pay-wrapper .btn-text[hidden],
.brand-pay-wrapper.brand-pay-wrapper .btn-arrow[hidden],
.brand-pay-wrapper.brand-pay-wrapper .btn-loader[hidden] {
	display: none;
}

@keyframes brzp-rotation {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Footer */

/* Centred and stacked at every width: the copyright on its own line, the
   policy links beneath it. Two half-lines pushed to opposite edges read as a
   toolbar; a centred block reads as the end of the card. */
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 8px;
	margin-top: 20px;
	padding-top: 14px;
	border-top: 1px solid var(--brzp-line);
	font-size: 13px;
	line-height: 1.4;
	color: var(--brzp-muted);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-footer-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-footer a {
	color: var(--brzp-muted);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 0.16s, border-color 0.16s;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-footer a:hover,
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-footer a:focus-visible {
	color: var(--brzp-text);
	border-bottom-color: var(--brzp-line);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-footer a:focus-visible {
	outline: none;
	box-shadow: var(--brzp-focus-ink);
	border-radius: 3px;
}

/* Admin-only notice when credentials are missing */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-config-warning {
	max-width: 460px;
	margin: 20px auto;
	padding: 14px 16px;
	border: 1px solid #E2B268;
	background: #FDF8EF;
	color: #7A4E12;
	border-radius: 10px;
	font-size: 15.5px;
	line-height: 1.5;
}

/* ---------------------------------------------------------------------
 * Narrow viewports
 * ------------------------------------------------------------------ */

/* ---------------------------------------------------------------------
 * Result page
 * Same anatomy as the form: the ink half carries the message and the brand,
 * the paper half carries the transaction.
 * ------------------------------------------------------------------ */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result .brand-pay-stub {
	padding-bottom: 30px;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-mark {
	margin: 26px 0 16px;
	color: var(--brzp-accent);
	line-height: 0;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result[data-state="success"] .brand-pay-result-mark { color: #6EC28C; }
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result[data-state="failed"] .brand-pay-result-mark { color: #E8857E; }
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result[data-state="unverified"] .brand-pay-result-mark { color: var(--brzp-accent); }
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result[data-state="idle"] .brand-pay-result-mark { color: var(--brzp-on-ink-soft); }

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-title {
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.15;
	margin: 0 0 10px;
	color: var(--brzp-on-ink);
	text-wrap: balance;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-note {
	margin: 0;
	font-size: 15.5px;
	line-height: 1.6;
	color: var(--brzp-on-ink-soft);
	max-width: 44ch;
}

/* Status line in the paper half */

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-status {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0 0 18px;
	padding: 6px 11px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	border: 1px solid var(--brzp-line);
	background: var(--brzp-field);
	color: var(--brzp-muted);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	flex: 0 0 auto;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-status[data-status="success"] { color: #15703F; border-color: #B5DEC3; background: #F2FAF4; }
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-status[data-status="failed"] { color: #8E2019; border-color: #F0BFBA; background: #FDF3F2; }
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-status[data-status="unverified"],
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-status[data-status="pending"] { color: #8A5A00; border-color: #E8D5A8; background: #FCF8EE; }

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-rows {
	margin: 0 0 20px;
	border-top: 1px solid var(--brzp-line);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--brzp-line);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-row dt {
	font-size: 13.5px;
	color: var(--brzp-muted);
	flex: 0 0 auto;
	margin: 0;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-row dd {
	margin: 0;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--brzp-text);
	text-align: right;
	word-break: break-word;
	font-variant-numeric: tabular-nums;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result :is(button, a).brand-pay-submit-btn {
	text-decoration: none;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-secondary {
	margin: 12px 0 0;
	text-align: center;
	font-size: 14px;
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-secondary a {
	color: var(--brzp-muted);
	text-decoration: none;
	border-bottom: 1px solid var(--brzp-line);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-secondary a:hover,
.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-secondary a:focus-visible {
	color: var(--brzp-text);
}

.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result .brand-pay-alert {
	margin: 0 0 18px;
}

/* ---------------------------------------------------------------------
 * Desktop: the same three parts, laid out as a page rather than a card.
 * The stub takes the left half, the torn edge runs vertically, and the form
 * sits on the right. Opt out per placement with desktop="card".
 *
 * Driven by a container query, so the trigger is the space this widget really
 * has. A theme that puts page content in a 720px column at a 1440px viewport
 * would otherwise get two cramped columns instead of the card.
 *
 * Browsers without container query support keep the card layout at every
 * width, which is a complete design in its own right.
 * ------------------------------------------------------------------ */

@container brzp (min-width: 880px) {
	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-card {
		max-width: 980px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-form {
		display: grid;
		grid-template-columns: minmax(0, 1.08fr) 10px minmax(0, 1fr);
		align-items: stretch;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-stub {
		padding: 44px 40px;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-lockup {
		margin-bottom: 30px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-logo {
		height: 62px;
		max-width: 230px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-monogram {
		width: 56px;
		height: 56px;
		border-radius: 14px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-monogram {
		font-size: 20px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-title {
		font-size: 21px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-subtitle {
		font-size: 15.5px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] input.brand-pay-input {
		font-size: 58px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .currency-symbol {
		font-size: 28px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-hint {
		font-size: 14.5px;
		min-height: 22px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-result-title {
		font-size: 36px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-result-note {
		font-size: 16.5px;
	}

	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-body {
		padding: 44px 40px;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	/* The tear turns 90 degrees: same shape, repeated down instead of across. */
	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] .brand-pay-tear {
		height: auto;
		width: 10px;
		-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M0 0 H4 L10 7 L4 14 H0 Z' fill='%23000'/%3E%3C/svg%3E");
		mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M0 0 H4 L10 7 L4 14 H0 Z' fill='%23000'/%3E%3C/svg%3E");
		-webkit-mask-size: 10px 14px;
		mask-size: 10px 14px;
		-webkit-mask-repeat: repeat-y;
		mask-repeat: repeat-y;
	}
}

/* An element cannot be styled by its own container query, so the wrapper's
   own breathing room stays on a media query. */
@media (min-width: 940px) {
	.brand-pay-wrapper.brand-pay-wrapper[data-desktop="split"] {
		padding: 48px 24px;
	}
}

@container brzp (max-width: 430px) {
	.brand-pay-wrapper.brand-pay-wrapper .brand-pay-stub {
		padding: 22px 20px 20px;
	}

	/* A wide wordmark at full size would leave the organisation's name beside it
	   with nothing to sit in. */
	.brand-pay-wrapper.brand-pay-wrapper .brand-pay-logo {
		height: 42px;
		max-width: 150px;
	}

	.brand-pay-wrapper.brand-pay-wrapper .brand-pay-body {
		padding: 20px 20px 18px;
	}

	.brand-pay-wrapper.brand-pay-wrapper input.brand-pay-input {
		font-size: 38px;
	}

	.brand-pay-wrapper.brand-pay-wrapper .currency-symbol {
		font-size: 21px;
	}

	.brand-pay-wrapper.brand-pay-wrapper .brand-pay-row {
		grid-template-columns: 1fr;
	}

	.brand-pay-wrapper.brand-pay-wrapper .brand-pay-pitch {
		margin: -10px 0 18px;
		font-size: 13.5px;
	}

	.brand-pay-wrapper.brand-pay-wrapper .brand-pay-result-title {
		font-size: 25px;
	}
}

/* The wrapper cannot be styled by its own container query, so its outer
   breathing room is the one thing still on a media query. */
@media (max-width: 430px) {
	.brand-pay-wrapper.brand-pay-wrapper.brand-pay-wrapper {
		padding: 18px 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.brand-pay-wrapper.brand-pay-wrapper .brand-pay-toggle label,
	.brand-pay-wrapper.brand-pay-wrapper button.preset-pill,
	.brand-pay-wrapper.brand-pay-wrapper input.brand-pay-field,
	.brand-pay-wrapper.brand-pay-wrapper :is(button, a).brand-pay-submit-btn,
	.brand-pay-wrapper.brand-pay-wrapper :is(button, a).brand-pay-submit-btn .btn-arrow,
	.brand-pay-wrapper.brand-pay-wrapper .brand-pay-amount,
	.brand-pay-wrapper.brand-pay-wrapper .brand-pay-footer a {
		transition: none;
	}

	.brand-pay-wrapper.brand-pay-wrapper .btn-loader {
		animation-duration: 2.4s;
	}
}
