/**
 * ElWin PopUp — Public styles.
 *
 * @package ElWin_PopUp
 */

/* ── Overlay ── */
.elwin-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	background: rgba(0, 0, 0, 0.6);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.elwin-popup-overlay.elwin-popup-active {
	display: flex;
}

/* ── Container ── */
.elwin-popup-container {
	position: relative;
	background: #fff;
	border-radius: 8px;
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
	animation: elwinPopupIn 0.25s ease-out;
}

@keyframes elwinPopupIn {
	from {
		opacity: 0;
		transform: translateY(-20px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* ── Close button ── */
.elwin-popup-overlay .elwin-popup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	left: auto;
	width: 32px;
	height: 32px;
	border: none;
	background: none;
	font-size: 24px;
	line-height: 32px;
	text-align: center;
	cursor: pointer;
	color: #666;
	border-radius: 50%;
	transition: background 0.15s, color 0.15s;
	padding: 0;
	margin: 0;
	z-index: 1;
}

.elwin-popup-overlay .elwin-popup-close:hover {
	background: #f0f0f0;
	color: #333;
}

/* ── Header ── */
.elwin-popup-header {
	padding: 24px 24px 0;
}

.elwin-popup-title {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	color: #1a1a1a;
}

/* ── Body ── */
.elwin-popup-body {
	padding: 20px 24px 24px;
}

/* ── Form fields ── */
.elwin-form-field {
	margin-bottom: 16px;
}

.elwin-form-label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 500;
	color: #333;
}

.elwin-required {
	color: #d63638;
}

.elwin-form-field input[type="text"],
.elwin-form-field input[type="tel"],
.elwin-form-field input[type="email"],
.elwin-form-field textarea,
.elwin-form-field select {
	display: block;
	width: 100%;
	padding: 10px 12px;
	font-size: 15px;
	line-height: 1.4;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	background: #fff;
	color: #1a1a1a;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
}

/* Phone field: stable digit widths */
.elwin-form-field input[type="tel"] {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}

.elwin-form-field input:focus,
.elwin-form-field textarea:focus,
.elwin-form-field select:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.elwin-form-field textarea {
	resize: vertical;
	min-height: 80px;
}

/* Checkbox */
.elwin-form-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 14px;
	color: #333;
	cursor: pointer;
}

.elwin-form-checkbox-label input[type="checkbox"] {
	margin-top: 2px;
	flex-shrink: 0;
}

/* Field error */
.elwin-field-error {
	color: #d63638;
	font-size: 13px;
	margin-top: 4px;
}

.elwin-form-field.elwin-has-error input,
.elwin-form-field.elwin-has-error textarea,
.elwin-form-field.elwin-has-error select {
	border-color: #d63638;
}

/* ── Submit button ── */
.elwin-form-footer {
	margin-top: 20px;
}

.elwin-form-submit {
	display: inline-block;
	width: 100%;
	padding: 12px 24px;
	font-size: 16px;
	font-weight: 600;
	color: #fff;
	background: #2271b1;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s;
	text-align: center;
}

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

.elwin-form-submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

/* ── Messages ── */
.elwin-form-message {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
}

.elwin-form-message--success {
	background: #edfcf2;
	border: 1px solid #68de7c;
	color: #1e7e34;
}

.elwin-form-message--error {
	background: #fcf0f1;
	border: 1px solid #d63638;
	color: #8a1215;
}

/* ── HTML block content ── */
.elwin-popup-html-content iframe,
.elwin-popup-html-content video,
.elwin-popup-html-content embed {
	max-width: 100%;
	height: auto;
}

.elwin-popup-html-content iframe {
	aspect-ratio: 16 / 9;
	width: 100%;
}

/* ── Honeypot (anti-spam) ── */
.elwin-hp-wrap {
	position: absolute;
	left: -9999px;
	height: 0;
	width: 0;
	overflow: hidden;
	opacity: 0;
}

/* ── Body scroll lock ── */
body.elwin-popup-body-locked {
	overflow: hidden;
}

/* ── Mobile adjustments ── */
@media (max-width: 480px) {
	.elwin-popup-overlay {
		padding: 10px;
	}

	.elwin-popup-container {
		max-height: 95vh;
		border-radius: 6px;
	}

	.elwin-popup-header {
		padding: 20px 16px 0;
	}

	.elwin-popup-body {
		padding: 16px;
	}

	.elwin-popup-title {
		font-size: 18px;
		padding-right: 28px;
	}
}
