/**
 * Customer withdrawal flow styles.
 *
 * Colours come from admin-configured CSS custom properties (--euwd-*), injected
 * per site via wp_add_inline_style; the values below are inert fallbacks so the
 * stylesheet still renders standalone. WCAG 2.1 AA: focus is always visible, the
 * confirm + cancel controls have deliberately equal prominence (no dark-pattern
 * de-emphasis of Cancel), and colour is never the only signal.
 */

.euwd-flow {
	/* Fallbacks; overridden by the admin palette (see Settings → Withdrawal). */
	--euwd-primary: #1a4f8b;
	--euwd-primary-text: #ffffff;
	--euwd-heading: #16305c;
	--euwd-success: #2e7d32;

	--euwd-border: #e3e3e8;
	--euwd-muted: #6b6b6b;
	--euwd-surface: #ffffff;
	--euwd-surface-alt: #f7f8fa;
	--euwd-radius: 10px;

	max-width: 46rem;
	margin: 1.5rem 0;
	color: #1a1a1a;
}

.euwd-flow h2,
.euwd-flow h3 {
	color: var(--euwd-heading);
}

.euwd-flow h2 {
	margin: 0 0 1rem;
}

.euwd-flow h3 {
	margin: 1.75rem 0 0.75rem;
}

.euwd-flow > p {
	line-height: 1.55;
	margin: 0 0 1rem;
}

/* Breathing room between the intro text and the form card. */
.euwd-flow .euwd-form {
	margin-top: 2rem;
}

/* --- Step indicator ---------------------------------------------------- */

.euwd-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	list-style: none;
	margin: 0 0 1.75rem;
	padding: 0;
	counter-reset: euwd-step;
}

.euwd-steps__item {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--euwd-muted);
	font-size: 0.875rem;
	font-weight: 600;
}

/* Numbered chip; the text label in the markup already carries "1./2." so we
   hide the numeric prefix visually but keep the chip as a progress affordance. */
.euwd-steps__item::before {
	counter-increment: euwd-step;
	content: counter(euwd-step);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	border: 2px solid currentColor;
	font-size: 0.8rem;
	line-height: 1;
}

.euwd-steps__item.is-current {
	color: var(--euwd-primary);
}

.euwd-steps__item.is-done {
	color: var(--euwd-success);
}

.euwd-steps__item.is-done::before {
	content: "\2713"; /* check mark */
	background: var(--euwd-success);
	border-color: var(--euwd-success);
	color: #fff;
}

/* --- Card / fieldset --------------------------------------------------- */

.euwd-fieldset {
	border: 1px solid var(--euwd-border);
	border-radius: var(--euwd-radius);
	background: var(--euwd-surface);
	margin: 0 0 1.5rem;
	padding: 1.5rem 1.75rem 1rem;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.euwd-fieldset legend {
	font-weight: 700;
	font-size: 1.0625rem;
	color: var(--euwd-heading);
	padding: 0 0.6rem;
}

.euwd-wholeorder {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0.5rem 0 1.5rem;
	padding: 0.85rem 1.1rem;
	font-weight: 600;
	background: var(--euwd-surface-alt);
	border-radius: 8px;
}

.euwd-wholeorder label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
}

/* --- Items table ------------------------------------------------------- */

.euwd-items {
	width: 100%;
	border-collapse: collapse;
}

.euwd-items thead th {
	font-size: 0.8125rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--euwd-muted);
	border-bottom: 2px solid var(--euwd-border);
}

.euwd-items th,
.euwd-items td {
	padding: 0.85rem 0.5rem;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid var(--euwd-border);
}

.euwd-items tbody tr:last-child td,
.euwd-items tr:last-child td {
	border-bottom: 0;
}

.euwd-items tbody tr:hover {
	background: var(--euwd-surface-alt);
}

.euwd-item--blocked {
	color: var(--euwd-muted);
}

.euwd-item--blocked:hover {
	background: transparent;
}

.euwd-items td label {
	font-weight: 600;
	cursor: pointer;
}

.euwd-reason {
	display: block;
	font-size: 0.8125rem;
	font-weight: 400;
	color: #8a5300;
	margin-top: 0.15rem;
}

/* Quantity: input and the "/ N" counter stay on one line regardless of theme
   form rules that force inputs to display:block; width:100%. */
.euwd-qty {
	display: inline-flex;
	align-items: baseline;
	gap: 0.5rem;
	white-space: nowrap;
}

.euwd-flow .euwd-qty input[type="number"] {
	width: 4.75rem;
	flex: 0 0 4.75rem;
	margin: 0;
	padding: 0.4rem 0.55rem;
	border: 1px solid var(--euwd-border);
	border-radius: 8px;
	text-align: center;
}

.euwd-qty__max {
	flex: 0 0 auto;
}

/* Native controls pick up the brand colour. */
.euwd-flow input[type="checkbox"],
.euwd-flow input[type="number"] {
	accent-color: var(--euwd-primary);
}

/* --- "What happens next" disclosure ------------------------------------ */

.euwd-next {
	margin: 0 0 1.25rem;
	padding: 0.85rem 1rem;
	background: var(--euwd-surface-alt);
	border-radius: 8px;
}

.euwd-next summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--euwd-heading);
}

.euwd-next ul {
	margin: 0.6rem 0 0.15rem 1.1rem;
	line-height: 1.5;
}

/* --- Confirm step ------------------------------------------------------ */

.euwd-summary {
	margin: 0 0 1rem;
	padding: 0.85rem 1.25rem;
	list-style-position: inside;
	background: var(--euwd-surface-alt);
	border-radius: 8px;
	line-height: 1.6;
}

.euwd-field {
	margin: 0 0 1rem;
}

.euwd-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.euwd-field input[type="text"] {
	max-width: 28rem;
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--euwd-border);
	border-radius: 8px;
}

/* --- Actions ----------------------------------------------------------- */

.euwd-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-top: 1.5rem;
}

.euwd-button--primary {
	font-weight: 700;
	background: var(--euwd-primary);
	border-color: var(--euwd-primary);
	color: var(--euwd-primary-text);
	padding: 0.7rem 1.6rem;
	border-radius: 8px;
}

.euwd-button--primary:hover,
.euwd-button--primary:focus {
	filter: brightness(0.92);
	background: var(--euwd-primary);
	border-color: var(--euwd-primary);
	color: var(--euwd-primary-text);
}

/* Cancel sits beside Confirm with equal reachability; it is a clear link, not
   hidden or greyed. */
.euwd-link {
	color: var(--euwd-primary);
	text-decoration: underline;
	font-weight: 600;
}

.euwd-link:focus-visible,
.euwd-button:focus-visible,
.euwd-items input:focus-visible,
.euwd-field input:focus-visible {
	outline: 3px solid var(--euwd-primary);
	outline-offset: 2px;
}

.euwd-muted {
	color: var(--euwd-muted);
}

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

.euwd-flow--success {
	border-left: 4px solid var(--euwd-success);
	padding: 1.25rem 1.5rem;
	background: var(--euwd-surface-alt);
	border-radius: var(--euwd-radius);
}

.euwd-flow--success h2 {
	color: var(--euwd-success);
	margin-top: 0;
}

@media (max-width: 600px) {
	.euwd-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.euwd-actions .euwd-button--primary {
		text-align: center;
	}
}
