/* Modal Lead Capture - Frontend Styles */

/* ── Overlay ── */
.mlc-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	z-index: 999999;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.mlc-overlay.mlc-open {
	display: flex;
	animation: mlcFadeIn 0.3s ease;
}

@keyframes mlcFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ── Modal box ── */
.mlc-modal {
	background: #ffffff;
	border-radius: 18px;
	max-width: 460px;
	width: 100%;
	position: relative;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
	overflow: hidden;
	max-height: 92vh;
	overflow-y: auto;
	animation: mlcSlideUp 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Wider when image is present (side-by-side) */
.mlc-modal--has-image {
	max-width: 700px;
}

/* ── Inner flex wrapper ── */
.mlc-modal-inner {
	display: flex;
	align-items: stretch;
	min-height: 420px;
}

@keyframes mlcSlideUp {
	from { transform: translateY(28px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

/* ── Close button ── */
.mlc-close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 32px;
	height: 32px;
	background: rgba(0, 0, 0, 0.12);
	border: none;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #555;
	transition: background 0.2s;
	z-index: 10;
	padding: 0;
}
.mlc-close:hover  { background: rgba(0, 0, 0, 0.22); }
.mlc-close:focus  { outline: 2px solid #4f46e5; outline-offset: 2px; }

/* ── Image (right column, full height) ── */
.mlc-modal-image {
	width: 240px;
	flex-shrink: 0;
	position: relative;
	order: 2;
}

.mlc-modal-image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Show desktop image, hide mobile one by default */
.mlc-modal-image .mlc-img-mobile { display: none; }

/* ── Body (left column) ── */
.mlc-modal-body {
	flex: 1;
	min-width: 0;
	padding: 28px 30px 30px;
	order: 1;
}

.mlc-modal-body h2 {
	margin: 0 0 10px;
	font-size: 21px;
	font-weight: 700;
	color: #111827;
	line-height: 1.3;
}

.mlc-description {
	color: #6b7280;
	font-size: 14px;
	line-height: 1.65;
	margin: 0 0 22px;
}

/* ── Form fields ── */
.mlc-field {
	margin-bottom: 12px;
}

.mlc-field input {
	width: 100%;
	padding: 11px 15px;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	font-size: 14px;
	color: #111;
	box-sizing: border-box;
	transition: border-color 0.2s, box-shadow 0.2s;
	outline: none;
	background: #fff;
}

.mlc-field input::placeholder { color: #9ca3af; }

.mlc-field input:focus {
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

.mlc-field input.mlc-invalid {
	border-color: #ef4444;
}

/* ── Submit button ── */
.mlc-btn-submit {
	width: 100%;
	padding: 13px 20px;
	background: linear-gradient(135deg, #7c5943 0%, #5c3e2d 100%);
	color: #ffffff;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
	box-shadow: 0 4px 16px rgba(124, 89, 67, 0.38);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.mlc-btn-submit:hover  { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124, 89, 67, 0.5); }
.mlc-btn-submit:active { transform: translateY(0); }
.mlc-btn-submit:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

/* Loading spinner */
.mlc-btn-loading {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: mlcSpin 0.7s linear infinite;
}
@keyframes mlcSpin {
	to { transform: rotate(360deg); }
}

/* ── Privacy note ── */
.mlc-privacy {
	text-align: center;
	font-size: 11px;
	color: #9ca3af;
	margin: 10px 0 0;
}

/* ── Error message ── */
.mlc-msg {
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	margin-top: 12px;
	text-align: center;
}
.mlc-msg--error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.mlc-msg--success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* ── Success state ── */
.mlc-success {
	text-align: center;
	padding: 10px 0 8px;
}

.mlc-success-icon {
	font-size: 56px;
	line-height: 1;
	margin-bottom: 14px;
}

.mlc-success h3 {
	margin: 0 0 8px;
	font-size: 20px;
	color: #111827;
}

.mlc-success p {
	color: #6b7280;
	font-size: 14px;
	margin: 0 0 18px;
	line-height: 1.6;
}

.mlc-coupon-box {
	background: #f0fdf4;
	border: 2px dashed #4ade80;
	border-radius: 12px;
	padding: 16px 20px;
	margin: 0 0 20px;
}

.mlc-coupon-label {
	display: block;
	font-size: 12px;
	color: #166534;
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.mlc-coupon-code {
	display: block;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: 3px;
	color: #15803d;
}

.mlc-btn-close-success {
	background: #7c5943;
	color: #fff;
	border: none;
	padding: 11px 32px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s;
}
.mlc-btn-close-success:hover { opacity: 0.88; }

/* ── Responsive ── */
@media (max-width: 600px) {
	.mlc-modal--has-image .mlc-modal-inner {
		flex-direction: column;
	}

	.mlc-modal-image {
		width: 100%;
		height: 180px;
		position: relative;
		order: 0;
	}

	.mlc-modal-image img {
		position: absolute;
	}

	/* Swap to the mobile image on small screens */
	.mlc-modal-image .mlc-img-desktop { display: none; }
	.mlc-modal-image .mlc-img-mobile  { display: block; }

	.mlc-modal-body      { padding: 20px 18px 22px; order: 1; }
	.mlc-modal-body h2   { font-size: 18px; }
	.mlc-coupon-code     { font-size: 22px; }
	.mlc-modal--has-image { max-width: 460px; }
}
