/* ==========================================================================
   ATVMB Newsletter - Popup redesign (v3.1, "glass")
   One compact translucent card. Loaded after public.css.
   Rollback: delete this file and restore the earlier markup/enqueue.
   ========================================================================== */

.atvmb-popup-v3 {
	--g-text: #f8fafc;
	--g-muted: rgba(235, 240, 247, 0.80);
	--g-faint: rgba(226, 232, 240, 0.58);
	--g-line: rgba(255, 255, 255, 0.20);
	--g-field: rgba(8, 12, 32, 0.22);
	--g-blue: #3b6bff;
	--g-danger: #ff8a8a;
	box-sizing: border-box;
	background-color: rgba(6, 10, 26, 0.55);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

/* ---------- Glass card ---------- */
.atvmb-popup-v3 .atvmb-popup-modal {
	display: block;
	max-width: 400px;
	padding: 0;
	overflow: hidden;
	color: var(--g-text);
	background: linear-gradient(160deg, rgba(58, 72, 128, 0.46) 0%, rgba(18, 26, 58, 0.52) 100%);
	-webkit-backdrop-filter: blur(28px) saturate(170%);
	backdrop-filter: blur(28px) saturate(170%);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 24px;
	box-shadow:
		0 30px 80px -20px rgba(0, 0, 0, 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Browsers without backdrop-filter get a solid dark card instead */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.atvmb-popup-v3 .atvmb-popup-modal {
		background: #131a36;
	}
}

.atvmb-popup-v3 .atvmb-popup-main {
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 31px 29px 20px;
}

/* ---------- Close ---------- */
.atvmb-popup-v3 .atvmb-popup-close {
	top: 16px;
	right: 16px;
	width: 32px;
	height: 32px;
	background: rgba(255, 255, 255, 0.08);
	border: 0;
	color: var(--g-muted);
	font-size: 18px;
}

.atvmb-popup-v3 .atvmb-popup-close:hover {
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
}

.atvmb-popup-v3 .atvmb-popup-close:focus-visible,
.atvmb-popup-v3 .atvmb-popup-dismiss-btn:focus-visible {
	outline: 2px solid var(--g-blue);
	outline-offset: 2px;
}

/* ---------- Header ---------- */
.atvmb-popup-v3 .atvmb-popup-header {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	column-gap: 12px;
	row-gap: 8px;
	margin: 0 0 18px;
	padding: 0;
	text-align: left;
}

.atvmb-popup-v3 .atvmb-popup-art {
	display: block;
	width: 40px;
	height: 32px;
	margin: 0;
	background: url("../images/atvmb_newsletter.png") left center / contain no-repeat;
	filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}

.atvmb-popup-v3 .atvmb-popup-header h2 {
	margin: 0;
	padding-right: 30px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--g-text);
	background: none;
	-webkit-text-fill-color: var(--g-text);
}

.atvmb-popup-v3 .atvmb-popup-header p {
	grid-column: 1 / -1;
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--g-muted);
}

.atvmb-popup-v3 .atvmb-popup-body {
	overflow: visible;
	max-height: none;
	padding-right: 0;
}

.atvmb-popup-v3 .atvmb-newsletter-container {
	max-width: none;
}

/* ---------- Form ---------- */
.atvmb-popup-v3 .atvmb-newsletter-form {
	gap: 15px;
}

.atvmb-popup-v3 .atvmb-form-field {
	gap: 7px;
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field label {
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	color: rgba(255, 255, 255, 0.93);
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field label .required {
	color: var(--g-danger);
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field label .optional {
	margin-left: 4px;
	font-size: 12px;
	font-weight: 500;
	color: var(--g-faint);
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input[type="text"],
.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input[type="email"],
.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input[type="tel"] {
	height: 44px;
	padding: 0 15px;
	font-size: 15px;
	font-weight: 500;
	color: #fff !important;
	background-color: var(--g-field) !important;
	border: 1px solid var(--g-line) !important;
	border-radius: 13px;
	box-shadow: none !important;
	transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input:hover {
	border-color: rgba(255, 255, 255, 0.28) !important;
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input:focus {
	outline: none;
	background-color: rgba(8, 12, 32, 0.42) !important;
	border-color: #6f93ff !important;
	box-shadow: 0 0 0 4px rgba(59, 107, 255, 0.22) !important;
}

.atvmb-popup-v3 .atvmb-context-popup input::placeholder {
	color: var(--g-faint) !important;
	opacity: 1 !important;
}

.atvmb-popup-v3 .atvmb-context-popup input::-ms-input-placeholder {
	color: var(--g-faint) !important;
}

/* Autofill can't be translucent, so keep it dark to match */
.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input:-webkit-autofill,
.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input:-webkit-autofill:hover,
.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input:-webkit-autofill:focus,
.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input:-webkit-autofill:active {
	-webkit-text-fill-color: var(--g-text) !important;
	-webkit-box-shadow: 0 0 0 1000px #20294d inset !important;
	caret-color: var(--g-text);
}

/* Checkbox */
.atvmb-popup-v3 .atvmb-context-popup .atvmb-checkbox-field {
	margin: 0;
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-checkbox-label,
.atvmb-popup-v3 .atvmb-context-popup .atvmb-checkbox-label .label-text {
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	color: rgba(255, 255, 255, 0.92) !important;
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-custom-checkbox {
	width: 20px;
	height: 20px;
	background: var(--g-field);
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 6px;
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-checkbox-label:hover input ~ .atvmb-custom-checkbox {
	border-color: rgba(255, 255, 255, 0.5);
	background: rgba(255, 255, 255, 0.12);
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-checkbox-label input:checked ~ .atvmb-custom-checkbox {
	background: var(--g-blue);
	border-color: var(--g-blue);
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-checkbox-label input:focus-visible ~ .atvmb-custom-checkbox {
	box-shadow: 0 0 0 4px rgba(59, 107, 255, 0.25);
}

/* ---------- Button ---------- */
.atvmb-popup-v3 .atvmb-form-submit {
	margin-top: 4px;
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-submit-btn {
	height: 48px;
	padding: 0 20px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	letter-spacing: 0 !important;
	border: 0 !important;
	border-radius: 14px !important;
	background: linear-gradient(135deg, #3b6bff 0%, #2147e6 100%) !important;
	box-shadow: none !important;
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-submit-btn:hover {
	background: linear-gradient(135deg, #5380ff 0%, #2a52f0 100%) !important;
	transform: translateY(-1px) !important;
	box-shadow: none !important;
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-submit-btn:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.55);
	outline-offset: 2px;
}

/* ---------- Validation + messages ---------- */
.atvmb-popup-v3 .atvmb-context-popup .atvmb-field-error {
	color: var(--g-danger);
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input.atvmb-input-error[type] {
	border-color: var(--g-danger) !important;
	box-shadow: 0 0 0 4px rgba(255, 138, 138, 0.16) !important;
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-message.success {
	background: rgba(16, 185, 129, 0.14);
	border-color: rgba(52, 211, 153, 0.35);
	color: #6ee7b7;
}

.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-message.error {
	background: rgba(255, 138, 138, 0.12);
	border-color: rgba(255, 138, 138, 0.35);
	color: var(--g-danger);
}

.atvmb-popup-v3 .atvmb-success-display {
	padding: 24px 8px 12px;
}

.atvmb-popup-v3 .atvmb-success-heading {
	color: var(--g-text);
}

.atvmb-popup-v3 .atvmb-success-text {
	color: var(--g-muted);
}

/* ---------- Footer bits ---------- */
.atvmb-popup-v3 .atvmb-popup-privacy {
	margin: 14px 0 0;
	text-align: center;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--g-faint);
}

.atvmb-popup-v3 .atvmb-popup-dismiss-container {
	margin-top: 2px;
	margin-bottom: 15px;
}

.atvmb-popup-v3 .atvmb-popup-dismiss-btn {
	padding: 6px 14px !important;
	font-size: 13.5px !important;
	font-weight: 500 !important;
	text-decoration: none !important;
	color: var(--g-muted) !important;
	border-radius: 8px !important;
}

.atvmb-popup-v3 .atvmb-popup-dismiss-btn:hover {
	color: #fff !important;
	background: rgba(255, 255, 255, 0.08) !important;
}

/* ---------- Phones: bottom sheet ---------- */
@media (max-width: 480px) {
	.atvmb-popup-v3 {
		padding: 10px;
		align-items: flex-end;
	}

	.atvmb-popup-v3 .atvmb-popup-modal {
		max-width: none;
		border-radius: 22px;
	}

	.atvmb-popup-v3 .atvmb-popup-main {
		max-height: calc(100vh - 20px);
		max-height: calc(100dvh - 20px);
		padding: 22px 20px 12px;
	}

	.atvmb-popup-v3 .atvmb-popup-header {
		margin-bottom: 15px;
	}

	.atvmb-popup-v3 .atvmb-popup-header h2 {
		font-size: 18.5px;
	}

	.atvmb-popup-v3 .atvmb-newsletter-form {
		gap: 13px;
	}

	.atvmb-popup-v3 .atvmb-form-field {
		gap: 6px;
	}

	.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input[type="text"],
	.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input[type="email"],
	.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input[type="tel"] {
		height: 44px;
	}

	.atvmb-popup-v3 .atvmb-context-popup .atvmb-submit-btn {
		height: 48px;
	}

	.atvmb-popup-v3 .atvmb-popup-privacy {
		margin-top: 12px;
	}

	/* 16px stops iOS from zooming the page on focus */
	.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input[type="text"],
	.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input[type="email"],
	.atvmb-popup-v3 .atvmb-context-popup .atvmb-form-field input[type="tel"] {
		font-size: 16px;
	}
}

/* Short viewport (on-screen keyboard open): keep only what's needed */
@media (max-height: 560px) {
	.atvmb-popup-v3 .atvmb-popup-header p,
	.atvmb-popup-v3 .atvmb-popup-privacy {
		display: none;
	}

	.atvmb-popup-v3 .atvmb-popup-header {
		margin-bottom: 10px;
	}
}
