/**
 * W - Withdrawal frontend styles.
 *
 * Theme-agnostic: everything is scoped under .wwd and fully self-styled so the
 * form looks correct on any theme. Mobile-first (single column, 44px tap
 * targets). The primary color is injected inline as :root{--wwd-primary}
 * from settings; every use-site falls back to #111111 when it is absent.
 */

.wwd {
	--wwd-radius: 8px;
	--wwd-border: #d5d7dd;
	--wwd-bg: #ffffff;
	--wwd-text: #1a1a1a;
	--wwd-muted: #5c6069;
	--wwd-error: #b3261e;

	box-sizing: border-box;
	max-width: 640px;
	margin: 0 auto;
	padding: 0;
	color: var(--wwd-text);
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}

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

.wwd .wwd-title {
	font-size: 1.4rem;
	line-height: 1.3;
	margin: 0 0 1rem;
	color: var(--wwd-text);
}

.wwd .wwd-intro,
.wwd .wwd-items-help,
.wwd .wwd-order-line,
.wwd .wwd-success-note {
	margin: 0 0 1rem;
	color: var(--wwd-muted);
}

.wwd .wwd-order-line {
	color: var(--wwd-text);
}

/* Steps */
.wwd .wwd-step {
	margin: 0 0 0.5rem;
}

.wwd [hidden] {
	display: none !important;
}

/* Fields */
.wwd .wwd-field {
	display: flex;
	flex-direction: column;
	margin: 0 0 1rem;
}

.wwd .wwd-field label,
.wwd .wwd-item-name {
	font-weight: 600;
	margin: 0 0 0.35rem;
	color: var(--wwd-text);
}

.wwd .wwd-input {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 0.55rem 0.75rem;
	font-size: 1rem;
	line-height: 1.4;
	color: var(--wwd-text);
	background: var(--wwd-bg);
	border: 1px solid var(--wwd-border);
	border-radius: var(--wwd-radius);
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.wwd .wwd-input:focus {
	outline: 2px solid var(--wwd-primary, #111111);
	outline-offset: 1px;
	border-color: var(--wwd-primary, #111111);
}

.wwd .wwd-input.wwd-invalid {
	border-color: var(--wwd-error);
	outline-color: var(--wwd-error);
}

/* Items */
.wwd .wwd-items {
	margin: 0 0 1.25rem;
}

.wwd .wwd-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--wwd-border);
}

.wwd .wwd-item:first-child {
	border-top: 1px solid var(--wwd-border);
}

.wwd .wwd-item-name {
	margin: 0;
	flex: 1 1 auto;
	min-width: 0;
	word-break: break-word;
}

.wwd .wwd-item .wwd-qty {
	flex: 0 0 auto;
	width: 84px;
	text-align: center;
}

/* Buttons */
.wwd .wwd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.6rem 1.25rem;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	border: 1px solid transparent;
	border-radius: var(--wwd-radius);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: opacity 0.15s ease;
}

.wwd .wwd-btn:hover {
	opacity: 0.9;
}

.wwd .wwd-btn:focus-visible {
	outline: 2px solid var(--wwd-primary, #111111);
	outline-offset: 2px;
}

.wwd .wwd-btn-primary {
	color: #ffffff;
	background: var(--wwd-primary, #111111);
	border-color: var(--wwd-primary, #111111);
	width: 100%;
}

.wwd .wwd-btn-secondary {
	color: var(--wwd-primary, #111111);
	background: transparent;
	border-color: var(--wwd-primary, #111111);
}

.wwd .wwd-btn.wwd-busy {
	opacity: 0.6;
	cursor: progress;
}

.wwd .wwd-btn[disabled] {
	cursor: not-allowed;
	opacity: 0.6;
}

/* Actions row */
.wwd .wwd-actions {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: 1rem;
}

/* Notices + errors */
.wwd .wwd-error {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	color: var(--wwd-error);
	background: #fdecea;
	border: 1px solid var(--wwd-error);
	border-radius: var(--wwd-radius);
}

.wwd .wwd-window-notice {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	color: #7a5b00;
	background: #fff7e0;
	border: 1px solid #e6cf7a;
	border-radius: var(--wwd-radius);
}

/* Review */
.wwd .wwd-review-title,
.wwd .wwd-success-title {
	font-size: 1.15rem;
	margin: 0 0 0.75rem;
}

.wwd .wwd-review-line {
	margin: 0 0 0.5rem;
}

.wwd .wwd-review-items {
	margin: 0.25rem 0 0.5rem;
	padding-left: 1.25rem;
}

.wwd .wwd-review-items li {
	margin: 0 0 0.25rem;
}

/* Success */
.wwd .wwd-step-success {
	text-align: center;
}

.wwd .wwd-success-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.75rem;
	color: #ffffff;
	background: var(--wwd-primary, #111111);
	border-radius: 50%;
}

.wwd .wwd-success-line {
	margin: 0 0 0.4rem;
}

.wwd .wwd-declaration {
	margin: 1.25rem 0 0;
	padding: 1rem;
	text-align: left;
	white-space: pre-wrap;
	word-break: break-word;
	color: var(--wwd-text);
	font-size: 0.95rem;
	line-height: 1.5;
	border: 1px solid var(--wwd-border);
	border-radius: var(--wwd-radius);
}

.wwd .wwd-declaration:empty {
	display: none;
}

.wwd .wwd-print-actions {
	justify-content: center;
	margin-top: 1.25rem;
}

/* Footer link (rendered outside .wwd, keep self-contained) */
.wwd-footer-link {
	text-align: center;
	padding: 0.75rem 1rem;
	font-size: 0.95rem;
}

.wwd-footer-link a {
	text-decoration: underline;
}

/* Tablet / desktop */
@media ( min-width: 600px ) {
	.wwd .wwd-btn-primary {
		width: auto;
		min-width: 220px;
	}

	.wwd .wwd-actions {
		flex-direction: row;
		justify-content: flex-end;
	}

	.wwd .wwd-print-actions {
		justify-content: center;
	}
}

/* Print: isolate the submitted declaration. Hide the interactive lookup /
   items / review steps and the on-screen action buttons, leaving the success
   step (reference code, timestamp, declaration text) as the printed output. */
@media print {
	.wwd .wwd-step-lookup,
	.wwd .wwd-step-items,
	.wwd .wwd-step-review,
	.wwd .wwd-print-actions,
	.wwd .wwd-error {
		display: none !important;
	}
}
