/*
 * Modern Shop Connector - Newsletter (Frontend).
 *
 * Es werden ausschliesslich die vom Plugin selbst erzeugten Elemente gestylt. Die Theme-Klassen
 * `mn-newsletter-*` bleiben unangetastet - Darstellung und Platzierung der Newsletter-Leiste sind
 * Theme-Sache und über den Customizer konfigurierbar.
 *
 * Alle Stellschrauben stehen als CSS-Variablen an einer Stelle. Jede Farbe folgt der
 * verbindlichen Fallback-Kette: theme-spezifisch -> generisch WordPress -> neutraler Endwert
 * (siehe docs/PLUGIN-STYLING-PRINCIPLES.md). Grün ist im Theme «Modern Natura» ausschliesslich
 * für Kauf-Aktionen reserviert; für Erfolg wird deshalb der Waldgrün-Ton `--mn-link` verwendet.
 */

/* Signed stock-alert pages use the same card without loading a theme/admin shell. */
.msc-stock-alert-standalone {
	margin: 0;
	background: var(--mn-bg, var(--wp--preset--color--base-2, #f5f5f3));
	font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.msc-stock-alert-standalone .msc-newsletter-notice {
	min-height: 100vh;
	min-height: 100svh;
}

.msc-newsletter-msg,
.msc-newsletter-notice {
	--msc-nl-success: var(--mn-link, var(--wp--preset--color--primary, #33604a));
	--msc-nl-error: var(--mn-sale, var(--wp--preset--color--vivid-red, #b32d2e));
	--msc-nl-text: var(--mn-text, var(--wp--preset--color--contrast, #2f3437));
	--msc-nl-muted: var(--mn-border, var(--wp--preset--color--tertiary, #dcdcde));
	--msc-nl-surface: var(--mn-surface, var(--wp--preset--color--base, #ffffff));
	--msc-nl-radius: 6px;
	--msc-nl-gap: 16px;
}

/*
 * Statuszeile unter dem Formular. `order` und die volle Breite sorgen dafür, dass sie in einer
 * flex-Zeile (Theme-Layout: Eingabefeld + Schaltfläche nebeneinander) sauber umbricht und unter
 * dem Formular steht, statt sich zwischen die Bedienelemente zu drängen. In einem Block-Layout
 * verhält sie sich wie ein gewöhnlicher Absatz.
 */
.msc-newsletter-msg {
	order: 99;
	flex: 1 0 100%;
	width: 100%;
	max-width: 100%;
	margin: 8px 0 0;
	font-size: 0.9em;
	line-height: 1.45;
	color: var(--msc-nl-text);
}

.msc-newsletter-msg.is-success {
	color: var(--msc-nl-success);
}

.msc-newsletter-msg.is-error {
	color: var(--msc-nl-error);
}

.msc-newsletter-msg.is-busy {
	opacity: 0.7;
}

/* Gemeinsame Seite für Bestätigung, Abschluss, Abmeldung und erneuerten Formularschutz.
 * Gleiche ruhige Kartenstruktur wie die Shop-Dialoge; Markenwerte werden geerbt. */
.msc-newsletter-notice {
	--msc-nl-radius: var(--mn-radius-box, var(--wp--custom--border--radius, 15px));
	--msc-nl-heading: var(--mn-text-dark, var(--wp--preset--color--contrast, #292d29));
	--msc-nl-header: var(--wp--preset--color--base-2, #f5f5f3);
	--msc-nl-header: color-mix(in srgb, var(--mn-band, var(--wp--preset--color--base-2, #e8e8e4)) 30%, var(--msc-nl-surface));
	--msc-nl-shadow: 0 18px 60px rgb(0 0 0 / 10%);
	--msc-nl-logo-width: 400px;
	--msc-nl-logo-height: 112px;
	--msc-nl-brand-padding: clamp(20px, 4vw, 28px);
	--msc-nl-button-bg: var(--wp--preset--color--base-2, #f1f1ef);
	--msc-nl-button-hover: var(--wp--preset--color--tertiary, #e6e6e2);
	box-sizing: border-box;
	display: grid;
	place-items: center;
	min-height: 80vh;
	min-height: 80svh;
	padding: clamp(24px, 6vw, 64px) 16px;
	color: var(--msc-nl-text);
}
.msc-newsletter-notice__card {
	box-sizing: border-box;
	width: 100%;
	max-width: 560px;
	border: 1px solid var(--msc-nl-muted);
	border-radius: var(--msc-nl-radius);
	background: var(--msc-nl-surface);
	box-shadow: var(--msc-nl-shadow);
	overflow: hidden;
	text-align: start;
}
.msc-newsletter-notice__brand {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--msc-nl-brand-padding);
	border-bottom: 1px solid var(--msc-nl-muted);
	background: var(--msc-nl-header);
}
.msc-newsletter-notice__brand a { display: inline-flex; justify-content: center; width: var(--msc-nl-logo-width); max-width: 100%; color: var(--msc-nl-heading); text-decoration: none; font-weight: 500; }
.msc-newsletter-notice__logo { display: block; width: 100%; height: auto; max-width: 100%; max-height: var(--msc-nl-logo-height); object-fit: contain; }
.msc-newsletter-notice__body { padding: clamp(22px, 5vw, 32px); }
.msc-newsletter-notice__title {
	margin: 0 0 16px;
	padding: 0;
	border: 0;
	color: var(--msc-nl-heading);
	font: inherit;
	font-size: clamp(23px, 4vw, 28px);
	font-weight: 500;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
	overflow-wrap: anywhere;
}
.msc-newsletter-notice__text { margin: 0 0 24px; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.msc-newsletter-notice__actions { margin: 0; text-align: center; }
.msc-newsletter-notice__confirm { margin: 0 0 16px; }
.msc-newsletter-notice__link {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	padding: 12px 18px;
	border: 1px solid var(--msc-nl-muted);
	border-radius: var(--mn-radius-s, 8px);
	background: var(--msc-nl-button-bg);
	color: var(--msc-nl-text);
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	white-space: normal;
	cursor: pointer;
}
.msc-newsletter-notice__link:hover { background: var(--msc-nl-button-hover); color: var(--msc-nl-heading); text-decoration: none; }
.msc-newsletter-notice__back { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 8px; font-size: 14px; color: var(--msc-nl-text); text-underline-offset: 3px; }
.msc-newsletter-notice :is(a, button):focus-visible { outline: 2px solid var(--msc-nl-success); outline-offset: 4px; }
