/**
 * Utenze Bortolami – Dynamic Devotion
 * Stili di base: font, colori e pulsanti arrivano dal tema.
 * Per adattarli basta ridefinire le variabili su .ub-form-wrap.
 */

.ub-form-wrap {
	--ub-gap: 1.25rem;
	--ub-radius: 4px;
	--ub-border: color-mix(in srgb, currentColor 30%, transparent);
	--ub-focus: color-mix(in srgb, currentColor 70%, transparent);
	--ub-error: #b42318;
	--ub-success: #067647;
	--ub-info: #175cd3;
	max-width: 28rem;
}

.ub-form-wrap .ub-form {
	margin: 0;
}

.ub-form-wrap .ub-field,
.ub-form-wrap .ub-intro,
.ub-form-wrap .ub-actions {
	margin: 0 0 var(--ub-gap);
}

.ub-form-wrap .ub-field > label {
	display: block;
	margin: 0 0 0.4rem;
	font-weight: 600;
}

.ub-form-wrap input[type="text"],
.ub-form-wrap input[type="email"],
.ub-form-wrap input[type="password"] {
	display: block;
	width: 100%;
	box-sizing: border-box;
	min-height: 2.75rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--ub-border);
	border-radius: var(--ub-radius);
	font: inherit;
	color: inherit;
}

.ub-form-wrap input:focus-visible,
.ub-form-wrap button:focus-visible,
.ub-form-wrap a:focus-visible {
	outline: 2px solid var(--ub-focus);
	outline-offset: 2px;
}

/* Campo password con pulsante mostra/nascondi */
.ub-form-wrap .ub-password {
	position: relative;
	display: block;
}

.ub-form-wrap .ub-password input {
	padding-right: 6rem;
}

.ub-form-wrap .ub-password__toggle {
	position: absolute;
	top: 50%;
	right: 0.35rem;
	transform: translateY(-50%);
	padding: 0.35rem 0.6rem;
	border: 0;
	border-radius: var(--ub-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.875em;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.ub-form-wrap .ub-hint {
	display: block;
	margin-top: 0.4rem;
	font-size: 0.875em;
	opacity: 0.75;
}

.ub-form-wrap .ub-field--checkbox label {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	font-weight: 400;
}

.ub-form-wrap .ub-field--checkbox input {
	flex: none;
	width: 1.1rem;
	height: 1.1rem;
	margin: 0.2em 0 0;
}

.ub-form-wrap .ub-button {
	cursor: pointer;
}

.ub-form-wrap .ub-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 0;
	font-size: 0.95em;
}

/* Messaggi */
.ub-form-wrap .ub-notice {
	margin: 0 0 var(--ub-gap);
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--ub-info);
	border-radius: var(--ub-radius);
	background: color-mix(in srgb, var(--ub-info) 8%, transparent);
}

.ub-form-wrap .ub-notice--error {
	border-left-color: var(--ub-error);
	background: color-mix(in srgb, var(--ub-error) 8%, transparent);
}

.ub-form-wrap .ub-notice--success {
	border-left-color: var(--ub-success);
	background: color-mix(in srgb, var(--ub-success) 8%, transparent);
}

.ub-form-wrap .ub-recaptcha-notice {
	margin: var(--ub-gap) 0 0;
	font-size: 0.8em;
	opacity: 0.7;
}

/* Honeypot: invisibile anche se il CSS inline viene rimosso */
.ub-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}
