/* CDU Newsletter — front end
   Colors come from Settings via --cdu-navy / --cdu-red (inline style). */

.cdu-nl {
	--cdu-navy: #0b2a5b;
	--cdu-red: #d62839;
	--cdu-ink: #1d2433;
	--cdu-radius: 12px;
	font-family: 'Afacad', system-ui, -apple-system, 'Segoe UI', sans-serif;
	box-sizing: border-box;
	position: relative;
	margin: 0 auto;
	text-align: left;
}
.cdu-nl *, .cdu-nl *::before, .cdu-nl *::after { box-sizing: inherit; }

.cdu-nl__title {
	font-family: inherit;
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.01em;
	margin: 0;
}
.cdu-nl__text { margin: 18px 0 0; font-size: 18px; line-height: 1.55; max-width: 42ch; }

/* The smile: one deliberate moment — it draws itself once when the form comes into view. */
.cdu-nl__smile { display: block; width: 132px; height: 20px; margin-top: 10px; overflow: visible; }
.cdu-nl__smile path {
	fill: none;
	stroke: var(--cdu-red);
	stroke-width: 5;
	stroke-linecap: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 0;
	transition: stroke-dashoffset 0.9s cubic-bezier(.65, 0, .35, 1) 0.15s;
}
.cdu-nl.will-draw .cdu-nl__smile path { stroke-dashoffset: 1; }
.cdu-nl.will-draw.is-visible .cdu-nl__smile path { stroke-dashoffset: 0; }

/* Fields */
.cdu-nl__form { margin: 0; }
.cdu-nl__fields { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 520px) {
	.cdu-nl__fields { grid-template-columns: 1fr 1.4fr; }
	.cdu-nl__fields--single { grid-template-columns: 1fr; }
	.cdu-nl__field--wide { grid-column: 1 / -1; }
}
.cdu-nl__field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.cdu-nl__label { font-size: 15px; font-weight: 600; line-height: 1.2; }
.cdu-nl__label em { font-style: normal; font-weight: 400; opacity: .75; }

.cdu-nl input[type="text"],
.cdu-nl input[type="email"],
.cdu-nl select {
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 16px;
	font: inherit;
	font-size: 17px;
	color: var(--cdu-ink);
	background: #fff;
	border: 2px solid #d6deea;
	border-radius: var(--cdu-radius);
	box-shadow: none;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none;
	appearance: none;
}
.cdu-nl select {
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d2433' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 18px;
}
.cdu-nl input:focus, .cdu-nl select:focus {
	border-color: var(--cdu-red);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--cdu-red) 22%, transparent);
}

.cdu-nl__consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 16px 0 0;
	font-size: 15px;
	line-height: 1.45;
	cursor: pointer;
}
.cdu-nl__consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--cdu-red); cursor: pointer; }

.cdu-nl__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Button */
.cdu-nl__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 54px;
	margin: 18px 0 0;
	padding: 0 28px;
	font: inherit;
	font-size: 18px;
	font-weight: 700;
	color: #fff;
	background: var(--cdu-red);
	border: 0;
	border-radius: var(--cdu-radius);
	cursor: pointer;
	transition: background-color .15s, transform .1s;
}
@media (min-width: 520px) { .cdu-nl__btn { width: auto; min-width: 180px; } }
.cdu-nl__btn:hover { background: color-mix(in srgb, var(--cdu-red) 86%, #000); }
.cdu-nl__btn:active { transform: translateY(1px); }
.cdu-nl__btn:focus-visible { outline: 3px solid var(--cdu-navy); outline-offset: 3px; }
.cdu-nl__btn[disabled] { cursor: progress; }
.cdu-nl__form.is-loading .cdu-nl__btn span { opacity: 0; }
.cdu-nl__form.is-loading .cdu-nl__btn::after {
	content: "";
	position: absolute;
	width: 22px; height: 22px;
	border: 3px solid rgba(255,255,255,.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: cdu-nl-spin .7s linear infinite;
}
@keyframes cdu-nl-spin { to { transform: rotate(360deg); } }

.cdu-nl__msg { margin: 12px 0 0; font-size: 15px; font-weight: 600; min-height: 0; }
.cdu-nl__msg:empty { display: none; }

/* Done state */
.cdu-nl__done { display: flex; align-items: center; gap: 16px; outline: none; }
.cdu-nl__done[hidden] { display: none; }
.cdu-nl.is-done .cdu-nl__form { display: none; }
.cdu-nl__check {
	flex: none; width: 52px; height: 52px; border-radius: 50%;
	display: grid; place-items: center; background: var(--cdu-red);
}
.cdu-nl__check svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.cdu-nl__done-text { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.4; }

/* ---------- Card (default): navy panel ---------- */
.cdu-nl--card {
	max-width: 1040px;
	padding: clamp(28px, 5vw, 56px);
	display: grid;
	gap: 32px;
	color: #fff;
	background: var(--cdu-navy);
	border-radius: 22px;
	overflow: hidden;
}
@media (min-width: 880px) {
	.cdu-nl--card { grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; }
}
.cdu-nl--card .cdu-nl__title { font-size: clamp(30px, 3.8vw, 44px); color: #fff; }
.cdu-nl--card .cdu-nl__text { color: rgba(255,255,255,.84); }
.cdu-nl--card .cdu-nl__label, .cdu-nl--card .cdu-nl__consent { color: rgba(255,255,255,.9); }
.cdu-nl--card input[type="text"], .cdu-nl--card input[type="email"], .cdu-nl--card select { border-color: transparent; }
.cdu-nl--card input:focus, .cdu-nl--card select:focus { border-color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.25); }
.cdu-nl--card .cdu-nl__btn:focus-visible { outline-color: #fff; }
.cdu-nl--card .cdu-nl__msg { color: #ffd3d8; }
.cdu-nl--card .cdu-nl__done-text { color: #fff; }

/* ---------- Inline: light, compact, for sidebars, blog posts and footers ---------- */
.cdu-nl--inline {
	max-width: 760px;
	padding: clamp(22px, 4vw, 34px);
	color: var(--cdu-ink);
	background: #fff;
	border: 1px solid #dfe5ef;
	border-top: 5px solid var(--cdu-navy);
	border-radius: 16px;
}
.cdu-nl--inline .cdu-nl__intro { margin-bottom: 22px; }
.cdu-nl--inline .cdu-nl__title { font-size: clamp(24px, 2.6vw, 30px); color: var(--cdu-navy); }
.cdu-nl--inline .cdu-nl__smile { width: 104px; }
.cdu-nl--inline .cdu-nl__text { font-size: 17px; margin-top: 12px; color: #445066; }
.cdu-nl--inline .cdu-nl__label { color: var(--cdu-navy); }
.cdu-nl--inline .cdu-nl__consent { color: #445066; }
.cdu-nl--inline input[type="text"], .cdu-nl--inline input[type="email"], .cdu-nl--inline select { background-color: #f6f8fc; }
.cdu-nl--inline .cdu-nl__msg { color: var(--cdu-red); }
.cdu-nl--inline .cdu-nl__done-text { color: var(--cdu-navy); }

/* ---------- Popup ---------- */
.cdu-nl-modal { position: fixed; inset: 0; z-index: 999999; display: grid; place-items: center; padding: 16px; }
.cdu-nl-modal[hidden] { display: none; }
.cdu-nl-modal__backdrop {
	position: absolute; inset: 0;
	background: rgba(6, 18, 42, .62);
	opacity: 0; transition: opacity .25s ease;
}
.cdu-nl-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 880px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	border-radius: 22px;
	box-shadow: 0 40px 90px -30px rgba(3, 12, 30, .6);
	opacity: 0;
	transform: translateY(16px) scale(.98);
	transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.cdu-nl-modal.is-open .cdu-nl-modal__backdrop { opacity: 1; }
.cdu-nl-modal.is-open .cdu-nl-modal__dialog { opacity: 1; transform: none; }

/* Popup layout: navy face on the left, white tear-off stub on the right,
   joined by a perforated seam — like a clinic appointment card. */
.cdu-nl-modal .cdu-nl--card {
	max-width: none;
	padding: 0;
	gap: 0;
	grid-template-columns: 1fr 1.08fr;
	align-items: stretch;
	background: #fff;
	color: var(--cdu-ink);
	border-radius: 22px;
}
.cdu-nl-modal .cdu-nl__intro {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 56px 44px;
	background: var(--cdu-navy);
	color: #fff;
}
.cdu-nl-modal .cdu-nl--card .cdu-nl__title {
	font-size: clamp(30px, 3.4vw, 40px);
	line-height: 1.05;
	color: #fff;
	text-wrap: balance;
}
.cdu-nl-modal .cdu-nl__smile { width: 120px; margin-top: 14px; }
.cdu-nl-modal .cdu-nl__text { margin-top: 20px; font-size: 17px; color: rgba(255,255,255,.82); }

.cdu-nl-modal .cdu-nl__form,
.cdu-nl-modal .cdu-nl__done {
	grid-column: 2;
	grid-row: 1;
	align-self: center;
	padding: 52px 44px 44px;
	border-left: 2px dashed #d3dbe8;
}
.cdu-nl-modal .cdu-nl__done { height: 100%; }

.cdu-nl-modal .cdu-nl__fields { grid-template-columns: 1fr; gap: 16px; }
.cdu-nl-modal .cdu-nl__label { color: var(--cdu-navy); }
.cdu-nl-modal .cdu-nl__label em { color: #5d6880; opacity: 1; }
.cdu-nl-modal .cdu-nl--card input[type="text"],
.cdu-nl-modal .cdu-nl--card input[type="email"],
.cdu-nl-modal .cdu-nl--card select {
	height: 50px;
	background-color: #f4f6fa;
	border: 2px solid #e1e7f0;
}
.cdu-nl-modal .cdu-nl--card input:focus,
.cdu-nl-modal .cdu-nl--card select:focus {
	background-color: #fff;
	border-color: var(--cdu-navy);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--cdu-navy) 14%, transparent);
}
.cdu-nl-modal .cdu-nl--card .cdu-nl__consent { color: #5d6880; font-size: 14px; }
.cdu-nl-modal .cdu-nl__consent input { accent-color: var(--cdu-navy); }
.cdu-nl-modal .cdu-nl__btn { width: 100%; height: 56px; margin-top: 22px; border-radius: 999px; }
.cdu-nl-modal .cdu-nl--card .cdu-nl__btn:focus-visible { outline-color: var(--cdu-navy); }
.cdu-nl-modal .cdu-nl--card .cdu-nl__msg { color: var(--cdu-red); }
.cdu-nl-modal .cdu-nl--card .cdu-nl__done-text { color: var(--cdu-navy); }

.cdu-nl-modal__close {
	position: absolute; top: 14px; right: 14px; z-index: 2;
	width: 40px; height: 40px; padding: 0;
	display: grid; place-items: center;
	background: #eef1f6; border: 0; border-radius: 50%; cursor: pointer;
	transition: background-color .15s;
}
.cdu-nl-modal__close:hover { background: #e1e6ef; }
.cdu-nl-modal__close:focus-visible { outline: 3px solid var(--cdu-navy); outline-offset: 2px; }
.cdu-nl-modal__close svg { width: 18px; height: 18px; fill: none; stroke: var(--cdu-navy, #0b2a5b); stroke-width: 2.4; stroke-linecap: round; }

@media (max-width: 760px) {
	.cdu-nl-modal { padding: 10px; align-items: end; }
	.cdu-nl-modal .cdu-nl--card { grid-template-columns: 1fr; }
	.cdu-nl-modal .cdu-nl__intro { padding: 34px 26px 28px; }
	.cdu-nl-modal .cdu-nl--card .cdu-nl__title { font-size: 28px; padding-right: 40px; }
	.cdu-nl-modal .cdu-nl__text { font-size: 16px; margin-top: 14px; }
	.cdu-nl-modal .cdu-nl__form,
	.cdu-nl-modal .cdu-nl__done {
		grid-column: 1; grid-row: 2;
		padding: 26px 24px 24px;
		border-left: 0; border-top: 2px dashed #d3dbe8;
	}
	.cdu-nl-modal__close { background: rgba(255,255,255,.14); }
	.cdu-nl-modal__close:hover { background: rgba(255,255,255,.24); }
	.cdu-nl-modal__close svg { stroke: #fff; }
}

@media (prefers-reduced-motion: reduce) {
	.cdu-nl__smile path { transition: none; stroke-dashoffset: 0; }
	.cdu-nl-modal__backdrop, .cdu-nl-modal__dialog { transition: none; }
	.cdu-nl-modal__dialog { transform: none; }
	.cdu-nl__form.is-loading .cdu-nl__btn::after { animation-duration: 2s; }
}

/* Small print under the button (replaces the consent checkbox) */
.cdu-nl__note { margin: 12px 0 0; font-size: 13px; line-height: 1.45; opacity: .75; }
.cdu-nl--card .cdu-nl__note { color: rgba(255,255,255,.85); }
.cdu-nl--inline .cdu-nl__note { color: #5d6880; }
.cdu-nl-modal .cdu-nl--card .cdu-nl__note { color: #5d6880; opacity: 1; }
