/* SB Newsletter — form di iscrizione.
   Selettori con .sbn-form per non subire gli stili del tema/Elementor. */

.sbn-form {
	--sbn-accent: #c8a27a;
	--sbn-accent-text: #ffffff;
	--sbn-radius: 8px;
	--sbn-text: #1f2937;
	--sbn-muted: #6b7280;
	--sbn-bg: transparent;
	--sbn-field-bg: #ffffff;
	--sbn-border: #d1d5db;
	--sbn-font: inherit;
	--sbn-gap: 12px;

	box-sizing: border-box;
	width: 100%;
	max-width: 560px;
	color: var(--sbn-text);
	background: var(--sbn-bg);
	font-family: var(--sbn-font);
	line-height: 1.5;
}
.sbn-form *,
.sbn-form *::before,
.sbn-form *::after { box-sizing: border-box; }

.sbn-form.sbn-align-center { margin-left: auto; margin-right: auto; text-align: center; }
.sbn-form.sbn-layout-inline { max-width: 820px; }

.sbn-form .sbn-title { margin: 0 0 6px; font-size: 1.5em; line-height: 1.25; color: inherit; font-family: inherit; }
.sbn-form .sbn-subtitle { margin: 0 0 18px; color: var(--sbn-muted); font-size: 1em; }

.sbn-form .sbn-form__form { margin: 0; padding: 0; }

/* Honeypot nascosto agli umani. */
.sbn-form .sbn-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.sbn-form .sbn-fields { display: flex; flex-direction: column; gap: var(--sbn-gap); }
.sbn-form.sbn-layout-inline .sbn-fields { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
.sbn-form.sbn-layout-inline .sbn-field { flex: 1 1 180px; }
.sbn-form.sbn-layout-inline .sbn-field--submit { flex: 0 0 auto; }

.sbn-form .sbn-field { margin: 0; text-align: left; }
.sbn-form .sbn-field label {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.sbn-form .sbn-req { color: var(--sbn-accent); }

.sbn-form input[type="text"],
.sbn-form input[type="email"],
.sbn-form input[type="tel"] {
	display: block;
	width: 100%;
	height: auto;
	min-height: 50px;
	margin: 0;
	padding: 13px 16px;
	font: inherit;
	font-size: 16px; /* evita lo zoom automatico su iPhone */
	line-height: 1.4;
	color: var(--sbn-text);
	background: var(--sbn-field-bg);
	border: 1px solid var(--sbn-border);
	border-radius: var(--sbn-radius);
	box-shadow: none;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.sbn-form input::placeholder { color: var(--sbn-muted); opacity: 1; }
.sbn-form input[type="text"]:focus,
.sbn-form input[type="email"]:focus,
.sbn-form input[type="tel"]:focus {
	border-color: var(--sbn-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--sbn-accent) 22%, transparent);
}
.sbn-form input.sbn-invalid { border-color: #dc2626; }

.sbn-form .sbn-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 13px 28px;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: .01em;
	color: var(--sbn-accent-text);
	background: var(--sbn-accent);
	border: 1px solid var(--sbn-accent);
	border-radius: var(--sbn-radius);
	cursor: pointer;
	text-transform: none;
	box-shadow: none;
	transition: filter .15s ease, transform .1s ease;
}
.sbn-form .sbn-button:hover { filter: brightness(.93); color: var(--sbn-accent-text); background: var(--sbn-accent); }
.sbn-form .sbn-button:active { transform: translateY(1px); }
.sbn-form .sbn-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--sbn-accent) 40%, transparent); outline-offset: 2px; }
.sbn-form.sbn-layout-inline .sbn-button { width: auto; height: 100%; white-space: nowrap; }

.sbn-form .sbn-spinner {
	display: none;
	width: 18px; height: 18px; margin-left: 10px;
	border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
	animation: sbn-spin .7s linear infinite;
}
.sbn-form.is-loading .sbn-spinner { display: inline-block; }
.sbn-form.is-loading .sbn-button { pointer-events: none; opacity: .85; }
@keyframes sbn-spin { to { transform: rotate(360deg); } }

.sbn-form .sbn-consent { margin-top: 14px; font-size: 13px; color: var(--sbn-muted); text-align: left; }
.sbn-form .sbn-consent label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin: 0; font-weight: normal; }
.sbn-form .sbn-consent input[type="checkbox"] {
	flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--sbn-accent);
}
.sbn-form .sbn-consent a { color: inherit; text-decoration: underline; }
.sbn-form .sbn-consent.sbn-invalid { color: #dc2626; }

.sbn-form .sbn-message {
	display: none;
	margin-top: 14px;
	padding: 12px 16px;
	border-radius: var(--sbn-radius);
	font-size: 15px;
	text-align: left;
}
.sbn-form .sbn-message.is-visible { display: block; background: #f3f4f6; }
.sbn-form .sbn-message.is-success { display: block; background: #ecfdf5; color: #065f46; }
.sbn-form .sbn-message.is-error { display: block; background: #fef2f2; color: #991b1b; }
.sbn-form.is-done .sbn-fields,
.sbn-form.is-done .sbn-consent { display: none; }
.sbn-form.is-done .sbn-message { margin-top: 0; font-size: 16px; padding: 18px 20px; }

/* ---- Temi ---- */

.sbn-form.sbn-theme-card {
	--sbn-bg: #ffffff;
	padding: 32px;
	border-radius: calc(var(--sbn-radius) + 6px);
	box-shadow: 0 12px 40px rgba(17, 24, 39, .08), 0 2px 6px rgba(17, 24, 39, .04);
}

.sbn-form.sbn-theme-minimal {
	--sbn-field-bg: transparent;
	--sbn-border: currentColor;
}
.sbn-form.sbn-theme-minimal input[type="text"],
.sbn-form.sbn-theme-minimal input[type="email"],
.sbn-form.sbn-theme-minimal input[type="tel"] {
	border-width: 0 0 1px 0; border-radius: 0; padding-left: 2px; padding-right: 2px;
}
.sbn-form.sbn-theme-minimal input:focus { box-shadow: none !important; }

.sbn-form.sbn-theme-elegant {
	--sbn-font: Georgia, 'Times New Roman', serif;
	--sbn-border: #cbbfae;
	--sbn-field-bg: transparent;
}
.sbn-form.sbn-theme-elegant .sbn-title { font-weight: 400; font-size: 1.8em; letter-spacing: .01em; }
.sbn-form.sbn-theme-elegant input[type="text"],
.sbn-form.sbn-theme-elegant input[type="email"],
.sbn-form.sbn-theme-elegant input[type="tel"] { font-family: var(--sbn-font); }
.sbn-form.sbn-theme-elegant .sbn-button { text-transform: uppercase; letter-spacing: .12em; font-size: 14px; font-weight: 500; }

.sbn-form.sbn-theme-dark {
	--sbn-bg: #111827;
	--sbn-text: #f9fafb;
	--sbn-muted: #9ca3af;
	--sbn-field-bg: #1f2937;
	--sbn-border: #374151;
	padding: 32px;
	border-radius: calc(var(--sbn-radius) + 6px);
}
.sbn-form.sbn-theme-dark .sbn-message.is-visible { background: #1f2937; color: #f9fafb; }

@media (max-width: 600px) {
	.sbn-form.sbn-layout-inline .sbn-fields { flex-direction: column; }
	.sbn-form.sbn-layout-inline .sbn-field { flex: 1 1 auto; }
	.sbn-form.sbn-layout-inline .sbn-button { width: 100%; }
	.sbn-form.sbn-theme-card,
	.sbn-form.sbn-theme-dark { padding: 24px 20px; }
}
