/* FastoPop frontend styles. Mobile-first, class-prefix scoped (.fastopop-*). */

@font-face {
	font-family: 'Plus Jakarta Sans';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/plus-jakarta-sans-400.woff2') format('woff2');
}
@font-face {
	font-family: 'Plus Jakarta Sans';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('../fonts/plus-jakarta-sans-600.woff2') format('woff2');
}
@font-face {
	font-family: 'Plus Jakarta Sans';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/plus-jakarta-sans-700.woff2') format('woff2');
}

.fastopop-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 23, 45, 0.65);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	padding: 16px;
	box-sizing: border-box;
	font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	animation: fastopop-fade 200ms ease-out;
}

@keyframes fastopop-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.fastopop-modal {
	background: #ffffff;
	color: #00172d;
	border-radius: 12px;
	width: 100%;
	max-width: 600px;
	padding: 32px 24px;
	box-shadow: 0 20px 50px rgba(0, 23, 45, 0.25);
	position: relative;
	box-sizing: border-box;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
}

/* Mode A (Fasto-branded template) defaults to center-aligned content.
   Custom HTML mode (.fastopop-content--custom_html) inherits whatever the merchant's HTML provides. */
.fastopop-content--branded {
	text-align: center;
}

.fastopop-modal--small  { max-width: 400px; }
.fastopop-modal--medium { max-width: 600px; }
.fastopop-modal--large  { max-width: 900px; }

.fastopop-overlay--fullpage {
	padding: 0;
}
/* Higher-specificity selector (.fastopop-modal.fastopop-modal--fullpage = 0,2,0)
   wins cleanly over the base .fastopop-modal max-width: 600px (0,1,0) regardless
   of source order. Sizing applies to both modes; layout (block vs flex-centered)
   differs by mode and is set in the rules below. */
.fastopop-modal.fastopop-modal--fullpage {
	max-width: 100vw;
	width: 100vw;
	height: 100vh;
	max-height: 100vh;
	border-radius: 0;
	padding: 0;
	overflow-y: auto;
}
/* Mode A fullpage: flex-centers its 640px content column both axes. */
.fastopop-modal.fastopop-modal--fullpage.fastopop-mode-branded {
	display: flex;
	align-items: center;
	justify-content: center;
}
/* Custom HTML fullpage: plain block layout so merchant HTML can fill 100vw × 100vh
   instead of getting flex-centered into a smaller box on wide viewports. */
.fastopop-modal.fastopop-modal--fullpage.fastopop-mode-custom_html {
	display: block;
}
/* Fullpage Mode A: constrain the readable column to 640px and add safe-area padding.
   Custom HTML fullpage is intentionally NOT scoped here — merchants fill the viewport. */
.fastopop-modal--fullpage.fastopop-mode-branded .fastopop-content {
	max-width: 640px;
	width: 100%;
	padding: 32px 24px;
	box-sizing: border-box;
}
/* Pin close to the viewport corner so it stays put if fullpage content scrolls. */
.fastopop-modal--fullpage .fastopop-close {
	position: fixed;
	top: 24px;
	right: 24px;
}

@media (min-width: 768px) {
	.fastopop-modal--fullpage.fastopop-mode-branded .fastopop-content {
		padding: 48px 40px;
	}
}

/* Theme isolation: neutralize button styling that the merchant's theme may apply
   globally (border, shadow, outline, background-image, text-shadow). Specificity
   0,1,1 wins over any unscoped `button` / `[type=submit]` theme rules without
   needing !important on every property. Color + background + padding stay
   property-by-property in the rules below so each button can claim its own look. */
.fastopop-overlay button,
.fastopop-modal button {
	border: 0;
	box-shadow: none;
	outline: none;
	background-image: none;
	text-shadow: none;
}

.fastopop-close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: transparent;
	border: 0;
	box-shadow: none;
	font-size: 28px;
	line-height: 1;
	color: #00172d;
	cursor: pointer;
	padding: 4px 8px;
}
.fastopop-close:hover,
.fastopop-close:focus {
	opacity: 0.7;
	outline: none;
}

/* ============================================================
   Custom HTML mode — strip the modal frame so the merchant's
   HTML IS the entire visual. Size variants (small/medium/large/
   fullpage) still control modal width/height; we only remove
   the chrome (background, padding, radius, shadow).
   Mode A (fastopop-mode-branded) is untouched.
   ============================================================ */
.fastopop-mode-custom_html {
	background: transparent;
	padding: 0;
	border-radius: 12px;
	/* Clip merchant content at the rounded corners. The base .fastopop-modal
	   sets overflow-y: auto; we override here because Custom HTML modals are
	   sized to fit their content — fullpage handles tall content separately. */
	overflow: hidden;
	box-shadow: none;
}
.fastopop-mode-custom_html .fastopop-content {
	padding: 0;
}

/* Pill-style close button so it stays readable on whatever the
   merchant's HTML places behind it. */
.fastopop-mode-custom_html .fastopop-close {
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	padding: 0;
	background: rgba(0, 0, 0, 0.5);
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	line-height: 1;
}
.fastopop-mode-custom_html .fastopop-close:hover,
.fastopop-mode-custom_html .fastopop-close:focus {
	background: rgba(0, 0, 0, 0.75);
	opacity: 1;
	outline: none;
}

/* Full page Custom HTML — keep close button at the 24px inset that the
   existing fullpage rule already uses. Higher selector specificity here
   overrides the 12px from the rule above. position: fixed cascades from
   .fastopop-modal--fullpage .fastopop-close. */
.fastopop-mode-custom_html.fastopop-modal--fullpage .fastopop-close {
	top: 24px;
	right: 24px;
}

/* Full page Custom HTML — undo the rounded corners + restore vertical scroll
   (the base custom_html rule above sets overflow:hidden for the rounded-corner
   clip, but fullpage popups can be tall and must scroll). */
.fastopop-mode-custom_html.fastopop-modal--fullpage {
	border-radius: 0;
	overflow-y: auto;
}
/* Let merchant content with height: 100% on its outer wrapper actually fill
   the viewport top-to-bottom. Scoped to Custom HTML only — Mode A fullpage
   relies on the flex container's align-items: center for its centered
   640px column, which would break if .fastopop-content stretched to 100%. */
.fastopop-mode-custom_html.fastopop-modal--fullpage .fastopop-content {
	height: 100%;
}

.fastopop-headline {
	font-weight: 700;
	font-size: 24px;
	line-height: 1.2;
	margin: 0 0 8px;
	color: #00172d;
}
.fastopop-subheadline {
	font-weight: 600;
	font-size: 16px;
	margin: 0 0 16px;
	color: #00172d;
	opacity: 0.85;
}
.fastopop-body {
	font-size: 15px;
	line-height: 1.5;
	margin: 0 0 20px;
	color: #00172d;
}
.fastopop-body p {
	margin: 0 0 12px;
}
.fastopop-body p:last-child {
	margin-bottom: 0;
}
.fastopop-body a {
	color: #005ee0;
}

.fastopop-cta {
	display: inline-block;
	background: #005ee0;
	color: #ffffff;
	text-decoration: none;
	font-weight: 600;
	padding: 12px 24px;
	border-radius: 8px;
	transition: opacity 150ms ease;
}
.fastopop-cta:hover,
.fastopop-cta:focus {
	opacity: 0.9;
	color: #ffffff;
	outline: none;
}

.fastopop-poweredby {
	margin: 20px 0 0;
	font-size: 12px;
	text-align: center;
}
/* Link inherits the merchant's body color so it stays readable on any background.
   Underline + hover opacity are the link affordances, not color. */
.fastopop-poweredby a {
	color: inherit;
	text-decoration: underline;
}
.fastopop-poweredby a:hover,
.fastopop-poweredby a:focus {
	opacity: 0.7;
	outline: none;
}

.fastopop-form {
	margin: 16px 0 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	text-align: left;
}
.fastopop-content--branded .fastopop-form {
	/* Center the form column but keep inputs left-aligned for readability. */
	max-width: 360px;
	margin-left: auto;
	margin-right: auto;
}
.fastopop-input {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid rgba(0, 23, 45, 0.2);
	border-radius: 6px;
	font: inherit;
	color: #00172d;
	background: #ffffff;
}
.fastopop-input:focus {
	outline: none;
	border-color: #005ee0;
	box-shadow: 0 0 0 3px rgba(0, 94, 224, 0.18);
}
.fastopop-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 13px;
	line-height: 1.4;
	color: #00172d;
}
.fastopop-consent input[type="checkbox"] {
	margin-top: 3px;
	flex-shrink: 0;
}
.fastopop-consent a {
	color: #005ee0;
}
.fastopop-form-submit {
	background: #005ee0;
	color: #ffffff;
	border: 0;
	font: inherit;
	font-weight: 600;
	padding: 12px 24px;
	border-radius: 8px;
	cursor: pointer;
	transition: opacity 150ms ease;
}
.fastopop-form-submit:hover,
.fastopop-form-submit:focus {
	opacity: 0.9;
	outline: none;
}
.fastopop-form-submit[disabled] {
	opacity: 0.6;
	cursor: default;
}
.fastopop-form-message {
	color: #b3261e;
	font-size: 13px;
}
.fastopop-form-success {
	color: #00172d;
	font-weight: 600;
	margin: 0;
}
/* Honeypot — off-screen and inaccessible to humans, but bots fill it. */
.fastopop-hp {
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	opacity: 0 !important;
}

@media (min-width: 768px) {
	/* Desktop padding scoped to Mode A only — Custom HTML mode keeps padding:0
	   so merchant content renders edge-to-edge. */
	.fastopop-modal.fastopop-mode-branded {
		padding: 40px 32px;
	}
	.fastopop-headline {
		font-size: 28px;
	}
}
