/**
 * Popup Lead Form — frontend styles
 * Scoped under .plf-overlay / .plf- prefix to avoid theme conflicts.
 */

.plf-overlay {
	position: fixed;
	inset: 0;
	background: var(--plf-overlay, rgba(15, 23, 42, 0.55));
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.25s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.plf-overlay.is-open {
	display: flex;
	opacity: 1;
}

.plf-modal {
	position: relative;
	width: 100%;
	max-width: 520px;
	max-height: calc(100vh - 40px);
	background: var(--plf-bg, #fff);
	color: var(--plf-text, #111827);
	border-radius: 14px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.03);
	padding: 32px;
	overflow-y: auto;
	transform: translateY(12px) scale(0.98);
	opacity: 0;
	transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease;
	box-sizing: border-box;
}

.plf-overlay.is-open .plf-modal {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.plf-modal * { box-sizing: border-box; }

.plf-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	color: var(--plf-muted, #6b7280);
	cursor: pointer;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, color 0.15s ease;
	padding: 0;
}
.plf-close:hover,
.plf-close:focus-visible { background: rgba(0, 0, 0, 0.05); color: var(--plf-text); outline: none; }

/* Header */
.plf-header { text-align: center; margin-bottom: 20px; padding-right: 30px; }
.plf-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 8px;
	color: var(--plf-text);
	line-height: 1.3;
}
.plf-subtitle {
	font-size: 14px;
	color: var(--plf-muted);
	margin: 0;
	line-height: 1.5;
}

/* Progress indicator */
.plf-progress {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 24px;
}
.plf-progress-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}
.plf-progress-dot {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--plf-bg);
	color: var(--plf-muted);
	border: 2px solid var(--plf-border);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 600;
	transition: all 0.2s ease;
}
.plf-progress-step.is-active .plf-progress-dot {
	background: var(--plf-primary);
	color: #fff;
	border-color: var(--plf-primary);
	box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}
.plf-progress-step.is-done .plf-progress-dot {
	background: var(--plf-primary);
	color: #fff;
	border-color: var(--plf-primary);
}
.plf-progress-label {
	font-size: 11px;
	color: var(--plf-muted);
	font-weight: 500;
	text-align: center;
	max-width: 80px;
	line-height: 1.2;
}
.plf-progress-step.is-active .plf-progress-label { color: var(--plf-text); }
.plf-progress-line {
	flex: 1;
	height: 2px;
	background: var(--plf-border);
	margin-bottom: 18px;
	transition: background 0.2s ease;
	min-width: 12px;
}
.plf-progress-line.is-done { background: var(--plf-primary); }

/* Steps */
.plf-step { display: none; animation: plf-fade 0.3s ease; }
.plf-step.is-active { display: block; }

@keyframes plf-fade {
	from { opacity: 0; transform: translateX(10px); }
	to   { opacity: 1; transform: translateX(0); }
}

.plf-step-desc { margin: 0 0 18px; color: var(--plf-muted); font-size: 14px; line-height: 1.5; }

/* Fields */
.plf-field { margin-bottom: 16px; }
.plf-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--plf-text);
	margin-bottom: 6px;
}
.plf-req { color: var(--plf-error); margin-left: 2px; }

.plf-input,
.plf-textarea,
.plf-select {
	width: 100%;
	padding: 11px 14px;
	font-size: 15px;
	font-family: inherit;
	color: var(--plf-text);
	background: var(--plf-bg);
	border: 1.5px solid var(--plf-border);
	border-radius: 8px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	line-height: 1.4;
	box-sizing: border-box;
}
.plf-textarea { resize: vertical; min-height: 90px; }

.plf-input:focus,
.plf-textarea:focus,
.plf-select:focus {
	outline: none;
	border-color: var(--plf-primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.plf-select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M5 6 0 0h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}

.plf-field.has-error .plf-input,
.plf-field.has-error .plf-textarea,
.plf-field.has-error .plf-select {
	border-color: var(--plf-error);
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.plf-field-error {
	display: block;
	color: var(--plf-error);
	font-size: 12px;
	margin-top: 6px;
	min-height: 0;
	line-height: 1.3;
}
.plf-field.has-error .plf-field-error { min-height: 16px; }

/* Radio group */
.plf-radio-group { display: flex; flex-direction: column; gap: 8px; }
.plf-radio {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border: 1.5px solid var(--plf-border);
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	color: var(--plf-text);
	transition: border-color 0.15s ease, background 0.15s ease;
}
.plf-radio:hover { border-color: var(--plf-primary); }
.plf-radio input[type="radio"] { accent-color: var(--plf-primary); margin: 0; }
.plf-radio input[type="radio"]:checked ~ span { font-weight: 500; }

/* Checkbox */
.plf-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	color: var(--plf-text);
	cursor: pointer;
	line-height: 1.5;
}
.plf-checkbox input[type="checkbox"] {
	accent-color: var(--plf-primary);
	margin-top: 3px;
	flex-shrink: 0;
}

/* Form error banner */
.plf-form-error {
	background: rgba(220, 38, 38, 0.08);
	color: var(--plf-error);
	border: 1px solid rgba(220, 38, 38, 0.25);
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 13px;
	margin-bottom: 14px;
	display: none;
	line-height: 1.4;
}
.plf-form-error.is-visible { display: block; }

/* Actions */
.plf-actions {
	display: flex;
	gap: 10px;
	margin-top: 24px;
	justify-content: flex-end;
	align-items: center;
}

.plf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 22px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
	text-decoration: none;
	line-height: 1;
}
.plf-btn:focus-visible {
	outline: 3px solid rgba(79, 70, 229, 0.4);
	outline-offset: 2px;
}
.plf-btn:active { transform: translateY(1px); }

.plf-btn-primary {
	background: var(--plf-primary);
	color: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(79, 70, 229, 0.2);
}
.plf-btn-primary:hover { background: var(--plf-primary-hover); }
.plf-btn-primary[disabled] { opacity: 0.7; cursor: not-allowed; }

.plf-btn-secondary {
	background: transparent;
	color: var(--plf-text);
	border: 1.5px solid var(--plf-border);
}
.plf-btn-secondary:hover { background: rgba(0, 0, 0, 0.03); border-color: var(--plf-muted); }

.plf-back { margin-right: auto; }

/* Spinner */
.plf-spinner {
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: plf-spin 0.7s linear infinite;
	display: inline-block;
}
@keyframes plf-spin { to { transform: rotate(360deg); } }

/* Success screen */
.plf-success { text-align: center; padding: 16px 0; }
.plf-success-icon {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: rgba(79, 70, 229, 0.1);
	color: var(--plf-primary);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 18px;
	animation: plf-pop 0.4s cubic-bezier(0.5, 1.5, 0.5, 1);
}
@keyframes plf-pop {
	0%   { transform: scale(0.3); opacity: 0; }
	100% { transform: scale(1);   opacity: 1; }
}
.plf-success-title { font-size: 20px; margin: 0 0 8px; color: var(--plf-text); font-weight: 700; }
.plf-success-msg   { color: var(--plf-muted); font-size: 14px; margin: 0 0 22px; line-height: 1.5; }
.plf-close-success { margin: 0 auto; }

/* Body lock when open */
body.plf-no-scroll { overflow: hidden; }

/* Mobile */
@media (max-width: 520px) {
	.plf-modal { padding: 24px 20px; max-height: calc(100vh - 20px); border-radius: 10px; }
	.plf-title { font-size: 19px; }
	.plf-progress-label { display: none; }
	.plf-progress-line { margin-bottom: 0; }
	.plf-btn { padding: 12px 18px; font-size: 14px; }
	.plf-actions { flex-wrap: wrap; }
	.plf-back { margin-right: auto; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.plf-overlay,
	.plf-modal,
	.plf-step,
	.plf-success-icon {
		transition: none !important;
		animation: none !important;
	}
}
