/* WSFA Shipment Waybill — front-end form styles */
.wsfa-wrap {
	--wsfa-red: #c1272d;
	--wsfa-red-dark: #9c1e23;
	--wsfa-ink: #222;
	--wsfa-muted: #6b6b6b;
	--wsfa-line: #d9d9d9;
	--wsfa-bg: #fff;
	--wsfa-field-bg: #fff;
	--wsfa-radius: 6px;
	max-width: 860px;
	margin: 0 auto;
	color: var(--wsfa-ink);
	font-size: 15px;
	line-height: 1.4;
	box-sizing: border-box;
}
.wsfa-wrap *,
.wsfa-wrap *::before,
.wsfa-wrap *::after {
	box-sizing: border-box;
}

.wsfa-form {
	background: var(--wsfa-bg);
	border: 1px solid var(--wsfa-line);
	border-top: 5px solid var(--wsfa-red);
	border-radius: var(--wsfa-radius);
	padding: 26px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.wsfa-header {
	margin-bottom: 18px;
}
.wsfa-title {
	margin: 0 0 4px;
	color: var(--wsfa-red);
	font-size: 26px;
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: 0.2px;
}
.wsfa-sub {
	margin: 0;
	color: var(--wsfa-muted);
}

/* Sections */
.wsfa-section {
	border: 1px solid var(--wsfa-line);
	border-radius: var(--wsfa-radius);
	padding: 16px 18px 20px;
	margin: 0 0 18px;
}
.wsfa-section > legend {
	padding: 2px 10px;
	font-weight: 700;
	color: #fff;
	background: var(--wsfa-red);
	border-radius: 4px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
}
.wsfa-note {
	margin: 0 0 10px;
	color: var(--wsfa-muted);
	font-size: 13px;
	font-style: italic;
}

/* Grid layout */
.wsfa-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 14px;
}
.wsfa-field {
	display: flex;
	flex-direction: column;
	flex: 1 1 100%;
	min-width: 0;
}
.wsfa-w-full   { flex-basis: 100%; }
.wsfa-w-half   { flex-basis: calc(50% - 7px); }
.wsfa-w-third  { flex-basis: calc(33.333% - 10px); }

.wsfa-field label {
	font-weight: 600;
	font-size: 13px;
	margin-bottom: 5px;
	color: #333;
}
.wsfa-req { color: var(--wsfa-red); }

.wsfa-field input,
.wsfa-field textarea,
.wsfa-items input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--wsfa-line);
	border-radius: 5px;
	background: var(--wsfa-field-bg);
	color: var(--wsfa-ink);
	font-size: 15px;
	font-family: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wsfa-field textarea { resize: vertical; }
.wsfa-field input:focus,
.wsfa-field textarea:focus,
.wsfa-items input:focus {
	outline: none;
	border-color: var(--wsfa-red);
	box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.12);
}
.wsfa-field.wsfa-error input,
.wsfa-field.wsfa-error textarea {
	border-color: var(--wsfa-red);
	background: #fff6f6;
}

/* Inline checkboxes */
.wsfa-inline-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 14px;
	margin: 4px 0 10px;
	cursor: pointer;
}
.wsfa-inline-check input {
	margin-top: 2px;
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}
.wsfa-consent {
	margin: 16px 0 0;
	color: #333;
}

/* Items table */
.wsfa-items { margin-top: 16px; }
.wsfa-items-head h4 {
	margin: 0 0 2px;
	font-size: 15px;
	color: var(--wsfa-red);
}
.wsfa-items-table {
	margin-top: 10px;
	border: 1px solid var(--wsfa-line);
	border-radius: 5px;
	overflow: hidden;
}
.wsfa-items-row {
	display: grid;
	grid-template-columns: 0.9fr 2.2fr 0.8fr 0.8fr 0.8fr 1fr 40px;
	gap: 8px;
	align-items: center;
	padding: 8px;
	border-bottom: 1px solid var(--wsfa-line);
}
.wsfa-items-row:last-child { border-bottom: 0; }
.wsfa-items-labels {
	background: #f5f5f5;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #555;
}
.wsfa-items-col { min-width: 0; }
.wsfa-items input { padding: 8px 9px; font-size: 14px; }

.wsfa-remove-item {
	width: 30px;
	height: 30px;
	border: 1px solid var(--wsfa-line);
	background: #fff;
	color: var(--wsfa-red);
	border-radius: 5px;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}
.wsfa-remove-item:hover { background: #fff0f0; }
.wsfa-items-remove-col { display: flex; justify-content: center; }

.wsfa-add-item {
	margin-top: 10px;
	background: transparent;
	border: 1px dashed var(--wsfa-red);
	color: var(--wsfa-red);
	padding: 8px 14px;
	border-radius: 5px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}
.wsfa-add-item:hover { background: #fff0f0; }

/* Insurance notice */
.wsfa-insurance {
	background: #fbf3f3;
	border: 1px solid #f0d9da;
	border-left: 4px solid var(--wsfa-red);
	border-radius: 5px;
	padding: 12px 14px;
	margin: 4px 0 4px;
	font-size: 13px;
}
.wsfa-insurance strong { color: var(--wsfa-red); }
.wsfa-insurance p { margin: 4px 0 0; color: #555; }

/* Honeypot */
.wsfa-hp {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	height: 0;
	overflow: hidden;
}

/* Actions */
.wsfa-actions { margin-top: 20px; }
.wsfa-submit {
	background: var(--wsfa-red);
	color: #fff;
	border: 0;
	padding: 14px 34px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.05s ease;
}
.wsfa-submit:hover { background: var(--wsfa-red-dark); }
.wsfa-submit:active { transform: translateY(1px); }
.wsfa-submit:disabled { opacity: 0.65; cursor: default; }

/* Messages */
.wsfa-messages { display: none; margin-bottom: 16px; }
.wsfa-messages.is-visible { display: block; }
.wsfa-messages .wsfa-msg {
	padding: 14px 16px;
	border-radius: 6px;
	font-size: 15px;
}
.wsfa-messages .wsfa-msg-success {
	background: #edf7ed;
	border: 1px solid #cce8cc;
	color: #1e6b26;
}
.wsfa-messages .wsfa-msg-error {
	background: #fdecea;
	border: 1px solid #f5c6c3;
	color: #a12820;
}

/* Responsive */
@media (max-width: 680px) {
	.wsfa-form { padding: 18px; }
	.wsfa-w-half,
	.wsfa-w-third { flex-basis: 100%; }

	.wsfa-items-table { border: 0; }
	.wsfa-items-labels { display: none; }
	.wsfa-items-row {
		grid-template-columns: 1fr 1fr;
		border: 1px solid var(--wsfa-line);
		border-radius: 6px;
		margin-bottom: 10px;
		padding: 10px;
	}
	.wsfa-items-col[data-label]::before {
		content: attr(data-label);
		display: block;
		font-size: 11px;
		font-weight: 700;
		text-transform: uppercase;
		color: #777;
		margin-bottom: 3px;
	}
	.wsfa-items-col[data-label="Description"] { grid-column: 1 / -1; }
	.wsfa-items-remove-col { grid-column: 1 / -1; justify-content: flex-end; }
}
