/**
 * The WooCommerce form language the site uses on every screen that asks for
 * details — the checkout contact card and the account forms share it.
 *
 * WooCommerce draws its own fields with `.woocommerce form .form-row …`, so
 * each rule here carries both page classes to stay on top of that.
 *
 * Every field wears the same surface as the tab picker: one cream pill, one
 * hairline, one inset. Nothing changes fill to signal state — only the edge.
 */

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce {
	--wc-form-border-radius: 999px;
}

/* ---------- labels ---------- */

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row label {
	display: block;
	margin: 0 0 0.35rem;
	padding: 0;
	color: #6c6055;
	font-size: 0.84rem;
	font-weight: 700;
	line-height: 1.6;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row .required {
	color: #9d4f39;
	font-size: 1.1em;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row .optional {
	color: #9a8f81;
	font-size: 0.82em;
	font-style: normal;
	font-weight: 400;
}

/* ---------- fields ---------- */

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row {
	width: 100%;
	margin: 0 0 1rem;
	padding: 0;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row .input-text,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row textarea,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row select {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 0.62rem 1.15rem;
	border: 1px solid rgba(61, 71, 55, 0.2);
	border-radius: 999px;
	background: #fffdf8;
	box-shadow: inset 0 1px 3px rgba(61, 71, 55, 0.08);
	color: #332c26;
	font: inherit;
	font-size: 0.98rem;
	line-height: 1.6;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

/* A multi-line box cannot be a pill without clipping its text. */
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row textarea {
	min-height: 92px;
	padding: 0.7rem 1rem;
	border-radius: 28px;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row .input-text:hover,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row textarea:hover,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row select:hover {
	border-color: rgba(61, 71, 55, 0.34);
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row .input-text:focus,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row textarea:focus,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row select:focus {
	outline: none;
	border-color: #9d4f39;
	box-shadow: inset 0 1px 3px rgba(61, 71, 55, 0.08), 0 0 0 3px rgba(157, 79, 57, 0.15);
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row input[type="checkbox"] {
	width: auto;
	min-height: 0;
	margin: 0 0.4rem 0 0;
	accent-color: #9d4f39;
}

/* ---------- WooCommerce's own validated / invalid states ---------- */

/* The plugin paints a green ring on every row it accepts, which is a second
   accent colour on a form that already has one. A filled row keeps the plain
   edge; only a rejected row changes colour. */
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row.woocommerce-validated .input-text,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row.woocommerce-validated select,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row.woocommerce-validated .select2-container .select2-selection {
	border-color: rgba(61, 71, 55, 0.34);
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row.woocommerce-invalid .input-text,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row.woocommerce-invalid select,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row.woocommerce-invalid .select2-container .select2-selection {
	border-color: #a4382c;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row.woocommerce-invalid > label {
	color: #a4382c;
}

/* ---------- grouped fields ---------- */

/* The password change sits in a fieldset, and WooCommerce draws it as a plain
   square frame — the last straight edge left on these forms. */
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form fieldset {
	margin: 0 0 1rem;
	padding: 0.9rem 1.1rem 1.1rem;
	border: 1px solid rgba(61, 71, 55, 0.16);
	border-radius: 22px;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form legend {
	padding: 0 0.5rem;
	color: #6c6055;
	font-size: 0.88rem;
	font-weight: 700;
	line-height: 1.6;
}

/* ---------- the select2 boxes WooCommerce puts over country and state ---------- */

:is(.woocommerce-account, .woocommerce-checkout) .select2-container .selection .select2-selection--single {
	box-sizing: border-box;
	min-height: 48px;
	padding: 0.55rem 0.85rem;
	border: 1px solid rgba(61, 71, 55, 0.2);
	border-radius: 999px;
	background: #fffdf8;
	color: #332c26;
	font-family: inherit;
	font-size: 0.98rem;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

:is(.woocommerce-account, .woocommerce-checkout) .select2-container .select2-selection__rendered {
	padding: 0;
	color: #332c26;
	font-weight: 400;
	line-height: 1.6;
}

:is(.woocommerce-account, .woocommerce-checkout) .select2-container .select2-selection__arrow {
	top: 50%;
	height: 12px;
	margin-top: -6px;
}

:is(.woocommerce-account, .woocommerce-checkout) .select2-container--default.select2-container--open .select2-selection--single {
	border-color: #9d4f39;
	box-shadow: 0 0 0 3px rgba(157, 79, 57, 0.15);
}

:is(.woocommerce-account, .woocommerce-checkout) .select2-dropdown {
	border: 1px solid rgba(61, 71, 55, 0.18);
	border-radius: 18px;
	background: #fffdf8;
	box-shadow: 0 18px 34px -22px rgba(61, 71, 55, 0.5);
	overflow: hidden;
}

:is(.woocommerce-account, .woocommerce-checkout) .select2-results__option {
	padding: 0.45rem 0.85rem;
	color: #332c26;
	font-size: 0.95rem;
}

:is(.woocommerce-account, .woocommerce-checkout) .select2-results__option--highlighted {
	background: rgba(157, 79, 57, 0.12);
	color: #8a4530;
}

/* ---------- the one-time-code panel the SMS plugins draw ---------- */

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-label {
	display: block;
	margin: 0 0 0.35rem;
	color: #6c6055;
	font-size: 0.84rem;
	font-weight: 700;
	line-height: 1.6;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-input {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	margin: 0 0 0.7rem;
	padding: 0.62rem 0.85rem;
	border: 1px solid rgba(61, 71, 55, 0.2);
	border-radius: 999px;
	background: #fffdf8;
	color: #332c26;
	font: inherit;
	font-size: 0.98rem;
	line-height: 1.6;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-input:hover {
	border-color: rgba(61, 71, 55, 0.34);
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-input:focus {
	outline: none;
	border-color: #9d4f39;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(157, 79, 57, 0.15);
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-step--phone {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.7rem;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-step--phone .wcsmspro-label {
	flex: 0 0 100%;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-step--phone .wcsmspro-input {
	flex: 1 1 170px;
	width: auto;
	margin-bottom: 0;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-code-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.7rem;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-code-row .wcsmspro-input {
	flex: 1 1 150px;
	width: auto;
	margin-bottom: 0;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-btn {
	min-height: 48px;
	padding: 0.6rem 1.4rem;
	border: 0;
	border-radius: 999px;
	background: #9d4f39;
	box-shadow: 0 14px 26px -16px rgba(157, 79, 57, 0.85);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.6;
	text-shadow: none;
	transition: background-color 0.18s ease, transform 0.18s ease;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-btn:hover {
	background: #8a4530;
	color: #fff;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-btn:active {
	transform: translateY(1px);
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-link {
	border: 0;
	background: none;
	box-shadow: none;
	color: #8a4530;
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: underline;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-auth__note {
	margin: 0.9rem 0 0;
	color: #9a8f81;
	font-size: 0.78rem;
	line-height: 1.9;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-auth__note a {
	color: #8a4530;
}

/* ---------- the notices WooCommerce drops above the forms ---------- */

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .woocommerce-info,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .woocommerce-message,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .woocommerce-error,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wc-block-components-notice-banner {
	box-sizing: border-box;
	margin: 0 0 1.3rem;
	padding: 0.85rem 1.1rem;
	border: 1px solid rgba(61, 71, 55, 0.13);
	border-radius: 16px;
	background: rgba(244, 235, 220, 0.66);
	box-shadow: 0 24px 48px -34px rgba(61, 71, 55, 0.55);
	color: #3d4737;
	font-size: 0.92rem;
	font-weight: 400;
	line-height: 1.9;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wc-block-components-notice-banner > svg {
	background-color: #9d4f39;
	fill: #fff;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wc-block-components-notice-banner .wc-forward {
	color: #8a4530 !important;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .woocommerce-info::before,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .woocommerce-message::before {
	color: #9d4f39;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .woocommerce-info a,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .woocommerce-message a {
	color: #8a4530;
	font-weight: 700;
}

/* An error keeps its warning colour, only dressed in the site's palette. */
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .woocommerce-error,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wc-block-components-notice-banner.is-error {
	border-color: rgba(160, 42, 39, 0.28);
	background: #fdf1ee;
	color: #7d2b23;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wc-block-components-notice-banner.is-error > svg {
	background-color: #a02a27;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wc-block-components-notice-banner.is-success {
	border-color: rgba(61, 71, 55, 0.24);
	background: #f2f6ee;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wc-block-components-notice-banner.is-success > svg {
	background-color: #5c7048;
}

/* ---------- buttons ---------- */

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .button,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-send-code {
	min-height: 48px;
	padding: 0.6rem 1.4rem;
	border: 0;
	border-radius: 999px;
	background: #9d4f39;
	box-shadow: 0 14px 26px -16px rgba(157, 79, 57, 0.85);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.6;
	text-shadow: none;
	transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .button:hover,
:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-send-code:hover {
	background: #8a4530;
	color: #fff;
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .button:active {
	transform: translateY(1px);
}

:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .button:focus-visible {
	outline: 2px solid #8a6b45;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row .input-text,
	:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row textarea,
	:is(.woocommerce-account, .woocommerce-checkout) .woocommerce form .form-row select,
	:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-input,
	:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .wcsmspro-btn,
	:is(.woocommerce-account, .woocommerce-checkout) .woocommerce .button {
		transition: none;
	}
}
