/**
 * Recesso 54-bis — Frontend styles.
 *
 * Selectors are scoped under .r54b-wrapper / .r54b-form to
 * raise specificity above most theme rules (Storefront, Astra, Twenty-X, etc.)
 * and to insulate the form from theme defaults that reach <p>, <input>, etc.
 */

.r54b-wrapper {
	/* Design tokens. The accent follows the active theme when it exposes a
	   colour preset (block themes), and can be overridden from Settings. */
	--r54b-accent: var(--wp--preset--color--accent, var(--wp--preset--color--primary, #2271b1));
	--r54b-text: #1a1a1a;
	--r54b-muted: #4a4a4a;
	--r54b-border: #e1e1e1;
	--r54b-bg: #fff;
	--r54b-radius: 6px;
	--r54b-error: #d63638;
	--r54b-success: #00a32a;

	max-width: 720px;
	margin: 2rem 0;
	box-sizing: border-box;
	/* Leave a little room when the form is scrolled to via the #r54b-form
	   anchor between steps, so it does not land flush under a sticky header. */
	scroll-margin-top: 2rem;
}

/* Success state: the message is a real card (see .r54b-success below), so no
   artificial height is reserved after submitting the form. */

.r54b-wrapper *,
.r54b-wrapper *::before,
.r54b-wrapper *::after {
	box-sizing: border-box;
}

.r54b-wrapper .r54b-intro,
.r54b-wrapper .r54b-legal-note {
	margin: 0 0 1.5rem;
	color: var(--r54b-muted);
	font-size: 0.95rem;
	line-height: 1.5;
}

.r54b-wrapper .r54b-form {
	background: var(--r54b-bg);
	border: 1px solid var(--r54b-border);
	border-radius: var(--r54b-radius);
	padding: 1.5rem;
	margin: 0;
}

/* --- Field row ----------------------------------------------------------- */

.r54b-wrapper .r54b-form .r54b-field {
	display: block;
	margin: 0 0 1.25rem;
	padding: 0;
}

.r54b-wrapper .r54b-form .r54b-field > label {
	display: block;
	margin: 0 0 0.4rem;
	padding: 0;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.3;
	color: var(--r54b-text);
}

.r54b-wrapper .r54b-form .r54b-field input[type="text"],
.r54b-wrapper .r54b-form .r54b-field input[type="email"],
.r54b-wrapper .r54b-form .r54b-field input[type="date"],
.r54b-wrapper .r54b-form .r54b-field select,
.r54b-wrapper .r54b-form .r54b-field textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0.6rem 0.75rem;
	border: 1px solid #c8c8c8;
	border-radius: 4px;
	background: #fff;
	color: var(--r54b-text);
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.4;
	box-shadow: none;
	min-height: 0;
	height: auto;
}

.r54b-wrapper .r54b-form .r54b-field textarea {
	min-height: 110px;
	resize: vertical;
}

.r54b-wrapper .r54b-form .r54b-field input:focus,
.r54b-wrapper .r54b-form .r54b-field select:focus,
.r54b-wrapper .r54b-form .r54b-field textarea:focus {
	outline: 2px solid var(--r54b-accent);
	outline-offset: 1px;
	border-color: var(--r54b-accent);
	box-shadow: none;
}

/* Read-only fields (My Account button pre-fill: name, email, order, date come
   from the customer's own order and are locked so they match what we validate). */
.r54b-wrapper .r54b-form .r54b-field input[readonly] {
	background: #f1f1f1;
	color: #50575e;
	cursor: not-allowed;
}

.r54b-wrapper .r54b-form .r54b-help {
	display: block;
	margin: 0.35rem 0 0;
	color: #6b6b6b;
	font-size: 0.85rem;
	line-height: 1.4;
}

.r54b-wrapper .r54b-form .r54b-required {
	color: var(--r54b-error);
	font-weight: 700;
}

/* --- Privacy checkbox ---------------------------------------------------- */

.r54b-wrapper .r54b-form .r54b-field--checkbox > label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0;
	font-weight: 400;
	font-size: 0.95rem;
	cursor: pointer;
}

.r54b-wrapper .r54b-form .r54b-field--checkbox input[type="checkbox"] {
	flex: 0 0 auto;
	width: 1rem;
	height: 1rem;
	margin: 0.25rem 0 0;
	accent-color: var(--r54b-accent);
}

.r54b-wrapper .r54b-form .r54b-field--checkbox > label > span {
	flex: 1 1 auto;
	line-height: 1.4;
}

/* --- Validation errors (highlight only the field that failed) ------------ */

.r54b-wrapper .r54b-form .r54b-field--error input[type="text"],
.r54b-wrapper .r54b-form .r54b-field--error input[type="email"],
.r54b-wrapper .r54b-form .r54b-field--error input[type="date"],
.r54b-wrapper .r54b-form .r54b-field--error select,
.r54b-wrapper .r54b-form .r54b-field--error textarea {
	border-color: var(--r54b-error);
	box-shadow: 0 0 0 1px var(--r54b-error);
}

.r54b-wrapper .r54b-form .r54b-field--error input:focus,
.r54b-wrapper .r54b-form .r54b-field--error select:focus,
.r54b-wrapper .r54b-form .r54b-field--error textarea:focus {
	outline-color: var(--r54b-error);
	border-color: var(--r54b-error);
}

.r54b-wrapper .r54b-form .r54b-field--checkbox.r54b-field--error > label {
	color: var(--r54b-error);
}

.r54b-wrapper .r54b-form .r54b-field--checkbox.r54b-field--error input[type="checkbox"] {
	outline: 2px solid var(--r54b-error);
	outline-offset: 2px;
	accent-color: var(--r54b-error);
}

.r54b-wrapper .r54b-form .r54b-field-error {
	display: block;
	margin: 0.35rem 0 0;
	color: var(--r54b-error);
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.4;
}

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

.r54b-wrapper .r54b-form .r54b-submit {
	margin: 1.5rem 0 0;
	padding: 0;
	text-align: right;
}

.r54b-wrapper .r54b-form .r54b-button {
	display: inline-block;
	margin: 0;
	padding: 0.75rem 1.75rem;
	background: var(--r54b-accent);
	color: #fff;
	border: 1px solid transparent;
	border-radius: 4px;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease-in-out;
	min-height: 0;
	height: auto;
}

.r54b-wrapper .r54b-form .r54b-button:hover,
.r54b-wrapper .r54b-form .r54b-button:focus {
	background: var(--r54b-accent);
	color: #fff;
	border-color: var(--r54b-accent);
	filter: brightness(0.88);
}

/* Secondary button (e.g. "Edit data" on the confirmation screen): styled as a
   real button so it reads as an action, but visually subordinate to the
   primary "Confirm withdrawal" button next to it. */
.r54b-wrapper .r54b-form .r54b-button--secondary,
.r54b-wrapper .r54b-form .r54b-button--secondary:visited {
	background: #fff;
	color: var(--r54b-accent);
	border-color: var(--r54b-accent);
}

.r54b-wrapper .r54b-form .r54b-button--secondary:hover,
.r54b-wrapper .r54b-form .r54b-button--secondary:focus {
	background: rgba(0, 0, 0, 0.04);
	color: var(--r54b-accent);
	border-color: var(--r54b-accent);
}

/* Confirmation screen: lay the "Edit data" and "Confirm withdrawal" buttons
   side by side, right-aligned like the single-button submit row. */
.r54b-wrapper .r54b-form .r54b-confirm-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem;
}

/* --- Notices ------------------------------------------------------------- */

.r54b-wrapper .r54b-notice {
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	border-left: 4px solid;
	border-radius: 4px;
}

.r54b-wrapper .r54b-notice p {
	margin: 0;
}

.r54b-wrapper .r54b-notice--success {
	background: #edfaef;
	border-color: #00a32a;
	color: #14532d;
}

.r54b-wrapper .r54b-notice--error {
	background: #fcf0f1;
	border-color: var(--r54b-error);
	color: #7a1d1f;
}

/* --- Honeypot (hidden visually but accessible to bots) ------------------- */

.r54b-wrapper .r54b-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --- Annex I.B collapsible block ----------------------------------------- */

.r54b-wrapper .r54b-annex-b {
	margin: 1.5rem 0 0;
	border: 1px solid var(--r54b-border);
	border-radius: 6px;
	background: #fafafa;
}

.r54b-wrapper .r54b-annex-b > summary {
	cursor: pointer;
	padding: 0.9rem 1.25rem;
	font-weight: 600;
	color: var(--r54b-text);
	font-size: 0.95rem;
	list-style: revert;
}

.r54b-wrapper .r54b-annex-b[open] > summary {
	border-bottom: 1px solid var(--r54b-border);
	background: #f0f0f1;
	border-top-left-radius: 6px;
	border-top-right-radius: 6px;
}

.r54b-wrapper .r54b-annex-b__article {
	padding: 1.25rem 1.5rem;
	color: var(--r54b-text);
	line-height: 1.55;
	font-size: 0.95rem;
}

.r54b-wrapper .r54b-annex-b__article p {
	margin: 0 0 0.85rem;
}

.r54b-wrapper .r54b-annex-b__intro em {
	color: var(--r54b-muted);
}

.r54b-wrapper .r54b-annex-b__trader {
	background: #fff;
	border: 1px solid var(--r54b-border);
	border-radius: 4px;
	padding: 0.75rem 1rem;
	margin: 0 0 1rem;
	font-style: normal;
	line-height: 1.5;
}

.r54b-wrapper .r54b-annex-b__field {
	font-family: monospace;
	color: var(--r54b-muted);
	letter-spacing: 0.05em;
	word-break: break-all;
}

.r54b-wrapper .r54b-annex-b__source {
	margin-top: 1rem;
	color: #6b6b6b;
}

.r54b-wrapper .r54b-annex-b__print a {
	display: inline-block;
	margin-top: 0.25rem;
	font-weight: 600;
}

/* Printable view (when ?r54b_annex_b=1 replaces the page content). */

.r54b-annex-b--print {
	max-width: 720px;
	margin: 1.5rem auto;
	padding: 1.25rem 1.5rem;
	color: var(--r54b-text);
	line-height: 1.55;
	font-size: 1rem;
}

@media print {

	.r54b-annex-b--print {
		max-width: none;
		margin: 0;
		padding: 0;
		font-size: 12pt;
	}
}
/* ==========================================================================
   Order-detail withdrawal button / status notice + countdown
   ========================================================================== */

.r54b-order-withdrawal {
	margin: 1.25rem 0;
}

.r54b-order-withdrawal__button {
	text-decoration: none;
}

.r54b-order-withdrawal__status {
	margin: 0;
}

.r54b-countdown {
	margin: 0.5rem 0 0;
	font-size: 0.9rem;
	color: #50575e;
}

/* ==========================================================================
   My Account "Orders" list — informational withdrawal-status action
   ========================================================================== */

/* WooCommerce builds the class from the action key (r54b_status); styled as a
   secondary, informational link rather than a full-strength button, since it
   only points to the existing status notice on the order-detail page. */
.woocommerce-button.r54b_status {
	opacity: 0.75;
}

/* Optional, opt-in "by Conformitico" credit under the public form. */
.r54b-credit {
	margin: 1rem 0 0;
	font-size: 0.85rem;
	opacity: 0.8;
}

/* Partial-withdrawal product picker (confirmation step). */
.r54b-item-picker {
	margin: 1em 0;
	padding: 1em;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}

.r54b-item-picker legend {
	font-weight: 600;
	padding: 0 0.4em;
}

.r54b-item-list {
	list-style: none;
	margin: 0.5em 0 0;
	padding: 0;
}

.r54b-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
	padding: 0.5em 0;
	border-bottom: 1px solid #f0f0f1;
}

.r54b-item:last-child {
	border-bottom: 0;
}

.r54b-item__check {
	display: flex;
	align-items: center;
	gap: 0.5em;
	flex: 1 1 60%;
}

.r54b-item__qty {
	display: flex;
	align-items: center;
	gap: 0.4em;
}

.r54b-item__qty input {
	width: 4em;
}

.r54b-item__ordered {
	color: #646970;
	font-size: 0.9em;
}

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

.r54b-wrapper .r54b-success {
	padding: 2rem 1.5rem;
	background: var(--r54b-bg);
	border: 1px solid var(--r54b-border);
	border-top: 4px solid var(--r54b-success);
	border-radius: var(--r54b-radius);
	text-align: center;
}

.r54b-wrapper .r54b-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	margin: 0 0 1rem;
	border-radius: 50%;
	background: var(--r54b-success);
	color: #fff;
}

.r54b-wrapper .r54b-success__icon svg {
	width: 1.5rem;
	height: 1.5rem;
}

.r54b-wrapper .r54b-success__title {
	margin: 0 0 0.75rem;
	color: var(--r54b-text);
	font-size: 1.4rem;
	line-height: 1.25;
}

.r54b-wrapper .r54b-success__lead {
	margin: 0 auto 1.25rem;
	max-width: 34rem;
	color: var(--r54b-muted);
	line-height: 1.5;
}

.r54b-wrapper .r54b-success__steps {
	margin: 0 auto 1.5rem;
	padding: 0;
	max-width: 30rem;
	list-style: none;
	text-align: left;
	counter-reset: r54b-step;
}

.r54b-wrapper .r54b-success__steps li {
	position: relative;
	margin: 0 0 0.75rem;
	padding: 0 0 0 2.25rem;
	color: var(--r54b-text);
	line-height: 1.45;
	counter-increment: r54b-step;
}

.r54b-wrapper .r54b-success__steps li::before {
	content: counter(r54b-step);
	position: absolute;
	left: 0;
	top: 0;
	width: 1.5rem;
	height: 1.5rem;
	border: 1px solid var(--r54b-accent);
	border-radius: 50%;
	color: var(--r54b-accent);
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.4rem;
	text-align: center;
}

.r54b-wrapper .r54b-success__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	margin: 0;
}

.r54b-wrapper .r54b-success .r54b-button {
	display: inline-block;
	margin: 0;
	padding: 0.75rem 1.75rem;
	background: var(--r54b-accent);
	color: #fff;
	border: 1px solid var(--r54b-accent);
	border-radius: 4px;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.r54b-wrapper .r54b-success .r54b-button:hover,
.r54b-wrapper .r54b-success .r54b-button:focus {
	color: #fff;
	filter: brightness(0.88);
}

.r54b-wrapper .r54b-success .r54b-button--secondary {
	background: transparent;
	color: var(--r54b-accent);
}

.r54b-wrapper .r54b-success .r54b-button--secondary:hover,
.r54b-wrapper .r54b-success .r54b-button--secondary:focus {
	color: var(--r54b-accent);
	background: rgba(0, 0, 0, 0.04);
}

.r54b-wrapper .r54b-credit a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.r54b-wrapper .r54b-credit__mark {
	width: 16px;
	height: 16px;
	margin: 0;
}
