/**
 * AFUWP Lead Form Styles
 *
 * Popup overlay + inline form. Adapted from wc-cere-oferta.
 */

/* ============================================================
   COMMON FORM STYLES
   ============================================================ */

.afuwp-lead-form-wrap {
	max-width: 600px;
	margin: 0 auto;
}

.afuwp-lead-form-title {
	font-size: 1.4em;
	margin: 0 0 20px;
	color: #1d2327;
	font-weight: 600;
}

.afuwp-lead-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* Field widths */
.afuwp-lead-field {
	flex: 0 0 100%;
	position: relative;
}

.afuwp-lead-field-50 {
	flex: 0 0 calc(50% - 6px);
}

.afuwp-lead-field-100 {
	flex: 0 0 100%;
}

/* Labels */
.afuwp-lead-field label {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
}

.afuwp-lead-required {
	color: #dc2626;
}

/* Inputs */
.afuwp-lead-field input[type="text"],
.afuwp-lead-field input[type="email"],
.afuwp-lead-field input[type="tel"],
.afuwp-lead-field input[type="number"],
.afuwp-lead-field textarea,
.afuwp-lead-field select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
	color: #1f2937;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

.afuwp-lead-field input:focus,
.afuwp-lead-field textarea:focus,
.afuwp-lead-field select:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.afuwp-lead-field textarea {
	resize: vertical;
	min-height: 80px;
}

/* Error state */
.afuwp-lead-error input,
.afuwp-lead-error textarea,
.afuwp-lead-error select {
	border-color: #dc2626 !important;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.afuwp-lead-error label {
	color: #dc2626;
}

/* GDPR checkbox */
.afuwp-lead-gdpr {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 13px;
	color: #6b7280;
	cursor: pointer;
	margin-top: 4px;
}

.afuwp-lead-gdpr input[type="checkbox"] {
	margin-top: 2px;
	flex-shrink: 0;
}

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */

.afuwp-lead-submit-wrap {
	margin-top: 16px;
	width: 100%;
}

.afuwp-lead-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: #2563eb;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	line-height: 1.4;
}

.afuwp-lead-submit:hover {
	background: #1d4ed8;
}

.afuwp-lead-submit:active {
	transform: scale(0.98);
}

.afuwp-lead-submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.afuwp-lead-spinner {
	display: inline-flex;
	animation: afuwp-spin 0.8s linear infinite;
}

@keyframes afuwp-spin {
	to { transform: rotate(360deg); }
}

/* ============================================================
   MESSAGES
   ============================================================ */

.afuwp-lead-message {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.5;
}

.afuwp-lead-message-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.afuwp-lead-message-success {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

/* ============================================================
   SUCCESS STATE
   ============================================================ */

.afuwp-lead-success {
	text-align: center;
	padding: 40px 20px;
}

.afuwp-lead-success-icon {
	margin-bottom: 16px;
}

.afuwp-lead-success-icon svg {
	display: inline-block;
}

.afuwp-lead-success-text {
	font-size: 16px;
	color: #374151;
	line-height: 1.6;
	max-width: 400px;
	margin: 0 auto;
}

/* ============================================================
   POPUP OVERLAY
   ============================================================ */

.afuwp-lead-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(2px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

body.afuwp-lead-popup-open {
	overflow: hidden;
}

.afuwp-lead-popup {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: afuwp-popup-in 0.25s ease-out;
}

@keyframes afuwp-popup-in {
	from {
		opacity: 0;
		transform: scale(0.95) translateY(10px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.afuwp-lead-popup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	border: none;
	background: #f3f4f6;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, color 0.2s;
	z-index: 1;
}

.afuwp-lead-popup-close:hover {
	background: #e5e7eb;
	color: #1f2937;
}

.afuwp-lead-popup-header {
	padding: 24px 24px 0;
}

.afuwp-lead-popup-title {
	font-size: 1.3em;
	font-weight: 700;
	color: #1d2327;
	margin: 0;
	padding-right: 32px;
}

.afuwp-lead-popup-body {
	padding: 20px 24px 24px;
}

.afuwp-lead-popup-body .afuwp-lead-form-wrap {
	max-width: 100%;
}

/* ============================================================
   TRIGGER BUTTON (default style)
   ============================================================ */

.afuwp-lead-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: #2563eb;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
}

.afuwp-lead-trigger:hover {
	background: #1d4ed8;
}

.afuwp-lead-trigger:active {
	transform: scale(0.97);
}

/* ============================================================
   INLINE FORM SPECIFIC
   ============================================================ */

.afuwp-lead-form-inline {
	padding: 24px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
	.afuwp-lead-field-50 {
		flex: 0 0 100%;
	}

	.afuwp-lead-popup {
		max-width: 100%;
		max-height: 95vh;
		border-radius: 10px;
		margin: 10px;
	}

	.afuwp-lead-popup-header {
		padding: 20px 20px 0;
	}

	.afuwp-lead-popup-body {
		padding: 16px 20px 20px;
	}

	.afuwp-lead-overlay {
		padding: 10px;
	}

	.afuwp-lead-form-inline {
		padding: 16px;
	}
}
