/* Zicplug Frontend Styles */

.zicplug-form-wrapper {
	box-sizing: border-box;
	position: relative;
}

.zicplug-form-wrapper *,
.zicplug-form-wrapper *::before,
.zicplug-form-wrapper *::after {
	box-sizing: inherit;
}

.zicplug-form {
	width: 100%;
}

/* Fields Grid */
.zicplug-fields-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0 16px;
}

.zicplug-field-wrap {
	width: 100%;
	margin-bottom: 16px;
}

.zicplug-width-full  { width: 100%; }
.zicplug-width-half  { width: calc(50% - 8px); }
.zicplug-width-third { width: calc(33.333% - 11px); }

@media (max-width: 640px) {
	.zicplug-width-half,
	.zicplug-width-third {
		width: 100%;
	}
}

/* Labels */
.zicplug-label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 0.9em;
}

.zicplug-group-label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	font-size: 0.9em;
}

.zicplug-required {
	color: #e53e3e;
	margin-left: 3px;
}

/* Inputs */
.zicplug-input,
.zicplug-textarea,
.zicplug-select {
	display: block;
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	font-size: 15px;
	line-height: 1.5;
	color: #495057;
	background-color: #f8f9fa;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	font-family: inherit;
	appearance: none;
	-webkit-appearance: none;
}

.zicplug-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}

.zicplug-textarea {
	resize: vertical;
	min-height: 100px;
}

.zicplug-input:focus,
.zicplug-textarea:focus,
.zicplug-select:focus {
	outline: none;
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Field validation states */
.zicplug-input.zicplug-invalid,
.zicplug-textarea.zicplug-invalid,
.zicplug-select.zicplug-invalid {
	border-color: #e53e3e;
	box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
}

.zicplug-field-error {
	display: none;
	color: #e53e3e;
	font-size: 0.82em;
	margin-top: 4px;
}

.zicplug-field-error.visible {
	display: block;
}

.zicplug-field-hint {
	display: block;
	color: #6b7280;
	font-size: 0.8em;
	margin-top: 4px;
}

/* File upload */
.zicplug-file {
	display: block;
	width: 100%;
	padding: 8px;
	border: 2px dashed #dee2e6;
	border-radius: 6px;
	font-size: 14px;
	cursor: pointer;
	background: #f8f9fa;
}

.zicplug-file:focus {
	outline: none;
	border-color: #4f46e5;
}

/* Radio & Checkbox */
.zicplug-radio-group,
.zicplug-checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.zicplug-radio-label,
.zicplug-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-weight: 400;
	font-size: 0.95em;
}

.zicplug-radio,
.zicplug-checkbox {
	width: 17px;
	height: 17px;
	flex-shrink: 0;
	accent-color: #4f46e5;
	cursor: pointer;
}

/* Honeypot */
.zicplug-hp-wrap {
	position: absolute !important;
	left: -9999px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* Submit button */
.zicplug-submit-wrap {
	margin-top: 8px;
}

.zicplug-submit-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	background-color: #4f46e5;
	color: #ffffff;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease;
	text-decoration: none;
}

.zicplug-submit-btn:hover {
	filter: brightness(90%);
}

.zicplug-submit-btn:active {
	transform: translateY(1px);
}

.zicplug-submit-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* Spinner */
.zicplug-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: zicplug-spin 0.7s linear infinite;
	flex-shrink: 0;
}

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

/* Messages */
.zicplug-messages {
	margin-top: 16px;
}

.zicplug-success-message {
	padding: 14px 18px;
	background-color: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-left: 4px solid #22c55e;
	border-radius: 6px;
	color: #166534;
	font-size: 0.95em;
	line-height: 1.5;
}

.zicplug-error-message {
	padding: 14px 18px;
	background-color: #fef2f2;
	border: 1px solid #fecaca;
	border-left: 4px solid #e53e3e;
	border-radius: 6px;
	color: #991b1b;
	font-size: 0.95em;
	line-height: 1.5;
}

/* Shortcode preview error (admin only) */
.zicplug-shortcode-error {
	color: #e53e3e !important;
	font-style: italic;
}
