/**
 * Get Cash - [get-cash-form] layout, on top of get-cash.css.
 * The theme owns the look of inputs and buttons; this file only owns layout.
 */

.getcash--form .getcash__card {
	--getcash-width: 34em;
	gap: 1.25em;
}

.getcash-form {
	display: flex;
	flex-direction: column;
	gap: 1.25em;
	margin: 0;
	text-align: start;
}

.getcash-form__fieldset {
	display: flex;
	flex-direction: column;
	gap: 0.75em;
	margin: 0;
	padding: 0;
	border: 0;
}

:where(.getcash-form__legend) {
	margin: 0 0 0.25em;
	padding: 0;
	font-size: 0.95em;
	font-weight: 700;
}

/* Payment method picker: .getcash__tab in get-cash.css; here only layout */

.getcash-form__methods {
	justify-content: flex-start;
}

.getcash-form__methods .getcash__tab {
	/* Grows to share the row, but never shrinks narrower than its own label -
	   the tabs wrap onto a new line instead of breaking the words. */
	flex: 1 1 auto;
	min-width: fit-content;
	justify-content: center;
}

/* ---------------------------------------------------------------------------
 * Fields
 * ------------------------------------------------------------------------- */

.getcash-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
}

.getcash-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.3em;
	min-width: 0;
}

.getcash-form__field--narrow {
	flex: 0 1 7em;
}

/* ---------------------------------------------------------------------------
 * Amount - the focus of the form
 * ------------------------------------------------------------------------- */

.getcash-form__fieldset--amount {
	gap: 0.5em;
}

/* Shown only when there are no suggested amounts to choose from. */
.getcash-form__amountbox {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.15em;
	padding: 0.4em 0.75em;
	border: 1px solid var(--getcash-line);
	border-radius: var(--getcash-radius-sm);
	background: var(--getcash-surface);
}

.getcash-form__amountbox:focus-within {
	border-color: var(--getcash-brand);
	box-shadow: inset 0 0 0 2px var(--getcash-brand);
}

.getcash-form__amountsymbol {
	font-size: 1.6em;
	font-weight: 600;
	line-height: 1;
	opacity: 0.6;
}

.getcash .getcash-form__amountinput {
	width: 100%;
	max-width: 6em;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 2em;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	box-shadow: none;
	-moz-appearance: textfield;
	appearance: textfield;
}

.getcash .getcash-form__amountinput:focus {
	border: 0;
	outline: none;
	background: none;
	box-shadow: none;
}

.getcash-form__amountinput::-webkit-outer-spin-button,
.getcash-form__amountinput::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.getcash-form__error-slot {
	margin: 0;
	font-size: 0.82em;
	color: #d63638;
	text-align: center;
}

.getcash-form__error-slot:empty {
	display: none;
}

:where(.getcash-form__label) {
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.3;
}

.getcash-form__input {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Only applied where the theme styles nothing at all. */
:where(.getcash-form__input) {
	padding: 0.6em 0.75em;
	border: 1px solid var(--getcash-line);
	border-radius: var(--getcash-radius-sm);
	background: transparent;
	color: inherit;
	font: inherit;
}

.getcash-form__input[aria-invalid="true"] {
	border-color: #d63638;
	box-shadow: inset 0 0 0 1px #d63638;
}

.getcash-form__help,
.getcash-form__optional {
	font-size: 0.8em;
	font-weight: 400;
	opacity: 0.7;
	line-height: 1.4;
}

.getcash-form__required {
	color: #d63638;
}

.getcash-form__error {
	font-size: 0.82em;
	color: #d63638;
}

/* Honeypot: hidden from people, reachable by bots. Clipped in place rather than
   pushed off-screen: a far-left offset gives right-to-left pages a horizontal scrollbar. */
.getcash-form__trap {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * Submit + result
 * ------------------------------------------------------------------------- */

.getcash-form__actions {
	display: flex;
	justify-content: center;
}

.getcash-form__submit {
	width: 100%;
	justify-content: center;
	border: 0;
	cursor: pointer;
}

.getcash-form__submit[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.getcash-form__status:empty {
	display: none;
}

.getcash-form__status {
	text-align: center;
}

.getcash-form__result[hidden] {
	display: none;
}

.getcash-form__result {
	display: flex;
	flex-direction: column;
	gap: var(--getcash-gap);
	text-align: center;
}

.getcash-form__result .getcash__rows {
	text-align: start;
}

.getcash-form__summary {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35em 0.75em;
	font-size: 0.9em;
}

.getcash-form__summary strong {
	font-weight: 700;
}

/* Pending badge and the transaction id to use as the payment memo. */
.getcash-form__pending {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5em;
}

.getcash-form__badge {
	display: inline-block;
	padding: 0.2em 0.85em;
	border: 1px solid #dba617;
	border-radius: 999px;
	background: #fcf6dd;
	color: #6b4f00;
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.getcash-form__reference {
	width: 100%;
	margin: 0;
	text-align: start;
}

.getcash-form__reference .getcash__row-value {
	font-size: 1.25em;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.getcash-form__reference-hint {
	margin: 0;
	font-size: 0.85em;
	opacity: 0.8;
}

.getcash-form__restart {
	align-self: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.85em;
	text-decoration: underline;
	cursor: pointer;
	opacity: 0.75;
}

@media (max-width: 600px) {
	/* Two per row rather than four stacked */
	.getcash-form__methods .getcash__tab {
		flex: 1 1 42%;
	}
}
