/*
 * Saadho Nitya Dana form.
 *
 * Palette and type follow the Donate page (warm cream, terracotta, deep ink, old gold;
 * Playfair Display over Montserrat). Every value is a custom property, so a theme can
 * restyle the form by redefining .snd-wrap rather than fighting these rules.
 */

.snd-wrap {
	--snd-cream: #fdfbf7;
	--snd-ink: #2b2b2b;
	--snd-muted: #6f6a63;
	--snd-line: #e2dbd0;
	--snd-terracotta: #9c4a2f;
	--snd-terracotta-dark: #7d3a24;
	--snd-gold: #b08d57;
	--snd-error: #a3301f;

	max-width: 640px;
	margin: 0 auto;
	padding: 8px 0 24px;
	color: var(--snd-ink);
	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	text-align: left;
}

.snd-wrap *,
.snd-wrap *::before,
.snd-wrap *::after {
	box-sizing: border-box;
}

/* --- Theming the browser's own colours ----------------------------------
   Left alone, the UA paints its focus ring, tap highlight, text selection and
   native control accents in its default blue, which reads as a foreign element
   dropped into the page. Each is redirected to the palette below.

   Focus is re-styled, never removed: :focus-visible keeps a clear ring for
   keyboard users while sparing mouse users a ring after every click. */

.snd-wrap {
	accent-color: var(--snd-terracotta);
	-webkit-tap-highlight-color: rgba(156, 74, 47, 0.15);
}

.snd-wrap ::selection {
	background: rgba(176, 141, 87, 0.28);
	color: var(--snd-ink);
}

.snd-wrap button:focus-visible,
.snd-wrap input:focus-visible,
.snd-wrap select:focus-visible,
.snd-wrap textarea:focus-visible,
.snd-wrap a:focus-visible {
	outline: 2px solid var(--snd-terracotta);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Clicking a chip should not leave a ring behind; tabbing to it still shows one. */
.snd-wrap button:focus:not(:focus-visible),
.snd-wrap select:focus:not(:focus-visible) {
	outline: none;
}

.snd-title {
	margin: 0 0 6px;
	font-family: "Playfair Display", Georgia, serif;
	font-size: clamp(24px, 4vw, 32px);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
}

/* Carries a short poetic line ("The Practice of Sacred Continuity"), not explanatory
   copy, so it is set in the serif italic rather than the body sans. */
.snd-subtitle {
	margin: 0 0 26px;
	color: var(--snd-muted);
	font-family: "Playfair Display", Georgia, serif;
	font-size: 16px;
	font-style: italic;
	letter-spacing: 0.01em;
	text-align: center;
}

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

.snd-field {
	margin: 0 0 16px;
}

.snd-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 16px;
}

.snd-label {
	display: block;
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--snd-muted);
}

.snd-optional {
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
}

.snd-wrap input[type="text"],
.snd-wrap input[type="email"],
.snd-wrap input[type="tel"],
.snd-wrap select,
.snd-wrap textarea {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--snd-line);
	border-radius: 6px;
	background: #fff;
	color: var(--snd-ink);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.snd-wrap select {
	background-image: linear-gradient(45deg, transparent 50%, var(--snd-muted) 50%),
		linear-gradient(135deg, var(--snd-muted) 50%, transparent 50%);
	background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 34px;
}

.snd-wrap textarea {
	resize: vertical;
	min-height: 62px;
}

.snd-wrap input:focus,
.snd-wrap select:focus,
.snd-wrap textarea:focus {
	outline: none;
	border-color: var(--snd-terracotta);
	box-shadow: 0 0 0 3px rgba(156, 74, 47, 0.12);
}

.snd-wrap .is-invalid {
	border-color: var(--snd-error);
}

.snd-hint {
	margin: 5px 0 0;
	color: var(--snd-muted);
	font-size: 12px;
}

/* The guiding line under the amount field. Carries meaning, so it sits a step above the
   utility hints in size and spacing. */
.snd-amount-note {
	margin: 12px 0 0;
	color: var(--snd-muted);
	font-size: 13.5px;
	line-height: 1.65;
}

.snd-error {
	margin: 5px 0 0;
	color: var(--snd-error);
	font-size: 12.5px;
	display: none;
}

.snd-error.is-visible {
	display: block;
}

.snd-error-form {
	margin-top: 14px;
	padding: 10px 12px;
	border-radius: 6px;
	background: rgba(163, 48, 31, 0.07);
}

/* --- Amount ------------------------------------------------------------- */

.snd-field-amount {
	margin-bottom: 24px;
}

.snd-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
}

.snd-chip {
	flex: 1 1 auto;
	min-width: 88px;
	padding: 10px 14px;
	border: 1px solid var(--snd-line);
	border-radius: 999px;
	background: #fff;
	color: var(--snd-ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.snd-chip:hover {
	border-color: var(--snd-gold);
}

.snd-chip.is-active {
	border-color: var(--snd-terracotta);
	background: var(--snd-terracotta);
	color: #fff;
}

/* Divider between the suggestion chips and the free-entry field. Without it the chips
   read as the only available choices. */
.snd-or {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 10px;
	color: var(--snd-muted);
	font-size: 12px;
	letter-spacing: 0.04em;
}

.snd-or::before,
.snd-or::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var(--snd-line);
}

.snd-or span {
	flex: 0 0 auto;
}

.snd-amount-input {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 14px;
	border: 1px solid var(--snd-line);
	border-radius: 6px;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.snd-amount-input:focus-within {
	border-color: var(--snd-terracotta);
	box-shadow: 0 0 0 3px rgba(156, 74, 47, 0.12);
}

.snd-currency {
	font-family: "Playfair Display", Georgia, serif;
	font-size: 22px;
	color: var(--snd-terracotta);
}

.snd-wrap .snd-amount-input input[type="text"] {
	flex: 1 1 auto;
	/* Without min-width:0 a flex item cannot shrink below its intrinsic size, so on a
	   narrow screen the input keeps its default 20-character width, overflows, and clips
	   the placeholder behind the "per month" suffix. */
	min-width: 0;
	border: none;
	padding: 8px 0;
	font-family: "Playfair Display", Georgia, serif;
	font-size: 24px;
	font-weight: 600;
	background: transparent;
}

.snd-wrap .snd-amount-input input[type="text"]:focus {
	box-shadow: none;
}

/* The field starts blank, so the placeholder is doing the explaining. Keep it in the
   body sans at body size - a 24px serif placeholder reads as a heading, not a prompt. */
.snd-wrap .snd-amount-input input[type="text"]::placeholder {
	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	font-weight: 400;
	color: var(--snd-muted);
	opacity: 1;
}

.snd-per {
	flex: 0 0 auto;
	color: var(--snd-muted);
	font-size: 13px;
	white-space: nowrap;
}

/* --- Honeypot ----------------------------------------------------------- */

.snd-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --- Submit ------------------------------------------------------------- */

.snd-submit {
	display: block;
	width: 100%;
	margin: 20px 0 0;
	padding: 15px 20px;
	border: none;
	border-radius: 6px;
	background: var(--snd-terracotta);
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.snd-submit:hover:not(:disabled) {
	background: var(--snd-terracotta-dark);
}

.snd-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.snd-status {
	margin: 10px 0 0;
	min-height: 18px;
	color: var(--snd-muted);
	font-size: 13px;
	text-align: center;
}

/* Gratitude and 80G. Set above the payment-processor line, which is smaller and quieter
   so the two do not read as one undifferentiated block of fine print. */
.snd-note {
	margin: 16px 0 0;
	color: var(--snd-muted);
	font-size: 13px;
	line-height: 1.8;
	text-align: center;
}

.snd-legal {
	margin: 12px 0 0;
	padding-top: 12px;
	border-top: 1px solid var(--snd-line);
	color: var(--snd-muted);
	font-size: 11.5px;
	opacity: 0.85;
	text-align: center;
}

/* The contact address is the donor's only route to stopping their offering, so it must
   read as a link - but in the palette, not the browser's default blue. */
.snd-wrap .snd-legal a,
.snd-wrap .snd-note a {
	color: var(--snd-terracotta);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.snd-wrap .snd-legal a:hover,
.snd-wrap .snd-note a:hover {
	color: var(--snd-terracotta-dark);
}

/* --- Review step -------------------------------------------------------- */

.snd-review-title {
	margin: 0 0 16px;
	font-family: "Playfair Display", Georgia, serif;
	font-size: 20px;
	font-weight: 600;
	text-align: center;
}

.snd-review-list {
	display: grid;
	grid-template-columns: minmax(96px, 34%) 1fr;
	gap: 0;
	margin: 0;
	padding: 4px 0;
	border: 1px solid var(--snd-line);
	border-radius: 8px;
	background: var(--snd-cream);
	font-size: 14px;
}

.snd-review-list dt,
.snd-review-list dd {
	margin: 0;
	padding: 10px 16px;
	border-top: 1px solid var(--snd-line);
}

/* No rule above the first pair. */
.snd-review-list dt:first-of-type,
.snd-review-list dt:first-of-type + dd {
	border-top: none;
}

/* No align-self here: centring shrinks the dt box, so its border-top would draw partway
   down a tall row and the divider would visibly step between the two columns. */
.snd-review-list dt {
	color: var(--snd-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.05em;
	line-height: 1.6;
	text-transform: uppercase;
}

.snd-review-list dd {
	color: var(--snd-ink);
	overflow-wrap: anywhere;
}

.snd-review-warning {
	margin: 14px 0 0;
	padding: 11px 14px;
	border-left: 3px solid var(--snd-gold);
	border-radius: 4px;
	background: rgba(176, 141, 87, 0.1);
	color: var(--snd-ink);
	font-size: 13px;
	line-height: 1.6;
}

.snd-back {
	display: block;
	width: 100%;
	margin: 10px 0 0;
	padding: 12px 20px;
	border: 1px solid var(--snd-line);
	border-radius: 6px;
	background: transparent;
	color: var(--snd-muted);
	font-family: inherit;
	font-size: 14px;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.snd-back:hover:not(:disabled) {
	border-color: var(--snd-terracotta);
	color: var(--snd-terracotta);
}

.snd-back:disabled {
	opacity: 0.6;
	cursor: default;
}

/* --- Success ------------------------------------------------------------ */

.snd-success {
	padding: 34px 20px;
	border: 1px solid var(--snd-line);
	border-radius: 8px;
	background: var(--snd-cream);
	text-align: center;
}

.snd-success-mark {
	margin: 0 0 10px;
	color: var(--snd-gold);
	font-size: 30px;
	line-height: 1;
}

.snd-success-title {
	margin: 0 0 8px;
	font-family: "Playfair Display", Georgia, serif;
	font-size: 24px;
	font-weight: 600;
}

.snd-success-body {
	margin: 0;
	color: var(--snd-muted);
	font-size: 15px;
}

/* --- Admin-only notice -------------------------------------------------- */

.snd-admin-notice {
	padding: 12px 14px;
	border-left: 3px solid #a3301f;
	background: #fff5f4;
	font-size: 14px;
}

/* --- Mobile ------------------------------------------------------------- */

@media (max-width: 560px) {
	.snd-row {
		grid-template-columns: 1fr;
	}

	.snd-chip {
		min-width: calc(50% - 4px);
	}
}
