/**
 * OneCRM Forms - Public Styles
 *
 * @package OneCRM_Forms
 * @since   1.0.0
 */

/* Form Wrapper */
.onecrm-form-wrapper {
	max-width: 700px;
	margin: 0 auto;
	padding: 20px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
}

/* Form Description */
.onecrm-form-description {
	margin-bottom: 20px;
	color: #666;
	line-height: 1.6;
}

/* Form Fields */
.onecrm-form-fields {
	margin-bottom: 20px;
}

.onecrm-form-field {
	margin-bottom: 20px;
}

.onecrm-field-label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	color: #333;
}

.required-indicator {
	color: #d63638;
	margin-left: 3px;
}

/* Input Fields */
.onecrm-input,
.onecrm-textarea,
.onecrm-select {
	width: 100%;
	padding: 10px;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.5;
	transition: border-color 0.2s ease;
}

.onecrm-input:focus,
.onecrm-textarea:focus,
.onecrm-select:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

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

/* Radio and Checkbox Fields */
.onecrm-radio-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.onecrm-radio-label,
.onecrm-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.onecrm-radio,
.onecrm-checkbox {
	margin: 0;
	cursor: pointer;
}

/* File Input */
.onecrm-file-input {
	width: 100%;
	padding: 5px;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	background: #fff;
}

/* Field Description */
.onecrm-field-description {
	margin-top: 5px;
	font-size: 13px;
	color: #666;
	font-style: italic;
}

/* Conditional Fields */
.onecrm-form-field[data-conditional] {
	display: none;
}

.onecrm-form-field[data-conditional].visible {
	display: block;
}

/* Form Messages */
.onecrm-form-messages {
	margin-bottom: 20px;
	padding: 15px;
	border-radius: 4px;
	display: none;
}

.onecrm-form-messages.visible {
	display: block;
}

.onecrm-form-messages.success {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.onecrm-form-messages.error {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Form Actions */
.onecrm-form-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.onecrm-form-submit {
	padding: 12px 24px;
	background-color: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.onecrm-form-submit:hover {
	background-color: #135e96;
}

.onecrm-form-submit:disabled {
	background-color: #ccc;
	cursor: not-allowed;
}

/* Loading Spinner */
.onecrm-form-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-radius: 50%;
	border-top-color: #2271b1;
	animation: onecrm-spin 1s ease-in-out infinite;
}

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

/* Honeypot (Hidden) */
.onecrm-hp-field {
	position: absolute;
	left: -9999px;
}

/* Responsive */
@media screen and (max-width: 600px) {
	.onecrm-form-wrapper {
		padding: 15px;
	}

	.onecrm-form-submit {
		width: 100%;
	}

	.onecrm-form-actions {
		flex-direction: column;
	}
}

/* Accessibility */
.onecrm-form input:focus,
.onecrm-form textarea:focus,
.onecrm-form select:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
	.onecrm-form-wrapper {
		background: #1e1e1e;
		border-color: #444;
		color: #e0e0e0;
	}

	.onecrm-field-label {
		color: #e0e0e0;
	}

	.onecrm-input,
	.onecrm-textarea,
	.onecrm-select {
		background: #2d2d2d;
		border-color: #444;
		color: #e0e0e0;
	}

	.onecrm-form-description,
	.onecrm-field-description {
		color: #b0b0b0;
	}
}

/* Conditional Fields */
.onecrm-form-field[data-conditional] {
display: none;
}

.onecrm-form-field[data-conditional].visible {
display: block;
}

/* Service Selection Form */
.onecrm-service-form .onecrm-template-fields {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #ddd;
}

.onecrm-loading-template {
	padding: 20px;
	text-align: center;
	color: #666;
	font-size: 14px;
}

.onecrm-loading-template .onecrm-form-spinner {
	vertical-align: middle;
	margin-right: 8px;
}

/* Service form submit button hidden by default */
.onecrm-service-form .onecrm-form-submit {
	display: none;
}

/* Service Selector Shortcode */
.onecrm-service-selector-wrapper {
	max-width: 700px;
	margin: 0 auto;
	padding: 20px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.onecrm-service-selector-field {
	margin-bottom: 30px;
}

.onecrm-selector-label {
	display: block;
	margin-bottom: 10px;
	font-weight: 600;
	font-size: 16px;
	color: #333;
}

.onecrm-service-select {
	width: 100%;
	padding: 12px;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	font-size: 15px;
	line-height: 1.5;
	transition: border-color 0.2s ease;
}

.onecrm-service-select:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.onecrm-service-template-container {
	margin-top: 30px;
	padding-top: 20px;
	border-top: 2px solid #ddd;
}
