/* Ebook Lead → Lark Base — mọi class đều có tiền tố ell- để không đụng theme */
.ell-wrap {
	--ell-primary: #0f766e;
	--ell-text: #1f2937;
	--ell-muted: #6b7280;
	--ell-line: #e5e7eb;
	--ell-bg: #ffffff;
	--ell-soft: #f6f7f9;
	--ell-radius: 14px;
	color: var(--ell-text);
	font-size: 16px;
	line-height: 1.55;
	box-sizing: border-box;
}
.ell-wrap *, .ell-wrap *::before, .ell-wrap *::after { box-sizing: border-box; }

/* Hero */
.ell-hero { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.ell-hero-title { font-size: clamp(26px, 4vw, 40px); line-height: 1.2; margin: 0 0 12px; font-weight: 800; }
.ell-hero-sub { color: var(--ell-muted); font-size: 18px; margin: 0; }

/* Lưới ebook */
.ell-grid { display: grid; gap: 24px; grid-template-columns: repeat(var(--ell-cols, 3), minmax(0, 1fr)); }
.ell-cols-1 { --ell-cols: 1; max-width: 420px; margin: 0 auto; }
.ell-cols-2 { --ell-cols: 2; }
.ell-cols-3 { --ell-cols: 3; }
.ell-cols-4 { --ell-cols: 4; }
@media (max-width: 900px) { .ell-cols-3, .ell-cols-4 { --ell-cols: 2; } }
@media (max-width: 560px) { .ell-grid { --ell-cols: 1 !important; } }

.ell-card {
	background: var(--ell-bg);
	border: 1px solid var(--ell-line);
	border-radius: var(--ell-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .2s, transform .2s;
}
.ell-card:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, .08); transform: translateY(-2px); }

.ell-cover {
	all: unset;
	cursor: pointer;
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	background: var(--ell-soft);
	overflow: hidden;
}
.ell-cover .ell-cover-img, .ell-modal-cover img, .ell-single-cover img {
	width: 100%; height: 100%; object-fit: cover; display: block;
}
.ell-cover-ph {
	width: 100%; height: 100%;
	display: flex; align-items: center; justify-content: center; text-align: center;
	padding: 24px;
	background: linear-gradient(150deg, var(--ell-primary), #111827);
	color: #fff; font-weight: 800; font-size: 22px; line-height: 1.25;
}
.ell-badge {
	position: absolute; top: 12px; left: 12px;
	background: rgba(17, 24, 39, .8); color: #fff;
	font-size: 12px; font-weight: 700; letter-spacing: .04em;
	padding: 4px 10px; border-radius: 999px;
}
.ell-card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ell-card-title { font-size: 19px; line-height: 1.3; margin: 0; font-weight: 700; }
.ell-card-sub { color: var(--ell-muted); margin: 0; font-size: 15px; }
.ell-card-body .ell-btn { margin-top: auto; }

/* Nút */
.ell-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 46px; padding: 0 20px;
	background: var(--ell-primary); color: #fff !important;
	border: 0; border-radius: 10px;
	font: inherit; font-weight: 700; text-decoration: none !important;
	cursor: pointer; transition: filter .15s;
}
.ell-btn:hover { filter: brightness(1.08); }
.ell-btn:disabled { opacity: .6; cursor: wait; }
.ell-btn-block { width: 100%; }

/* Danh sách lợi ích */
.ell-bullets { list-style: none; margin: 14px 0; padding: 0; }
.ell-bullets li { position: relative; padding-left: 28px; margin: 8px 0; }
.ell-bullets li::before {
	content: "✓"; position: absolute; left: 0; top: 1px;
	width: 20px; height: 20px; border-radius: 50%;
	background: var(--ell-primary); color: #fff;
	font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.ell-desc { color: var(--ell-muted); font-size: 15px; }
.ell-desc p { margin: 0 0 10px; }

/* Modal */
html.ell-lock { overflow: hidden; }
.ell-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ell-modal[hidden] { display: none; }
.ell-modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .6); }
.ell-modal-box {
	position: relative; width: 100%; max-width: 920px; max-height: calc(100vh - 32px);
	overflow: auto; background: var(--ell-bg); border-radius: 18px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
}
.ell-modal-x {
	all: unset; position: absolute; top: 10px; right: 14px; z-index: 2;
	width: 36px; height: 36px; text-align: center; line-height: 36px;
	font-size: 28px; color: var(--ell-muted); cursor: pointer; border-radius: 50%;
}
.ell-modal-x:hover { background: var(--ell-soft); }
.ell-modal-grid { display: grid; grid-template-columns: 1fr 1fr; }
.ell-modal-info { padding: 32px; background: var(--ell-soft); }
.ell-modal-cover { width: 150px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; margin-bottom: 18px; box-shadow: 0 10px 24px rgba(0, 0, 0, .15); }
.ell-modal-cover .ell-cover-ph { font-size: 14px; padding: 12px; }
.ell-modal-title { font-size: 22px; line-height: 1.3; margin: 0 0 6px; font-weight: 800; }
.ell-modal-form { padding: 32px; }
@media (max-width: 760px) {
	.ell-modal { align-items: flex-end; padding: 0; }
	.ell-modal-box { max-height: 92vh; border-radius: 18px 18px 0 0; }
	.ell-modal-grid { grid-template-columns: 1fr; }
	.ell-modal-info { padding: 24px 20px 8px; }
	.ell-modal-info .ell-desc { display: none; }
	.ell-modal-cover { width: 96px; float: left; margin: 0 16px 8px 0; }
	.ell-modal-info::after { content: ""; display: block; clear: both; }
	.ell-modal-form { padding: 20px; }
}

/* Form */
.ell-form-title { font-size: 20px; margin: 0 0 4px; font-weight: 800; }
.ell-form-note { color: var(--ell-muted); margin: 0 0 18px; font-size: 15px; }
.ell-field { margin-bottom: 14px; }
.ell-field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.ell-field input {
	width: 100%; height: 46px; padding: 0 14px;
	border: 1px solid #d1d5db; border-radius: 10px;
	font: inherit; font-size: 16px; color: var(--ell-text); background: #fff;
}
.ell-field input:focus { outline: none; border-color: var(--ell-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ell-primary) 20%, transparent); }
.ell-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.ell-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ell-muted); margin: 4px 0 14px; cursor: pointer; }
.ell-consent input { margin-top: 3px; accent-color: var(--ell-primary); }
.ell-error { color: #b91c1c; font-size: 14px; min-height: 0; margin-bottom: 10px; }
.ell-error:empty { display: none; }
.ell-privacy { text-align: center; color: var(--ell-muted); font-size: 12px; margin: 10px 0 0; }

.ell-success { text-align: center; padding: 12px 0; }
.ell-check {
	width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%;
	background: var(--ell-primary); color: #fff; font-size: 30px; line-height: 60px; font-weight: 700;
}
.ell-success-msg { font-size: 18px; font-weight: 700; margin: 0 0 16px; }
.ell-actions { display: flex; flex-direction: column; gap: 10px; }
.ell-actions [hidden] { display: none !important; }
.ell-btn.ell-btn-ghost { background: transparent; color: var(--ell-primary) !important; box-shadow: inset 0 0 0 2px var(--ell-primary); }

/* [ebook_form] một ebook */
.ell-single {
	display: grid; grid-template-columns: 1fr 1fr; gap: 0;
	border: 1px solid var(--ell-line); border-radius: 18px; overflow: hidden; background: var(--ell-bg);
}
.ell-single-info { padding: 32px; background: var(--ell-soft); }
.ell-single-cover { width: 180px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; margin-bottom: 18px; box-shadow: 0 10px 24px rgba(0, 0, 0, .15); }
.ell-single.ell-only-form { grid-template-columns: 1fr; max-width: 460px; }
@media (max-width: 760px) {
	.ell-single { grid-template-columns: 1fr; }
	.ell-single-info, .ell-single-form { padding: 22px 18px; }
}
.ell-empty { text-align: center; color: var(--ell-muted); }

/* Ebook xem tự do */
.ell-modal-form[hidden] { display: none !important; }
.ell-badge.ell-badge-free { left: auto; right: 12px; background: var(--ell-primary); }
.ell-free .ell-actions { margin-top: 6px; }
