/**
 * EmailFlow public forms
 */

.emailflow-form {
	--ef-form-brand: #0f766e;
	--ef-form-ink: #0f172a;
	--ef-form-muted: #64748b;
	--ef-form-border: #e2e8f0;
	--ef-form-radius: 10px;
	max-width: 440px;
	width: 100%;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: var(--ef-form-ink);
	box-sizing: border-box;
}

.emailflow-form *,
.emailflow-form *::before,
.emailflow-form *::after {
	box-sizing: border-box;
}

.emailflow-form__intro {
	margin-bottom: 20px;
	text-align: center;
}

.emailflow-form__headline {
	margin: 0 0 8px;
	font-size: 1.75rem;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.emailflow-form__lead {
	margin: 0;
	color: var(--ef-form-muted);
	font-size: 0.95rem;
	line-height: 1.5;
}

.emailflow-form__sticky-title {
	margin: 0 0 8px;
	font-weight: 600;
	font-size: 0.95rem;
}

.emailflow-form__fields {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.emailflow-form__label {
	display: block;
	margin-bottom: 4px;
	font-size: 0.85rem;
	font-weight: 600;
}

.emailflow-req {
	color: #dc2626;
}

.emailflow-form__control {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--ef-form-border);
	border-radius: 8px;
	font-size: 0.95rem;
	line-height: 1.4;
	background: #fff;
	color: var(--ef-form-ink);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.emailflow-form__control:focus {
	outline: none;
	border-color: var(--ef-form-brand);
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.emailflow-form__control[aria-invalid="true"] {
	border-color: #dc2626;
}

.emailflow-form__check {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	font-size: 0.875rem;
	line-height: 1.4;
	cursor: pointer;
}

.emailflow-form__check input {
	margin-top: 3px;
}

.emailflow-form__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
}

.emailflow-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 42px;
	padding: 0 18px;
	border: 0;
	border-radius: 8px;
	background: var(--ef-form-brand);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.emailflow-form__submit:hover {
	background: #0d9488;
}

.emailflow-form__submit:disabled,
.emailflow-form__submit.is-loading {
	opacity: 0.7;
	cursor: wait;
}

.emailflow-form__spinner {
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: emailflow-spin 0.7s linear infinite;
}

@keyframes emailflow-spin {
	to { transform: rotate(360deg); }
}

.emailflow-form__dismiss {
	border: 0;
	background: transparent;
	font-size: 1.4rem;
	line-height: 1;
	color: var(--ef-form-muted);
	cursor: pointer;
	padding: 4px 8px;
}

.emailflow-form__messages {
	margin-bottom: 12px;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 0.9rem;
}

.emailflow-form__messages.is-success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.emailflow-form__messages.is-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.emailflow-form__error {
	margin: 4px 0 0;
	font-size: 0.8rem;
	color: #dc2626;
}

.emailflow-form__hp {
	position: absolute !important;
	left: -9999px !important;
	height: 0 !important;
	overflow: hidden !important;
}

/* Popup */
.emailflow-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.emailflow-popup[hidden] {
	display: none !important;
}

.emailflow-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.5);
	backdrop-filter: blur(2px);
}

.emailflow-popup__dialog {
	position: relative;
	z-index: 1;
	width: min(440px, 100%);
	padding: 24px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.emailflow-popup .emailflow-form {
	max-width: none;
}

body.emailflow-popup-open {
	overflow: hidden;
}

/* Sticky bar */
.emailflow-sticky {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99990;
	padding: 12px 16px;
	background: #fff;
	border-top: 1px solid var(--ef-form-border);
	box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.emailflow-sticky[hidden] {
	display: none !important;
}

.emailflow-sticky--bottom {
	bottom: 0;
}

.emailflow-sticky--top {
	top: 0;
	border-top: 0;
	border-bottom: 1px solid var(--ef-form-border);
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.emailflow-sticky .emailflow-form {
	max-width: 960px;
	margin: 0 auto;
}

.emailflow-sticky .emailflow-form__form {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px;
}

.emailflow-sticky .emailflow-form__fields {
	flex: 1 1 280px;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 10px;
}

.emailflow-sticky .emailflow-form__field {
	flex: 1 1 160px;
}

.emailflow-sticky .emailflow-form__field--consent {
	flex: 1 1 100%;
}

.emailflow-sticky .emailflow-form__actions {
	margin-top: 0;
}

/* Landing */
body.emailflow-landing {
	margin: 0;
	min-height: 100vh;
	background:
		radial-gradient(ellipse 80% 60% at 50% -10%, rgba(15, 118, 110, 0.12), transparent 55%),
		#f8fafc;
}

.emailflow-landing__main {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
}

.emailflow-landing .emailflow-form {
	max-width: 480px;
	padding: 32px;
	background: #fff;
	border: 1px solid var(--ef-form-border);
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

@media (max-width: 600px) {
	.emailflow-sticky .emailflow-form__form {
		flex-direction: column;
		align-items: stretch;
	}
}
