/**
 * Withdrawal Form — Erna Child Theme Override
 *
 * Aligns the WT EU Withdrawal Button plugin form
 * with the pd-account-* design system used across
 * the WooCommerce account pages.
 */

/* --------------------------------------------------------
   Shell wrapper (injected via hooks)
   -------------------------------------------------------- */
.pd-withdrawal-shell {
	max-width: 680px;
	margin: 0 auto;
	padding: 0 0 48px;
}

.pd-withdrawal-card {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.pd-withdrawal-card__header {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pd-withdrawal-card__eyebrow {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #94a3b8;
}

.pd-withdrawal-card__title {
	margin: 0;
	font-size: clamp(24px, 3vw, 32px);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.15;
	color: #0f172a;
}

.pd-withdrawal-card__lead {
	margin: 0;
	font-size: 15px;
	line-height: 1.7;
	color: #475569;
}

/* --------------------------------------------------------
   Override form wrapper — remove plugin defaults
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-withdrawal-form {
	max-width: none;
	margin: 0;
	padding: 0;
}

/* --------------------------------------------------------
   Form surface — glass-card feel
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-form {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 22px;
	border: 1px solid rgba(17, 38, 79, 0.08);
	border-radius: 22px;
	background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* --------------------------------------------------------
   Form rows
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-form .form-row,
.pd-withdrawal-shell .wbte-ewb-form .wbte-ewb-form-row {
	margin-bottom: 18px;
	padding: 0;
	width: 100%;
}

.pd-withdrawal-shell .wbte-ewb-form .form-row:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------
   Labels
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-form label {
	display: block;
	margin-bottom: 10px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #1e293b;
}

.pd-withdrawal-shell .wbte-ewb-form label abbr.required {
	color: #dc2626;
	text-decoration: none;
	font-weight: 400;
}

/* --------------------------------------------------------
   Inputs, selects, textareas
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-form .input-text,
.pd-withdrawal-shell .wbte-ewb-form select,
.pd-withdrawal-shell .wbte-ewb-form textarea {
	width: 100%;
	min-height: 54px;
	padding: 0 18px;
	border: 1px solid rgba(148, 163, 184, 0.35);
	border-radius: 18px;
	background: #ffffff;
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
	color: #0f172a;
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.pd-withdrawal-shell .wbte-ewb-form textarea {
	min-height: 120px;
	padding: 14px 18px;
	resize: vertical;
}

.pd-withdrawal-shell .wbte-ewb-form select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 12px;
	cursor: pointer;
}

.pd-withdrawal-shell .wbte-ewb-form .input-text::placeholder,
.pd-withdrawal-shell .wbte-ewb-form textarea::placeholder {
	color: #94a3b8;
}

/* Focus state */
.pd-withdrawal-shell .wbte-ewb-form .input-text:focus,
.pd-withdrawal-shell .wbte-ewb-form select:focus,
.pd-withdrawal-shell .wbte-ewb-form textarea:focus {
	border-color: rgba(17, 38, 79, 0.45);
	box-shadow: 0 0 0 4px rgba(17, 38, 79, 0.08);
	outline: 0;
	transform: translateY(-1px);
}

/* Readonly */
.pd-withdrawal-shell .wbte-ewb-form .input-text[readonly],
.pd-withdrawal-shell .wbte-ewb-form textarea[readonly] {
	background-color: #f8fafc;
	color: #64748b;
	cursor: default;
	box-shadow: none;
}

.pd-withdrawal-shell .wbte-ewb-form .input-text[readonly]:focus,
.pd-withdrawal-shell .wbte-ewb-form textarea[readonly]:focus {
	border-color: rgba(148, 163, 184, 0.35);
	box-shadow: none;
	transform: none;
}

/* --------------------------------------------------------
   Name row — 2-column grid
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-name-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	margin-bottom: 18px;
}

.pd-withdrawal-shell .wbte-ewb-name-row .form-row {
	margin-bottom: 0;
	flex: none;
}

/* --------------------------------------------------------
   Items container — product list
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-items-container {
	margin-bottom: 18px;
	padding: 0;
	border: none;
	border-radius: 0;
	background: transparent;
}

.pd-withdrawal-shell .wbte-ewb-items-container > .wbte-ewb-form-row {
	margin-bottom: 10px;
}

/* Items list */
.pd-withdrawal-shell .wbte-ewb-items-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Individual item — card style (checkbox · thumb · name · qty · price) */
.pd-withdrawal-shell .wbte-ewb-item {
	display: grid;
	grid-template-columns: 20px 48px 1fr auto auto;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid rgba(148, 163, 184, 0.2);
	border-radius: 14px;
	background: #ffffff;
	transition: border-color 0.2s ease, box-shadow 0.15s ease;
}

/* Fallback when no thumbnail is present */
.pd-withdrawal-shell .wbte-ewb-item:not(:has(.wbte-ewb-item-thumb)) {
	grid-template-columns: 20px 1fr auto auto;
}

.pd-withdrawal-shell .wbte-ewb-item:hover {
	border-color: rgba(17, 38, 79, 0.15);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.pd-withdrawal-shell .wbte-ewb-item:last-child {
	border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

/* Reset Erna's global checkbox-via-label pattern */
.pd-withdrawal-shell .wbte-ewb-item input[type="checkbox"] ~ label {
	padding-left: 0;
	position: static;
}

.pd-withdrawal-shell .wbte-ewb-item input[type="checkbox"] ~ label::before,
.pd-withdrawal-shell .wbte-ewb-item input[type="checkbox"]:checked ~ label::before {
	content: none !important;
	display: none !important;
}

/* Product thumbnail */
.pd-withdrawal-shell .wbte-ewb-item-thumb {
	width: 48px;
	height: 48px;
	min-width: 48px;
	min-height: 48px;
	object-fit: contain;
	border-radius: 10px;
	border: 1px solid rgba(148, 163, 184, 0.2);
	background: #f8fafc;
}

/* Checkbox — custom styled, forced square */
.pd-withdrawal-shell .wbte-ewb-item input[type="checkbox"] {
	width: 20px !important;
	height: 20px !important;
	min-width: 20px;
	min-height: 20px;
	max-width: 20px;
	max-height: 20px;
	margin: 0;
	padding: 0;
	border: 2px solid rgba(148, 163, 184, 0.5);
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	flex-shrink: 0;
	align-self: center;
	box-sizing: border-box;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.pd-withdrawal-shell .wbte-ewb-item input[type="checkbox"]:checked {
	background: #11264f;
	border-color: #11264f;
	box-shadow: 0 2px 6px rgba(17, 38, 79, 0.25);
}

.pd-withdrawal-shell .wbte-ewb-item input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 5px;
	width: 6px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.pd-withdrawal-shell .wbte-ewb-item input[type="checkbox"]:focus {
	box-shadow: 0 0 0 3px rgba(17, 38, 79, 0.12);
	outline: 0;
}

.pd-withdrawal-shell .wbte-ewb-item input[type="checkbox"]:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Item name */
.pd-withdrawal-shell .wbte-ewb-item-name {
	flex: none;
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
	line-height: 1.4;
	cursor: pointer;
}

/* Item quantity */
.pd-withdrawal-shell .wbte-ewb-item-qty {
	flex-shrink: 0;
	font-size: 13px;
	color: #64748b;
	font-weight: 500;
}

.pd-withdrawal-shell .wbte-ewb-item-qty--select {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.pd-withdrawal-shell .wbte-ewb-item-qty-select {
	min-width: 56px;
	min-height: 34px;
	padding: 4px 28px 4px 10px;
	border: 1px solid rgba(148, 163, 184, 0.35);
	border-radius: 10px;
	background: #fff;
	background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 10px;
	font-size: 13px;
	color: #374151;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.15s ease;
}

.pd-withdrawal-shell .wbte-ewb-item-qty-select:focus {
	border-color: rgba(17, 38, 79, 0.45);
	outline: 0;
}

.pd-withdrawal-shell .wbte-ewb-item-qty-select:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Item price */
.pd-withdrawal-shell .wbte-ewb-item-price {
	flex-shrink: 0;
	font-weight: 700;
	font-size: 14px;
	color: #0f172a;
}

/* Disabled items */
.pd-withdrawal-shell .wbte-ewb-item--disabled {
	opacity: 0.5;
	background: #f8fafc;
}

.pd-withdrawal-shell .wbte-ewb-item--disabled .wbte-ewb-item-name {
	text-decoration: line-through;
	color: #94a3b8;
	cursor: default;
}

.pd-withdrawal-shell .wbte-ewb-item-reason {
	grid-column: 2 / -1;
	font-size: 12px;
	color: #dc2626;
	font-style: italic;
	margin: -4px 0 0;
	line-height: 1.4;
}

/* Loading state */
.pd-withdrawal-shell .wbte-ewb-items-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px;
	color: #64748b;
	font-size: 14px;
}

.pd-withdrawal-shell .wbte-ewb-no-items {
	padding: 16px;
	color: #64748b;
	font-style: italic;
	font-size: 14px;
	margin: 0;
}

/* --------------------------------------------------------
   Spinner — match theme accent
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(17, 38, 79, 0.15);
	border-top-color: #11264f;
	border-radius: 50%;
	animation: wbte-ewb-spin 0.6s linear infinite;
}

/* --------------------------------------------------------
   Description text
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-form-description {
	margin: 0 0 18px;
	padding: 14px 16px;
	border-radius: 14px;
	background: #f8fafc;
	border: 1px solid rgba(148, 163, 184, 0.15);
	font-size: 13px;
	line-height: 1.65;
	color: #64748b;
}

/* --------------------------------------------------------
   Submit button
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-btn--withdrawal,
.pd-withdrawal-shell .wbte-ewb-btn--withdrawal.button,
.pd-withdrawal-shell .wbte-ewb-btn--withdrawal.button.alt {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 54px;
	padding: 0 24px;
	border: 0;
	border-radius: 18px;
	background: #11264f !important;
	box-shadow: 0 16px 32px rgba(17, 38, 79, 0.2);
	color: #ffffff !important;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.pd-withdrawal-shell .wbte-ewb-btn--withdrawal:hover,
.pd-withdrawal-shell .wbte-ewb-btn--withdrawal.button:hover,
.pd-withdrawal-shell .wbte-ewb-btn--withdrawal.button.alt:hover {
	transform: translateY(-1px);
	background: #0c1a37 !important;
	box-shadow: 0 20px 36px rgba(17, 38, 79, 0.24);
	color: #ffffff !important;
}

.pd-withdrawal-shell .wbte-ewb-btn--withdrawal:disabled,
.pd-withdrawal-shell .wbte-ewb-btn--withdrawal.disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
	box-shadow: 0 8px 20px rgba(17, 38, 79, 0.12);
}

/* --------------------------------------------------------
   Messages — success, error, info
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-success-message {
	padding: 14px 18px;
	margin-bottom: 18px;
	border: 1px solid rgba(34, 197, 94, 0.25);
	border-radius: 14px;
	background: linear-gradient(180deg, rgba(240, 253, 244, 0.9), rgba(220, 252, 231, 0.5));
	color: #166534;
	font-size: 14px;
	line-height: 1.6;
}

.pd-withdrawal-shell .wbte-ewb-success-message p {
	margin: 0;
}

.pd-withdrawal-shell .wbte-ewb-error-message {
	padding: 14px 18px;
	margin-bottom: 18px;
	border: 1px solid rgba(220, 38, 38, 0.2);
	border-radius: 14px;
	background: linear-gradient(180deg, rgba(254, 242, 242, 0.9), rgba(254, 226, 226, 0.5));
	color: #991b1b;
	font-size: 14px;
	line-height: 1.6;
}

.pd-withdrawal-shell .wbte-ewb-error-message ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pd-withdrawal-shell .wbte-ewb-error-message li {
	margin-bottom: 4px;
}

.pd-withdrawal-shell .wbte-ewb-error-message li:last-child {
	margin-bottom: 0;
}

.pd-withdrawal-shell .wbte-ewb-info-message {
	padding: 14px 18px;
	margin-bottom: 18px;
	border: 1px solid rgba(59, 130, 246, 0.2);
	border-radius: 14px;
	background: linear-gradient(180deg, rgba(239, 246, 255, 0.9), rgba(219, 234, 254, 0.5));
	color: #1e40af;
	font-size: 14px;
	line-height: 1.6;
}

.pd-withdrawal-shell .wbte-ewb-info-message p {
	margin: 0;
}

/* --------------------------------------------------------
   Verification success result
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-verification-result {
	max-width: none;
	margin: 0;
	padding: 48px 24px;
	text-align: center;
}

.pd-withdrawal-shell .wbte-ewb-verification-result--success {
	border: 1px solid rgba(34, 197, 94, 0.2);
	border-radius: 22px;
	background: linear-gradient(180deg, rgba(240, 253, 244, 0.9), rgba(220, 252, 231, 0.5));
}

.pd-withdrawal-shell .wbte-ewb-verification-result__icon {
	width: 72px;
	height: 72px;
	margin: 0 auto 20px;
	border-radius: 22px;
	background: #22c55e;
	box-shadow: 0 14px 28px rgba(34, 197, 94, 0.2);
}

.pd-withdrawal-shell .wbte-ewb-verification-result__title {
	font-size: clamp(22px, 3vw, 28px);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: #166534;
}

.pd-withdrawal-shell .wbte-ewb-verification-result__message {
	font-size: 15px;
	line-height: 1.7;
	color: #15803d;
}

/* --------------------------------------------------------
   Status badges
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-badge {
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.pd-withdrawal-shell .wbte-ewb-badge--pending {
	background: #fff7ed;
	color: #c2410c;
	border: 1px solid rgba(251, 146, 60, 0.3);
}

.pd-withdrawal-shell .wbte-ewb-badge--approved {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid rgba(74, 222, 128, 0.3);
}

.pd-withdrawal-shell .wbte-ewb-badge--rejected {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid rgba(248, 113, 113, 0.3);
}

/* --------------------------------------------------------
   Footer link
   -------------------------------------------------------- */
.pd-withdrawal-shell .wbte-ewb-footer-link {
	text-align: center;
	padding: 18px 0 0;
	font-size: 13px;
}

.pd-withdrawal-shell .wbte-ewb-footer-link a {
	color: #64748b;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

.pd-withdrawal-shell .wbte-ewb-footer-link a:hover {
	color: #11264f;
}

/* --------------------------------------------------------
   Responsive — tablets
   -------------------------------------------------------- */
@media screen and (max-width: 768px) {
	.pd-withdrawal-shell {
		padding: 0 0 36px;
	}

	.pd-withdrawal-shell .wbte-ewb-form {
		padding: 18px;
		border-radius: 18px;
	}

	.pd-withdrawal-shell .wbte-ewb-item {
		grid-template-columns: 20px 40px 1fr auto;
		gap: 10px;
		padding: 12px 14px;
		border-radius: 12px;
	}

	.pd-withdrawal-shell .wbte-ewb-item:not(:has(.wbte-ewb-item-thumb)) {
		grid-template-columns: 20px 1fr auto;
	}

	.pd-withdrawal-shell .wbte-ewb-item-thumb {
		width: 40px;
		height: 40px;
		min-width: 40px;
		min-height: 40px;
		border-radius: 8px;
	}

	.pd-withdrawal-shell .wbte-ewb-item-price {
		grid-column: auto;
	}

	.pd-withdrawal-shell .wbte-ewb-item-qty {
		display: none;
	}
}

/* --------------------------------------------------------
   Responsive — mobile
   -------------------------------------------------------- */
@media screen and (max-width: 480px) {
	.pd-withdrawal-shell .wbte-ewb-name-row {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.pd-withdrawal-shell .wbte-ewb-name-row .form-row {
		margin-bottom: 18px;
	}

	.pd-withdrawal-shell .wbte-ewb-item {
		grid-template-columns: 20px 40px 1fr;
		gap: 8px;
		padding: 12px;
	}

	.pd-withdrawal-shell .wbte-ewb-item:not(:has(.wbte-ewb-item-thumb)) {
		grid-template-columns: 20px 1fr;
	}

	.pd-withdrawal-shell .wbte-ewb-item-qty,
	.pd-withdrawal-shell .wbte-ewb-item-price {
		grid-column: 3 / -1;
	}

	.pd-withdrawal-shell .wbte-ewb-item:not(:has(.wbte-ewb-item-thumb)) .wbte-ewb-item-qty,
	.pd-withdrawal-shell .wbte-ewb-item:not(:has(.wbte-ewb-item-thumb)) .wbte-ewb-item-price {
		grid-column: 2 / -1;
	}

	.pd-withdrawal-shell .wbte-ewb-item-reason {
		grid-column: 1 / -1;
		margin-left: 0;
	}

	.pd-withdrawal-shell .wbte-ewb-form .input-text,
	.pd-withdrawal-shell .wbte-ewb-form select,
	.pd-withdrawal-shell .wbte-ewb-form textarea {
		min-height: 48px;
		border-radius: 14px;
	}

	.pd-withdrawal-shell .wbte-ewb-btn--withdrawal,
	.pd-withdrawal-shell .wbte-ewb-btn--withdrawal.button,
	.pd-withdrawal-shell .wbte-ewb-btn--withdrawal.button.alt {
		min-height: 48px;
		border-radius: 14px;
	}
}
