/**
 * Newsletter subscription modal — Figma 841:17809.
 * Ideal size 1120×740; scales with viewport and scrolls the form when short.
 */

.atee-newsletter-modal {
	--atee-nl-pad-y: clamp(16px, 5vh, 80px);
	--atee-nl-pad-x: clamp(16px, 8vw, 160px);
	--atee-nl-dialog-h: min(740px, calc(100dvh - (2 * var(--atee-nl-pad-y))));
	--atee-nl-body-h: min(596px, calc(var(--atee-nl-dialog-h) - 64px - 32px - 48px));

	position: fixed;
	inset: 0;
	z-index: 100002;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--atee-nl-pad-y) var(--atee-nl-pad-x);
	font-family: var(--atee-font-family, 'Montserrat', sans-serif);
	box-sizing: border-box;
}

.atee-newsletter-modal *,
.atee-newsletter-modal *::before,
.atee-newsletter-modal *::after {
	box-sizing: border-box;
}

.atee-newsletter-modal[hidden] {
	display: none;
}

.atee-newsletter-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 19, 53, 0.9);
}

.atee-newsletter-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 1120px;
	height: var(--atee-nl-dialog-h);
	max-height: var(--atee-nl-dialog-h);
	background: #fff;
	border-radius: 24px;
	padding: 32px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
}

.atee-newsletter-modal__inner {
	display: flex;
	flex-direction: column;
	gap: 32px;
	width: 100%;
	height: 100%;
	min-height: 0;
	margin: 0;
}

.atee-newsletter-modal__body {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 32px;
	width: 100%;
	flex: 1 1 auto;
	height: var(--atee-nl-body-h);
	max-height: var(--atee-nl-body-h);
	min-height: 0;
}

.atee-newsletter-modal__media {
	flex: 0 0 440px;
	width: 440px;
	height: 100%;
	min-height: 0;
	position: relative;
	overflow: hidden;
	border-radius: 8px 0 0 8px;
	background: #edf5ff;
}

.atee-newsletter-modal__image {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 8px 0 0 8px;
}

.atee-newsletter-modal__content {
	flex: 1 1 auto;
	width: 100%;
	max-width: 584px;
	min-width: 0;
	min-height: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	gap: 32px;
	align-items: flex-start;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-gutter: stable;
}

.atee-newsletter-modal__content::-webkit-scrollbar {
	width: 6px;
}

.atee-newsletter-modal__content::-webkit-scrollbar-thumb {
	background: #d4d4d5;
	border-radius: 3px;
}

.atee-newsletter-modal__header {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	flex-shrink: 0;
}

.atee-newsletter-modal__title {
	margin: 0;
	font-size: 32px;
	font-weight: 600;
	line-height: 40px;
	letter-spacing: 0.5px;
	color: #133595;
}

.atee-newsletter-modal__subtitle {
	margin: 0;
	font-size: 16px;
	font-weight: 500;
	line-height: 24px;
	letter-spacing: 0.5px;
	color: #474748;
}

.atee-newsletter-modal__fields {
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: 100%;
	flex-shrink: 0;
	padding-bottom: 4px;
}

.atee-newsletter-modal__field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
}

.atee-newsletter-modal__label {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 24px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: #19191a;
}

.atee-newsletter-modal__input {
	display: block;
	width: 100%;
	height: 48px;
	padding: 0 16px;
	border: 1px solid #e5e5e6;
	border-radius: 4px;
	background: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 24px;
	letter-spacing: 0.5px;
	color: #19191a;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.atee-newsletter-modal__input::placeholder {
	color: #a2a2a4;
	opacity: 1;
}

.atee-newsletter-modal__input:focus {
	outline: none;
	border-color: #e5e5e6;
	box-shadow: none;
}

.atee-newsletter-modal__actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	height: 48px;
	flex: 0 0 48px;
	margin-top: auto;
}

.atee-newsletter-modal__cancel,
.atee-newsletter-modal__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 12px 16px;
	border-radius: 4px;
	font-family: inherit;
	font-weight: 600;
	line-height: 24px;
	letter-spacing: 0.5px;
	cursor: pointer;
	text-decoration: none;
	-webkit-appearance: none;
	appearance: none;
}

.atee-newsletter-modal__cancel {
	font-size: 16px;
	background: #fff;
	border: 1px solid #e5e5e6;
	color: #525253;
}

.atee-newsletter-modal__cancel:hover {
	background: #f8f8f8;
	border-color: #d4d4d5;
	color: #19191a;
}

.atee-newsletter-modal__submit {
	font-size: 18px;
	min-width: 128px;
	background: #1039bd;
	border: 1px solid #1039bd;
	color: #fff;
}

.atee-newsletter-modal__submit:hover {
	background: #0e31a3;
	border-color: #0e31a3;
	color: #fff;
}

.atee-newsletter-modal__submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

.atee-newsletter-modal__notice {
	width: 100%;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	letter-spacing: 0.5px;
	flex-shrink: 0;
}

.atee-newsletter-modal__notice[hidden] {
	display: none;
}

.atee-newsletter-modal__notice--error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.atee-newsletter-modal__notice--success {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

body.atee-newsletter-locked {
	overflow: hidden;
}

button.atee-news-archive__promo-button,
button.atee-pub-archive__promo-button {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	cursor: pointer;
}

/* Narrow viewports: stack layout, keep card centered with full rounding */
@media (max-width: 960px) {
	.atee-newsletter-modal {
		--atee-nl-pad-y: 16px;
		--atee-nl-pad-x: 16px;
		align-items: center;
	}

	.atee-newsletter-modal__dialog {
		height: auto;
		max-height: calc(100dvh - 32px);
		padding: 24px;
		border-radius: 24px;
	}

	.atee-newsletter-modal__inner {
		gap: 24px;
		height: auto;
		max-height: calc(100dvh - 32px - 48px);
	}

	.atee-newsletter-modal__body {
		flex-direction: column;
		height: auto;
		max-height: none;
		flex: 1 1 auto;
		min-height: 0;
		overflow: hidden;
		gap: 24px;
	}

	.atee-newsletter-modal__media {
		flex: 0 0 auto;
		width: 100%;
		height: clamp(140px, 22vh, 200px);
		border-radius: 8px;
	}

	.atee-newsletter-modal__image {
		border-radius: 8px;
	}

	.atee-newsletter-modal__content {
		max-width: none;
		height: auto;
		flex: 1 1 auto;
		gap: 24px;
	}

	.atee-newsletter-modal__title {
		font-size: 24px;
		line-height: 32px;
	}

	.atee-newsletter-modal__actions {
		height: auto;
		flex-basis: auto;
		margin-top: 0;
	}
}

/* Very short screens: tighter chrome, keep form scrollable */
@media (max-height: 760px) {
	.atee-newsletter-modal {
		--atee-nl-pad-y: 16px;
	}

	.atee-newsletter-modal__dialog {
		padding: 24px;
	}

	.atee-newsletter-modal__inner {
		gap: 20px;
	}

	.atee-newsletter-modal__content {
		gap: 20px;
	}

	.atee-newsletter-modal__title {
		font-size: 28px;
		line-height: 36px;
	}
}
