/* Optin Forge front-end */
.ofg-form {
	--ofg-bg: #fff; --ofg-text: #1d2327; --ofg-btn: #2563eb; --ofg-btn-text: #fff;
	--ofg-radius: 12px;
	position: relative; box-sizing: border-box; background: var(--ofg-bg); color: var(--ofg-text);
	border-radius: var(--ofg-radius); padding: 32px; font-size: 16px; line-height: 1.5; text-align: center;
}
.ofg-form *, .ofg-form *::before, .ofg-form *::after { box-sizing: border-box; }
.ofg-form .ofg-headline { font-size: 1.6em; font-weight: 700; line-height: 1.2; margin: 0 0 .4em; color: inherit; }
.ofg-form .ofg-body { opacity: .85; margin: 0 0 1em; }
.ofg-form .ofg-body p { margin: 0 0 .6em; }
.ofg-form .ofg-media img { display: block; max-width: 100%; height: auto; margin: 0 auto 16px; border-radius: 8px; }
.ofg-form .ofg-fields { display: flex; flex-direction: column; gap: 10px; }
.ofg-form input[type=email], .ofg-form input[type=text] {
	width: 100%; padding: 12px 14px; font-size: 16px; border: 1px solid rgba(0,0,0,.18); border-radius: 8px;
	background: #fff; color: #1d2327; margin: 0; box-shadow: none; min-height: 46px;
}
.ofg-form input:focus { outline: 2px solid var(--ofg-btn); outline-offset: 1px; border-color: transparent; }
.ofg-form .ofg-button {
	appearance: none; border: 0; cursor: pointer; background: var(--ofg-btn); color: var(--ofg-btn-text);
	font-size: 16px; font-weight: 700; padding: 12px 22px; border-radius: 8px; min-height: 46px; line-height: 1.2;
	transition: filter .15s, transform .15s; margin: 0; text-transform: none; letter-spacing: normal; width: auto;
}
.ofg-form .ofg-button:hover { filter: brightness(1.08); }
.ofg-form .ofg-button:active { transform: translateY(1px); }
.ofg-form .ofg-button:disabled { opacity: .7; cursor: wait; }
.ofg-form .ofg-consent { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 13px; margin-top: 10px; opacity: .85; cursor: pointer; }
.ofg-form .ofg-consent input { margin-top: 3px; flex: none; }
.ofg-form .ofg-consent a, .ofg-form .ofg-footer a { color: inherit; text-decoration: underline; }
.ofg-form .ofg-footer { font-size: 12px; opacity: .65; margin-top: 12px; }
.ofg-form .ofg-msg { font-size: 14px; margin-top: 8px; min-height: 0; }
.ofg-form .ofg-msg:empty { display: none; }
.ofg-form .ofg-msg.ofg-error { color: #c62828; font-weight: 600; }
.ofg-form .ofg-success { font-size: 1.1em; font-weight: 600; padding: 12px 0; }
.ofg-form .ofg-success p { margin: 0; }
.ofg-form [hidden], .ofg-slot [hidden] { display: none !important; }
.ofg-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ofg-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ofg-close {
	position: absolute; top: 8px; right: 10px; z-index: 2; width: 34px; height: 34px; border: 0; background: transparent;
	color: inherit; font-size: 26px; line-height: 1; cursor: pointer; opacity: .6; padding: 0; border-radius: 50%;
}
.ofg-close:hover, .ofg-close:focus { opacity: 1; background: rgba(0,0,0,.06); }

/* ---------- Templates ---------- */
@media (min-width: 560px) {
	.ofg-tpl-minimal .ofg-fields { flex-direction: row; flex-wrap: wrap; }
	.ofg-tpl-minimal .ofg-fields input { flex: 1 1 180px; width: auto; }
}
.ofg-tpl-minimal { text-align: left; padding: 24px; border: 1px solid rgba(0,0,0,.1); }
.ofg-tpl-minimal .ofg-headline { font-size: 1.3em; }
.ofg-tpl-minimal .ofg-media img { max-width: 120px; margin: 0 0 12px; }

.ofg-tpl-split { text-align: left; padding: 0; overflow: hidden; }
.ofg-tpl-split .ofg-content { padding: 32px; }
.ofg-tpl-split .ofg-media img { margin: 0; border-radius: 0; width: 100%; height: 100%; object-fit: cover; max-height: 260px; }
@media (min-width: 640px) {
	.ofg-tpl-split.ofg-has-image { display: grid; grid-template-columns: 2fr 3fr; }
	.ofg-tpl-split .ofg-media img { max-height: none; min-height: 100%; }
	.ofg-tpl-split.ofg-has-image .ofg-success { grid-column: 2; padding: 32px; }
}

.ofg-tpl-bold { padding: 40px 32px; }
.ofg-tpl-bold .ofg-headline { font-size: 2.1em; font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; }
.ofg-tpl-bold .ofg-button { text-transform: uppercase; letter-spacing: .04em; padding: 15px 22px; font-size: 17px; }
.ofg-tpl-bold input[type=email], .ofg-tpl-bold input[type=text] { border-width: 2px; min-height: 52px; }

.ofg-tpl-card { text-align: left; border: 1px solid rgba(0,0,0,.1); border-top: 6px solid var(--ofg-btn); box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.ofg-tpl-card .ofg-media { float: right; margin: 0 0 12px 16px; max-width: 34%; }
.ofg-tpl-card .ofg-media img { margin: 0; }
.ofg-tpl-card .ofg-fields { clear: both; }

.ofg-tpl-gradient { background: linear-gradient(135deg, var(--ofg-bg) 0%, color-mix(in srgb, var(--ofg-btn) 35%, var(--ofg-bg)) 100%); }
.ofg-tpl-gradient .ofg-button { box-shadow: 0 6px 18px color-mix(in srgb, var(--ofg-btn) 40%, transparent); }

/* ---------- Pop-up ---------- */
.ofg-overlay {
	position: fixed; inset: 0; z-index: 999999; background: rgba(15, 18, 25, .6);
	display: flex; align-items: center; justify-content: center; padding: 16px;
	opacity: 0; transition: opacity .25s ease; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.ofg-overlay[hidden] { display: none; }
.ofg-overlay.ofg-visible { opacity: 1; }
.ofg-modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; transform: translateY(16px) scale(.98); transition: transform .25s ease; border-radius: 12px; }
.ofg-overlay.ofg-visible .ofg-modal { transform: none; }
.ofg-modal .ofg-form { box-shadow: 0 25px 60px rgba(0,0,0,.35); }
.ofg-modal:has(.ofg-tpl-split.ofg-has-image) { max-width: 760px; }
html.ofg-noscroll, html.ofg-noscroll body { overflow: hidden; }

/* ---------- Fly-in ---------- */
.ofg-flyin { position: fixed; z-index: 999998; width: 360px; max-width: calc(100vw - 24px); transition: transform .35s ease, opacity .35s ease; opacity: 0; }
.ofg-flyin[hidden] { display: none; }
.ofg-flyin .ofg-form { padding: 24px; box-shadow: 0 12px 40px rgba(0,0,0,.25); font-size: 15px; }
.ofg-flyin .ofg-headline { font-size: 1.3em; padding-right: 20px; }
.ofg-flyin .ofg-media img { max-height: 120px; width: auto; }
.ofg-flyin.ofg-tpl-split, .ofg-flyin .ofg-tpl-split.ofg-has-image { display: block; }
.ofg-pos-bottom-right { right: 20px; bottom: 20px; transform: translateY(30px); }
.ofg-pos-bottom-left { left: 20px; bottom: 20px; transform: translateY(30px); }
.ofg-pos-top-right { right: 20px; top: 20px; transform: translateY(-30px); }
.ofg-pos-top-left { left: 20px; top: 20px; transform: translateY(-30px); }
.ofg-flyin.ofg-visible { transform: none; opacity: 1; }
@media (max-width: 480px) { .ofg-flyin { left: 12px !important; right: 12px !important; width: auto; } }

/* ---------- Floating bar ---------- */
.ofg-bar { position: fixed; left: 0; right: 0; z-index: 999997; transition: transform .3s ease; }
.ofg-bar[hidden] { display: none; }
.ofg-bar-top { top: 0; transform: translateY(-100%); }
.ofg-bar-bottom { bottom: 0; transform: translateY(100%); }
.admin-bar .ofg-bar-top { top: 32px; }
.ofg-bar.ofg-visible { transform: none; }
.ofg-bar .ofg-form { border-radius: 0; padding: 12px 56px 12px 16px; box-shadow: 0 2px 16px rgba(0,0,0,.15); background: var(--ofg-bg); }
.ofg-bar .ofg-content { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; max-width: 1100px; margin: 0 auto; }
.ofg-bar .ofg-headline { font-size: 1.05em; margin: 0; }
.ofg-bar .ofg-fields { flex-direction: row; gap: 8px; }
.ofg-bar input[type=email], .ofg-bar input[type=text] { min-height: 40px; padding: 8px 12px; width: 220px; }
.ofg-bar .ofg-button { min-height: 40px; padding: 8px 16px; }
.ofg-bar .ofg-consent { margin: 0; flex-basis: 100%; justify-content: center; }
.ofg-bar .ofg-footer, .ofg-bar .ofg-msg { margin: 0; }
.ofg-bar .ofg-close { top: 50%; transform: translateY(-50%); }
.ofg-bar .ofg-success { padding: 4px 0; }
@media (max-width: 640px) {
	.ofg-bar .ofg-form { padding: 10px 44px 10px 12px; }
	.ofg-bar .ofg-content { gap: 8px; }
	.ofg-bar .ofg-fields { width: 100%; }
	.ofg-bar input[type=email], .ofg-bar input[type=text] { flex: 1 1 auto; width: auto; min-width: 0; }
	.ofg-bar input[name=name] { display: none; }
}

/* ---------- Inline contexts ---------- */
.ofg-slot { margin: 2em 0; }
.ofg-ctx-widget { padding: 20px; font-size: 15px; }
.ofg-ctx-widget .ofg-headline { font-size: 1.25em; }
.ofg-ctx-widget.ofg-tpl-split { display: block; }
.ofg-ctx-widget.ofg-tpl-minimal .ofg-fields { flex-direction: column; }
.ofg-ctx-below_content, .ofg-ctx-inline { box-shadow: 0 4px 24px rgba(0,0,0,.06); }

/* ---------- Content lock ---------- */
.ofg-locked { position: relative; margin: 0 0 2em; }
.ofg-locked .ofg-fade { height: 120px; margin-top: -120px; position: relative; pointer-events: none; background: linear-gradient(to bottom, rgba(255,255,255,0), var(--ofg-page-bg, #fff)); }
.ofg-locked .ofg-slot { margin-top: 0; }
.ofg-ctx-content_lock { border: 2px dashed rgba(0,0,0,.15); }
.ofg-ctx-content_lock .ofg-headline::before { content: "🔒 "; }

@media (prefers-reduced-motion: reduce) {
	.ofg-overlay, .ofg-modal, .ofg-flyin, .ofg-bar { transition: none !important; }
}
@media (max-width: 480px) {
	.ofg-form { padding: 24px 20px; }
	.ofg-form .ofg-headline { font-size: 1.35em; }
	.ofg-tpl-bold .ofg-headline { font-size: 1.6em; }
}
