/**
 * Frontend public form rendering styling.
 *
 * @package    Clicks_Advance_Forms_Builder
 * @subpackage Clicks_Advance_Forms_Builder/public/css
 */

.clicks-form-container {
	font-family: 'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	padding: 30px;
	border-radius: 12px;
	box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
	max-width: 100%;
	box-sizing: border-box;
	margin: 20px 0;
}

/* Grid Layout */
.clicks-form-grid-layout {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 20px;
}

.clicks-field-wrap {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.width-100 { grid-column: span 12; }
.width-50 { grid-column: span 6; }
.width-33 { grid-column: span 4; }

@media (max-width: 768px) {
	.width-50, .width-33 {
		grid-column: span 12;
	}
}

/* Labels & Inputs */
.clicks-field-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #0f172a;
	margin-bottom: 6px;
	line-height: 1.4;
}

.clicks-required-star {
	color: #ef4444;
	margin-left: 2px;
}

.clicks-input {
	width: 100%;
	padding: 10px 14px;
	font-size: 14px;
	line-height: 1.5;
	color: #0f172a;
	background-color: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.02);
	box-sizing: border-box;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.clicks-select {
	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='%2364748B' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
	background-position: right 12px center;
	background-repeat: no-repeat;
	background-size: 18px;
	padding-right: 36px;
}

/* Choices list (checkbox/radio) */
.clicks-choice-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.clicks-choice-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #334155;
	font-weight: 500;
	cursor: pointer;
}

.clicks-choice-label input {
	margin: 0;
	width: 16px;
	height: 16px;
}

/* Helper details */
.clicks-field-desc {
	font-size: 11px;
	color: #64748b;
	margin-top: 4px;
}

.clicks-divider {
	border: none;
	border-top: 1px solid #e2e8f0;
	margin: 10px 0;
	width: 100%;
}

.clicks-html-block {
	font-size: 14px;
	color: #475569;
	line-height: 1.6;
}

/* Multi-step progress indicator */
.clicks-multistep-progress-bar {
	position: relative;
	margin-bottom: 35px;
	padding-top: 10px;
}

.progress-bar-line {
	position: absolute;
	top: 26px;
	left: 5%;
	width: 90%;
	height: 4px;
	background: #e2e8f0;
	z-index: 1;
}

.progress-bar-fill {
	height: 100%;
	background: linear-gradient(135deg, #6366f1, #4f46e5);
	transition: width 0.4s ease;
}

.progress-steps-list {
	display: flex;
	justify-content: space-between;
	position: relative;
	z-index: 2;
}

.progress-step-node {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.progress-step-node .step-num {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #ffffff;
	border: 2px solid #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	color: #64748b;
	transition: all 0.3s ease;
}

.progress-step-node.active .step-num {
	border-color: #4f46e5;
	background: #4f46e5;
	color: #ffffff;
	box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.progress-step-node.completed .step-num {
	border-color: #4f46e5;
	background: #ffffff;
	color: #4f46e5;
}

.progress-step-node .step-label {
	font-size: 11px;
	font-weight: 600;
	color: #64748b;
}

.progress-step-node.active .step-label {
	color: #4f46e5;
}

/* Actions footer */
.clicks-form-footer {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid #e2e8f0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.clicks-action-buttons {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
}

.recaptcha-v2-container, .turnstile-container {
	margin-bottom: 10px;
}

/* Feedback message alerts */
.clicks-form-feedback {
	margin-top: 20px;
	padding: 14px 18px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	box-sizing: border-box;
}

.clicks-form-feedback.success {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.clicks-form-feedback.error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* Spinner Loader */
.clicks-submit-btn .spinner-loader {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255,255,255,0.3);
	border-radius: 50%;
	border-top-color: white;
	animation: spin 1s ease-in-out infinite;
	margin-right: 6px;
	vertical-align: middle;
}

/* =========================================
   PRO Fields Styling (Interactive Elements)
   ========================================= */

/* Signature pad */
.clicks-signature-container {
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	padding: 10px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.clicks-signature-canvas {
	width: 100%;
	height: 150px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	cursor: crosshair;
}

.clicks-signature-clear {
	align-self: flex-end;
	background: white;
	border: 1px solid #cbd5e1;
	font-size: 11px;
	padding: 4px 8px;
	border-radius: 4px;
	cursor: pointer;
}

.clicks-signature-clear:hover {
	background: #f1f5f9;
}

/* Star rating input */
.clicks-star-rating {
	display: flex;
	gap: 4px;
	font-size: 28px;
	cursor: pointer;
	user-select: none;
}

.clicks-star {
	color: #cbd5e1;
	transition: color 0.1s ease;
}

.clicks-star.active,
.clicks-star:hover,
.clicks-star.hover-active {
	color: #f59e0b;
}

/* Range slider */
.clicks-range-slider-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
}

.clicks-range-slider {
	flex-grow: 1;
	margin: 0;
	height: 6px;
	background: #e2e8f0;
	border-radius: 3px;
	outline: none;
}

.clicks-range-value {
	font-size: 14px;
	font-weight: 700;
	color: #4f46e5;
	min-width: 30px;
	text-align: right;
}

/* NPS Input style */
.clicks-nps-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.clicks-nps-grid {
	display: flex;
	gap: 4px;
}

.clicks-nps-btn {
	flex: 1;
	text-align: center;
	padding: 10px 4px;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-weight: 700;
	font-size: 13px;
	color: #475569;
	cursor: pointer;
	transition: all 0.15s ease;
}

.clicks-nps-btn:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
}

.clicks-nps-btn.active {
	background: #4f46e5;
	color: white;
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.nps-labels {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: #64748b;
	font-weight: 600;
}

/* Image choices */
.clicks-image-choices-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 12px;
}

.clicks-image-choice-card {
	background: white;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0,0,0,0.02);
	transition: all 0.2s ease;
}

.clicks-image-choice-card:hover {
	border-color: #94a3b8;
	transform: translateY(-1px);
}

.clicks-image-choice-card.active {
	border-color: #4f46e5;
	background: rgba(79, 70, 229, 0.02);
	box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.clicks-image-choice-card .image-placeholder-icon {
	font-size: 32px;
}

.clicks-image-choice-card .choice-title {
	font-size: 12px;
	font-weight: 600;
	color: #334155;
	text-align: center;
}

/* Password strength meter */
.password-strength-bar {
	height: 4px;
	background: #e2e8f0;
	border-radius: 2px;
	margin-top: 6px;
	overflow: hidden;
	display: none;
}

.strength-fill {
	height: 100%;
	width: 0%;
	transition: width 0.3s ease, background 0.3s ease;
}

.password-strength-label {
	font-size: 10px;
	font-weight: 600;
	margin-top: 4px;
	display: none;
}
