/**
 * Codeart EU Withdrawal — frontend form (theme-independent).
 * Scoped under .cw-wrap to avoid clashing with themes.
 */

.cw-wrap {
	max-width: 640px;
	margin: 0 auto;
	font-size: 15px;
	line-height: 1.55;
	color: #1f2937;
}

.cw-wrap * { box-sizing: border-box; }

.cw-legal {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-left: 4px solid #2563eb;
	border-radius: 6px;
	padding: 12px 16px;
	margin-bottom: 16px;
	font-size: 14px;
	color: #334155;
}

.cw-no-reason {
	font-size: 13px;
	color: #475569;
	margin: 0 0 20px;
}

.cw-notice {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 18px;
	font-size: 14px;
}
.cw-notice-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.cw-notice-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.cw-title { font-size: 18px; margin: 0 0 6px; }
.cw-help { font-size: 13px; color: #64748b; margin: 0 0 16px; }
.cw-ai-notice { font-size: 12px; color: #64748b; margin: 8px 0 0; line-height: 1.5; }

.cw-field { margin-bottom: 16px; }
.cw-field label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 6px;
	color: #1f2937;
}
.cw-field input[type="text"],
.cw-field input[type="email"],
.cw-field select,
.cw-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 15px;
	font-family: inherit;
	color: #1f2937;
	background: #fff;
}
.cw-field input:focus,
.cw-field select:focus,
.cw-field textarea:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cw-items {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 14px 16px;
	margin-bottom: 16px;
}
.cw-items legend {
	font-weight: 600;
	font-size: 14px;
	padding: 0 6px;
}
.cw-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	font-size: 14px;
	border-bottom: 1px dashed #e2e8f0;
	font-weight: 400;
}
.cw-item:last-child { border-bottom: none; }
.cw-item input[type="checkbox"] { width: 18px; height: 18px; }
.cw-item-name { flex: 1; }
.cw-item-qty { color: #64748b; font-size: 13px; }

/* Single-product order: auto-included item (no selection needed) */
.cw-single-item {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 14px;
	margin-bottom: 16px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-size: 14px;
}
.cw-single-label { width: 100%; color: #64748b; font-size: 12px; }
.cw-single-item .cw-item-name { font-weight: 600; }

/* Items already covered by an active request (partial withdrawal) */
.cw-item-disabled { opacity: 0.55; cursor: not-allowed; }
.cw-item-disabled .cw-item-name { text-decoration: line-through; }
.cw-item-tag {
	font-size: 11px;
	font-weight: 600;
	color: #92400e;
	background: #fef3c7;
	border-radius: 999px;
	padding: 2px 8px;
}

.cw-order-label { font-weight: 600; margin-bottom: 12px; }

.cw-warning {
	background: #fffbeb;
	border: 1px solid #fde68a;
	color: #92400e;
	border-radius: 6px;
	padding: 10px 14px;
	margin-bottom: 12px;
	font-size: 13px;
}

.cw-btn {
	display: inline-block;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 12px 22px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}
.cw-btn:hover { background: #1d4ed8; }
.cw-verify-btn { margin-top: 4px; }

.cw-ajax-error { color: #b91c1c; font-size: 13px; margin-top: 8px; }
.cw-loading { color: #64748b; font-size: 14px; }
.cw-empty { color: #64748b; font-size: 14px; }

/* Inline loading (item area) */
.cw-inline-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #64748b;
	font-size: 14px;
	padding: 14px 2px;
}
.cw-spinner-sm {
	width: 22px;
	height: 22px;
	border-width: 3px;
	margin: 0;
}

/* Button loading state (e.g. "Provjeri narudžbu") */
.cw-btn-loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}
.cw-btn-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid rgba(255, 255, 255, 0.55);
	border-top-color: #fff;
	border-radius: 50%;
	animation: cw-spin 0.7s linear infinite;
}

.cw-hidden { display: none; }

/* ---- Submit modal / splash ---- */
.cw-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.cw-modal-overlay[hidden] { display: none; }
.cw-modal-overlay.is-open { opacity: 1; }

.cw-modal {
	width: 100%;
	max-width: 420px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(2, 6, 23, 0.35);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.cw-modal-overlay.is-open .cw-modal { transform: translateY(0) scale(1); }

.cw-modal-body {
	padding: 34px 28px;
	text-align: center;
}
.cw-modal-title {
	margin: 18px 0 6px;
	font-size: 19px;
	font-weight: 700;
	color: #0f172a;
}
.cw-modal-text {
	margin: 0;
	font-size: 14px;
	color: #475569;
	line-height: 1.55;
}
.cw-modal .cw-btn { margin-top: 22px; }

/* Spinner */
.cw-spinner {
	display: block; /* works even as a <span> (inline elements ignore width/height) */
	box-sizing: border-box;
	width: 54px;
	height: 54px;
	margin: 0 auto;
	border: 5px solid #e2e8f0;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: cw-spin 0.8s linear infinite;
}
@keyframes cw-spin { to { transform: rotate(360deg); } }

/* Success / error icons */
.cw-modal-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 34px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	animation: cw-pop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.cw-icon-success { background: #16a34a; }
.cw-icon-error { background: #dc2626; }
@keyframes cw-pop {
	0% { transform: scale(0.5); opacity: 0; }
	100% { transform: scale(1); opacity: 1; }
}

/* Account modal — form variant (item selection from My Account) */
.cw-modal { max-height: 90vh; overflow-y: auto; }
.cw-modal-body.cw-acc-form { text-align: left; padding: 26px; }
.cw-acc-form .cw-modal-title { text-align: left; margin: 0 0 14px; }
.cw-acc-legal {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-left: 4px solid #2563eb;
	border-radius: 6px;
	padding: 10px 14px;
	font-size: 13px;
	color: #334155;
	margin-bottom: 12px;
}
.cw-acc-noreason { font-size: 13px; color: #475569; margin: 0 0 14px; }
.cw-acc-items { margin-bottom: 14px; }
.cw-acc-items .cw-items { margin-bottom: 0; }
.cw-acc-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: #1f2937; }
.cw-acc-message {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-family: inherit;
	font-size: 14px;
	color: #1f2937;
}
.cw-acc-message:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.cw-acc-error { min-height: 18px; margin: 8px 0 0; }
.cw-acc-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.cw-btn-ghost { background: #f1f5f9; color: #334155; }
.cw-btn-ghost:hover { background: #e2e8f0; }
.cw-acc-loading { text-align: center; padding: 30px 0; }
.cw-acc-loading .cw-spinner { margin: 0 auto 14px; }

/* My Account action button */
.cw-account-actions { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
	.cw-spinner { animation-duration: 1.4s; }
	.cw-modal, .cw-modal-overlay, .cw-modal-icon { transition: none; animation: none; }
}
