/**
 * Kallone Email Capture Popup — front-end styles.
 * Self-contained, first-party, no external requests.
 */

.kep {
	--kep-ink: #1a1a1a;
	--kep-muted: #57514a;
	--kep-faint: #8a8378;
	--kep-line: #e6e1da;
	--kep-bg: #ffffff;
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.kep.is-open {
	display: flex;
}

.kep__overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.55);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.kep.is-visible .kep__overlay {
	opacity: 1;
}

.kep__dialog {
	position: relative;
	width: 100%;
	max-width: 430px;
	background: var(--kep-bg);
	color: var(--kep-ink);
	border-radius: 18px;
	padding: 42px 38px 34px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
	transform: translateY(14px) scale(0.985);
	opacity: 0;
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
	box-sizing: border-box;
	overflow: hidden;
}

.kep.is-visible .kep__dialog {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.kep__dialog::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: var(--kep-ink);
	opacity: 0.9;
}

.kep__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: var(--kep-faint);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease, color 0.15s ease;
}

.kep__close:hover,
.kep__close:focus-visible {
	background: #f2efe9;
	color: var(--kep-ink);
	outline: none;
}

.kep__eyebrow {
	display: block;
	font-size: 11px;
	letter-spacing: 0.28em;
	font-weight: 700;
	color: var(--kep-faint);
	margin-bottom: 14px;
}

.kep__title {
	margin: 0 0 10px;
	font-size: 25px;
	line-height: 1.2;
	font-weight: 650;
	letter-spacing: -0.01em;
}

.kep__sub {
	margin: 0 0 22px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--kep-muted);
}

.kep__form {
	display: block;
	margin: 0;
}

.kep__hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.kep__input {
	width: 100%;
	box-sizing: border-box;
	padding: 14px 16px;
	font-size: 16px;
	color: var(--kep-ink);
	background: #fbfaf8;
	border: 1px solid var(--kep-line);
	border-radius: 11px;
	outline: none;
	transition: border-color 0.15s ease, background 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.kep__input::placeholder {
	color: #b3ada3;
}

.kep__input:focus {
	border-color: var(--kep-ink);
	background: #fff;
}

.kep__consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 14px 0 18px;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--kep-muted);
	cursor: pointer;
}

.kep__checkbox {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	border: 1.5px solid #c8c1b7;
	border-radius: 5px;
	background: #fff;
	cursor: pointer;
	position: relative;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.kep__checkbox:checked {
	background: var(--kep-ink);
	border-color: var(--kep-ink);
}

.kep__checkbox:checked::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.kep__checkbox:focus-visible {
	outline: 2px solid var(--kep-ink);
	outline-offset: 2px;
}

.kep__link {
	color: var(--kep-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.kep__submit {
	display: block;
	width: 100%;
	padding: 15px 20px;
	font-size: 15px;
	font-weight: 650;
	color: #fff;
	background: var(--kep-ink);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: transform 0.12s ease, opacity 0.15s ease;
}

.kep__submit:hover {
	opacity: 0.92;
}

.kep__submit:active {
	transform: scale(0.99);
}

.kep__submit[disabled] {
	opacity: 0.55;
	cursor: default;
}

.kep__note {
	margin: 12px 0 0;
	font-size: 11.5px;
	color: var(--kep-faint);
	text-align: center;
}

.kep__msg {
	margin: 12px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: #b32d2e;
	text-align: center;
}

.kep__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.kep.is-submitting .kep__submit {
	opacity: 0.7;
}

/* Success state */
.kep__panel[hidden] {
	display: none;
}

body.kep-lock {
	overflow: hidden;
}

@media (max-width: 520px) {
	.kep {
		padding: 14px;
		align-items: flex-end;
	}
	.kep__dialog {
		max-width: 100%;
		border-radius: 16px;
		padding: 34px 24px 26px;
	}
	.kep__title {
		font-size: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kep__overlay,
	.kep__dialog {
		transition: none;
	}
	.kep__dialog {
		transform: none;
	}
}
