/* Container */
.fice-form-container {
	max-width: 800px;
	margin: 50px auto;
	padding: 50px;
	background: #ffffff;
	border: 1px solid #eaeaea;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Hide any p tags inside form (wpautop/block editor can inject them) */
.fice-form-container .fice-form p,
.fice-form-container p:not(.fice-form-intro) {
	display: none !important;
}

.fice-form-intro {
	display: block !important;
	margin: 0 0 24px;
	padding: 0;
	font-size: 15px;
	line-height: 1.6;
	color: #4a5568;
	grid-column: 1 / -1;
}

/* Grid Layout */
.fice-form {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	column-gap: 30px;
	row-gap: 25px;
}

/* Full width elements in grid */
.fice-col-full,
.fice-form-submit,
.fice-form-response,
.fice-loader-container {
	grid-column: 1 / -1;
}

.fice-col-half {
	grid-column: span 1;
}

/* Form Groups */
.fice-form-group {
	display: flex;
	flex-direction: column;
	/* Extra breathing room removed to rely on grid gap */
	position: relative;
	/* Ensure z-index context */
}

.fice-form label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #2d3748;
	font-size: 14px;
	letter-spacing: 0.01em;
}

.fice-form label .required {
	color: #e53e3e;
	margin-left: 2px;
	font-weight: 600;
}

.fice-checkbox-group .required,
.fice-checkbox-label .required {
	flex-shrink: 0;
	margin-left: 4px;
	color: #e53e3e;
	font-weight: 700;
}

/* Inputs */
.fice-form input[type="text"],
.fice-form input[type="email"],
.fice-form input[type="tel"],
.fice-form input[type="number"],
.fice-form select,
.fice-form textarea {
	width: 95%;
	padding: 12px 16px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-size: 15px;
	color: #4a5568;
	background-color: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
	line-height: 1.5;
}

.fice-form select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
	background-position: right 0.5rem center;
	background-repeat: no-repeat;
	background-size: 1.5em 1.5em;
	padding-right: 2.5rem;
}

.fice-form input:focus,
.fice-form select:focus,
.fice-form textarea:focus {
	border-color: #a9803b;
	outline: none;
	box-shadow: 0 0 0 3px rgba(169, 128, 59, 0.15);
	z-index: 5;
	position: relative;
}

.fice-form input::placeholder {
	color: #a0aec0;
}

.fice-form textarea {
	resize: vertical;
	min-height: 120px;
}

/* Checkboxes */
.fice-checkbox-group label,
.fice-checkbox-label {
	font-weight: 400;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
	font-size: 14px;
	color: #4a5568;
	line-height: 1.5;
}

.fice-checkbox-group label span,
.fice-checkbox-label span {
	flex: 1;
	min-width: 0;
	user-select: none;
}

.fice-form input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	background-color: #fff;
	margin: 3px 0 0;
	font: inherit;
	color: currentColor;
	width: 1.15em;
	height: 1.15em;
	border: 1px solid #cbd5e0;
	border-radius: 4px;
	display: grid;
	place-content: center;
	flex-shrink: 0;
	transition: all 0.2s ease;
}

.fice-form input[type="checkbox"]::before {
	content: "";
	width: 0.65em;
	height: 0.65em;
	transform: scale(0);
	transition: 120ms transform ease-in-out;
	box-shadow: inset 1em 1em white;
	transform-origin: center;
	clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.fice-form input[type="checkbox"]:checked {
	background-color: #a9803b;
	border-color: #a9803b;
}

.fice-form input[type="checkbox"]:checked::before {
	transform: scale(1);
}

.fice-form input[type="checkbox"]:focus {
	box-shadow: 0 0 0 3px rgba(169, 128, 59, 0.15);
	border-color: #a9803b;
}

/* File Upload - Fancy Dropbox (half width in 2-col row) */
.fice-form-group-file {
	margin-top: 4px;
	margin-bottom: 4px;
}

/* One row, two fields only: dropbox | accept terms */
.fice-form-one-row-two-cols {
	grid-column: 1 / -1;
	display: flex;
	gap: 30px;
	flex-wrap: nowrap;
	align-items: stretch;
}

.fice-form-one-row-two-cols > .fice-form-group {
	flex: 1;
	min-width: 0;
}

.fice-checkboxes-col {
	display: flex;
	flex-direction: column;
	gap: 16px;
	justify-content: flex-start;
}

.fice-file-upload-wrapper {
	position: relative;
	border: 2px dashed #cbd5e0;
	border-radius: 12px;
	padding: 32px 24px;
	text-align: center;
	background-color: #f8fafc;
	transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 140px;
	box-sizing: border-box;
	width: 100%;
}

.fice-file-upload-wrapper:hover,
.fice-file-upload-wrapper.fice-dragover {
	border-color: #a9803b;
	background-color: #fffbeb;
	box-shadow: 0 0 0 4px rgba(169, 128, 59, 0.08);
}

/* Upload icon (CSS-only cloud/arrow) */
.fice-upload-icon {
	position: relative;
	z-index: 1;
	pointer-events: none;
	width: 48px;
	height: 48px;
	display: block;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a9803b' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5'/%3E%3C/svg%3E") center/contain no-repeat;
	opacity: 0.85;
}

.fice-file-upload-wrapper:hover .fice-upload-icon,
.fice-file-upload-wrapper.fice-dragover .fice-upload-icon {
	opacity: 1;
}

.fice-upload-text {
	font-size: 16px;
	color: #2d3748;
	font-weight: 600;
	line-height: 1.4;
}

.fice-upload-hint {
	position: relative;
	z-index: 1;
	pointer-events: none;
	font-size: 13px;
	color: #718096;
	font-weight: 400;
}

.fice-file-upload-wrapper .fice-upload-text,
.fice-file-upload-wrapper .fice-file-preview {
	position: relative;
	z-index: 1;
	pointer-events: none;
}

/* File input only opens via dropzone click – hidden from view */
.fice-file-input-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	pointer-events: none;
}

/* Select wrapper - full width like other inputs */
.fice-select-wrapper {
	position: relative;
	width: 100%;
}

.fice-select-wrapper select {
	width: 100% !important;
	max-width: 100%;
	box-sizing: border-box;
}

.fice-file-preview {
	width: 100%;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
}

.fice-file-item {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	padding: 8px 16px;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.fice-file-name {
	font-size: 14px;
	color: #2d3748;
	font-weight: 500;
	max-width: 200px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fice-file-remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background-color: #edf2f7;
	color: #718096;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	transition: all 0.2s;
	pointer-events: auto;
}

.fice-file-remove:hover {
	background-color: #fed7d7;
	color: #e53e3e;
}

/* Button */
.fice-form-submit {
	margin-top: 10px;
}

.fice-button {
	width: 100%;
	background-color: #a9803b;
	color: #fff;
	border: none;
	padding: 16px 24px;
	font-size: 16px;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	box-shadow: 0 4px 6px rgba(169, 128, 59, 0.2);
}

.fice-button:hover {
	background-color: #977234;
	transform: translateY(-1px);
	box-shadow: 0 6px 12px rgba(169, 128, 59, 0.25);
}

.fice-button:active {
	transform: translateY(0);
}

.fice-button:disabled {
	background-color: #cbd5e0;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Messages & Loader */
.fice-form-response {
	margin-bottom: 20px;
	min-height: 0;
}

.fice-form-response:empty {
	display: none;
}

.fice-form-hidden {
	display: none !important;
}

.fice-form-success {
	text-align: center;
	padding: 48px 32px 56px;
	max-width: 420px;
	margin: 0 auto;
}

.fice-success-tick {
	width: 72px;
	height: 72px;
	margin: 0 auto 24px;
	border-radius: 50%;
	background-color: #2f855a;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
	background-size: 40px 40px;
	background-position: center;
	background-repeat: no-repeat;
	animation: fice-tick-in 0.4s ease-out;
}

@keyframes fice-tick-in {
	0% {
		transform: scale(0.6);
		opacity: 0;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.fice-success-title {
	font-size: 28px;
	font-weight: 700;
	color: #1a202c;
	margin: 0 0 12px;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.fice-success-lead {
	font-size: 18px;
	font-weight: 600;
	color: #2f855a;
	margin: 0 0 8px;
	line-height: 1.4;
}

.fice-success-text {
	font-size: 15px;
	color: #4a5568;
	margin: 0;
	line-height: 1.5;
}

.fice-form-success p:empty {
	display: none !important;
}

.fice-form-container .fice-form-success + p,
.fice-form-container > p:empty {
	display: none !important;
}

.fice-message {
	padding: 15px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
}

.fice-success {
	background-color: #f0fff4;
	color: #2f855a;
	border: 1px solid #c6f6d5;
}

.fice-error {
	background-color: #fff5f5;
	color: #c53030;
	border: 1px solid #fed7d7;
}

.fice-input-error {
	border-color: #fc8181 !important;
	background-color: #fff5f5 !important;
}

.fice-input-error-text {
	color: #e53e3e;
}

.fice-loader-container {
	display: none;
	justify-content: center;
	margin-top: 15px;
}

.fice-loader {
	width: 24px;
	height: 24px;
	border: 3px solid #edf2f7;
	border-top: 3px solid #a9803b;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
	.fice-form-container {
		padding: 25px;
		margin: 20px 15px;
	}

	.fice-form {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.fice-col-half {
		grid-column: 1 / -1;
	}

	.fice-form-one-row-two-cols {
		flex-direction: column;
	}

	.fice-form-one-row-two-cols > .fice-form-group {
		min-width: 100%;
	}
}