/* ==========================================================================
   WC Withdrawal Manager – Frontend Stylesheet
   Uses the .wcwm- prefix throughout so all rules are safely scoped.
   All sizes use static px values (not rem) so the form renders consistently
   regardless of the root font-size set by the active theme (e.g. Bricks).
   ========================================================================== */

/* Wrapper
   ========================================================================== */
.wcwm-wrapper {
	max-width: 640px;
	margin: 32px auto;
	font-family: inherit;
	color: inherit;
	box-sizing: border-box;
}

/* Step transitions
   ========================================================================== */
.wcwm-step {
	animation: wcwm-fade-in 0.25s ease both;
}

/* Browser-native `hidden` already removes the element; ensure JS toggling
   via .prop('hidden', true/false) does the same with !important in case
   a theme resets `[hidden]`. */
.wcwm-step[hidden] {
	display: none !important;
}

@keyframes wcwm-fade-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0);   }
}

/* Typography
   ========================================================================== */
.wcwm-step__title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 8px;
	line-height: 1.3;
}

.wcwm-step__description {
	margin: 0 0 24px;
	font-size: 16px;
	opacity: 0.75;
	line-height: 1.6;
}

/* Form layout
   ========================================================================== */
.wcwm-form__group {
	margin-bottom: 20px;
}

.wcwm-form__label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 15px;
}

.wcwm-required {
	color: #c0392b;
	margin-left: 2px;
}

/* Text / email inputs
   ========================================================================== */
.wcwm-form__input {
	display: block;
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #c8c8c8;
	border-radius: 4px;
	font-size: 16px;
	font-family: inherit;
	color: #2c2c2c;
	background-color: #fff;
	box-sizing: border-box;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.wcwm-form__input:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.22);
}

.wcwm-form__input--readonly,
.wcwm-form__input[readonly] {
	background-color: #f4f4f4;
	color: #666;
	cursor: not-allowed;
}

/* Fieldset / radio buttons
   ========================================================================== */
.wcwm-fieldset {
	border: none;
	margin: 0;
	padding: 0;
	min-width: 0; /* reset UA fieldset min-width */
}

.wcwm-radio-group {
	display: flex;
	flex-direction: column;
	gap: 9px;
	margin-top: 6px;
}

.wcwm-radio-label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 15px;
	line-height: 1.4;
}

.wcwm-radio {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	accent-color: #2271b1;
	cursor: pointer;
}

/* Product checkbox list
   ========================================================================== */
.wcwm-products-section {
	background-color: #f8f9fa;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 16px 20px;
}

.wcwm-products-section[hidden] {
	display: none !important;
}

.wcwm-products-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 10px;
}

.wcwm-product-item {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 15px;
	cursor: pointer;
	line-height: 1.4;
}

.wcwm-product-item input[type="checkbox"] {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	accent-color: #2271b1;
	cursor: pointer;
}

/* Inline messages
   ========================================================================== */
.wcwm-message {
	padding: 12px 16px;
	border-radius: 4px;
	margin-bottom: 16px;
	font-size: 15px;
	line-height: 1.5;
}

.wcwm-message[hidden] {
	display: none !important;
}

.wcwm-message--error {
	background-color: #fdecea;
	border-left: 4px solid #c0392b;
	color: #6e1a1a;
}

.wcwm-message--success {
	background-color: #eaf7ea;
	border-left: 4px solid #27ae60;
	color: #1b5928;
}

.wcwm-message--expired {
	background-color: #fff8e1;
	border-left: 4px solid #f39c12;
	color: #7a5500;
}

/* Buttons
   ========================================================================== */
.wcwm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 22px;
	border: 2px solid transparent;
	border-radius: 4px;
	font-size: 16px;
	font-family: inherit;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
	white-space: nowrap;
}

.wcwm-btn:focus-visible {
	outline: 3px solid #2271b1;
	outline-offset: 2px;
}

/* Primary */
.wcwm-btn--primary {
	background-color: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

.wcwm-btn--primary:hover:not(:disabled):not(.wcwm-btn--loading) {
	background-color: #135e96;
	border-color: #135e96;
	color: #fff;
}

.wcwm-btn--primary:disabled,
.wcwm-btn--loading {
	opacity: 0.65;
	cursor: not-allowed;
	pointer-events: none;
}

/* Secondary */
.wcwm-btn--secondary {
	background-color: transparent;
	color: #555;
	border-color: #c8c8c8;
}

.wcwm-btn--secondary:hover {
	background-color: #f0f0f0;
	color: #333;
}

/* Loading spinner appended via ::after */
.wcwm-btn--loading::after {
	content: '';
	display: inline-block;
	width: 13px;
	height: 13px;
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wcwm-spin 0.65s linear infinite;
}

@keyframes wcwm-spin {
	to { transform: rotate(360deg); }
}

/* Form action row */
.wcwm-form__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 4px;
}

/* Success screen
   ========================================================================== */
.wcwm-step--success {
	text-align: center;
	padding: 40px 16px;
}

.wcwm-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	background-color: #27ae60;
	color: #fff;
	border-radius: 50%;
	font-size: 32px;
	line-height: 1;
	margin-bottom: 20px;
}

/* Responsive tweaks
   ========================================================================== */
@media ( max-width: 480px ) {
	.wcwm-form__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.wcwm-btn {
		width: 100%;
		justify-content: center;
	}
}
