/* JCA — Registration & Login forms */

.jca-reg {
	width: 100%;
	max-width: 520px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-family: inherit;
	color: inherit;
	background: transparent;
}

.jca-reg-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

@media (max-width: 520px) {
	.jca-reg-row {
		grid-template-columns: 1fr;
	}
}

.jca-reg-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.jca-reg-label {
	font-size: 13px;
	font-weight: 400 !important;
	letter-spacing: 0.01em;
	opacity: 0.95;
}

/* Inherit font on all form controls (fix the default browser override) */
.jca-reg input,
.jca-reg select,
.jca-reg textarea,
.jca-reg button {
	font-family: inherit;
	font-size: 15px;
	color: inherit;
}

.jca-reg input[type="text"],
.jca-reg input[type="email"],
.jca-reg input[type="password"],
.jca-reg input[type="date"],
.jca-reg input[type="number"],
.jca-reg select {
	width: 100%;
	height: 44px;
	padding: 0 18px;
	line-height: 1.4;
	border: 1px solid #cfcfcf;
	border-radius: 999px;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jca-reg input:focus,
.jca-reg select:focus {
	outline: 0;
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.18);
}

.jca-reg-hint {
	font-size: 12px;
	opacity: 0.7;
}

/* Inline feedbacks (CAP + password match) — versione ad alto contrasto.
   Pill con sfondo semi-trasparente colorato + testo molto chiaro: leggibile
   sia su sfondi chiari (Elementor form bianco) sia su sfondi scuri (sezione
   #143A5A o simile). */
.jca-reg-cap-feedback,
.jca-reg-pw-feedback {
	display: block;
	min-height: 0;
	font-size: 11px;
	line-height: 1.3;
	font-weight: 600;
	margin-top: 6px;
	padding: 4px 8px;
	border-radius: 5px;
	max-width: max-content;
	transition: opacity 0.4s ease;
}
.jca-reg-cap-feedback:empty,
.jca-reg-pw-feedback:empty {
	display: none;
	padding: 0;
}

/* Idle / checking: niente pill */
.jca-reg-cap-feedback[data-state="idle"],
.jca-reg-pw-feedback[data-state="idle"],
.jca-reg-cap-feedback[data-state="checking"] {
	background: transparent;
	color: rgba(255, 255, 255, 0.75);
	font-weight: 500;
	padding: 3px 0;
}

/* Verified — verde brillante (usato dal CAP valido + password match) */
.jca-reg-cap-feedback[data-state="verified"],
.jca-reg-pw-feedback[data-state="verified"] {
	background: rgba(34, 197, 94, 0.20);
	color: #4ade80;
	box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.50);
}

/* Accepted (legacy, attualmente non usato dal flusso CAP) */
.jca-reg-cap-feedback[data-state="accepted"] {
	background: rgba(250, 204, 21, 0.18);
	color: #fde047;
	box-shadow: inset 0 0 0 1px rgba(253, 224, 71, 0.40);
}

/* Error — rosso brillante */
.jca-reg-cap-feedback[data-state="error"],
.jca-reg-pw-feedback[data-state="error"] {
	background: rgba(239, 68, 68, 0.20);
	color: #fca5a5;
	box-shadow: inset 0 0 0 1px rgba(252, 165, 165, 0.45);
}

.jca-reg-cap-feedback::before,
.jca-reg-pw-feedback::before {
	display: inline-block;
	margin-right: 5px;
	font-weight: 700;
}
.jca-reg-cap-feedback[data-state="verified"]::before,
.jca-reg-pw-feedback[data-state="verified"]::before { content: "✓"; }
.jca-reg-cap-feedback[data-state="accepted"]::before { content: "!"; }
.jca-reg-cap-feedback[data-state="error"]::before,
.jca-reg-pw-feedback[data-state="error"]::before    { content: "✗"; }
.jca-reg-cap-feedback[data-state="checking"]::before { content: "…"; }

/* Field errors */
.jca-reg-field.is-invalid input,
.jca-reg-field.is-invalid select {
	border-color: #b32d2e;
	box-shadow: 0 0 0 3px rgba(179, 45, 46, 0.14);
}

.jca-reg-checkbox-field.is-invalid {
	color: #b32d2e;
}

.jca-reg-field-error {
	font-size: 12px;
	color: #b32d2e;
	margin-top: 2px;
}

/* Errors summary */
.jca-reg-errors {
	display: none;
}
.jca-reg-errors.is-visible {
	display: block;
	padding: 12px 14px;
	background: #fef1f1;
	border: 1px solid #f6caca;
	border-radius: 8px;
	color: #b32d2e;
	font-size: 14px;
}

/* Checkbox field (Terms, Remember me) */
.jca-reg-checkbox-field {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
}

.jca-reg-checkbox-field input[type="checkbox"] {
	margin: 2px 0 0;
	flex-shrink: 0;
}

.jca-reg-checkbox-field a {
	text-decoration: underline;
	color: inherit;
}

/* Inline row: remember me + forgot password link (login form) */
.jca-reg-inline {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.jca-reg-checkbox-inline {
	margin: 0;
}

.jca-reg-link {
	font-size: 13px;
	color: inherit;
	opacity: 0.85;
	text-decoration: underline;
}
.jca-reg-link:hover { opacity: 1; }

/* Submit button */
.jca-reg-btn {
	display: inline-block;
	padding: 14px 24px;
	background: #1d2327;
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease, opacity 0.15s ease;
}
.jca-reg-btn[hidden]    { display: none !important; }
.jca-reg-btn:hover  { background: #2c3338; }
.jca-reg-btn:disabled,
.jca-reg-btn.is-loading {
	opacity: 0.65;
	cursor: progress;
}

.jca-reg-submit { align-self: stretch; }

/* Already logged-in variant */
.jca-reg-already { text-align: center; padding: 32px 16px; }

/* Banner informativi (info/warning sopra al form) */
.jca-reg-banner {
	padding: 12px 14px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.45;
}
.jca-reg-banner-warning {
	background: #fff8e1;
	border: 1px solid #f6d68a;
	color: #7a5300;
}
.jca-reg-banner-info {
	background: #e7f1fd;
	border: 1px solid #b5d4f4;
	color: #0c447c;
}
.jca-reg-banner-success {
	background: #e6f7ec;
	border: 1px solid #95d8aa;
	color: #1a5d2e;
}

/* Activation pending (post-signup) */
.jca-reg-pending {
	text-align: center;
	padding: 24px 16px;
	max-width: 480px;
	margin: 0 auto;
}
.jca-reg-pending-icon {
	font-size: 48px;
	line-height: 1;
	margin-bottom: 14px;
	opacity: 0.6;
}
.jca-reg-pending-title {
	font-size: 22px;
	font-weight: 500;
	margin: 0 0 8px;
}
.jca-reg-pending-message {
	font-size: 15px;
	margin: 0 0 6px;
}
.jca-reg-pending-hint {
	font-size: 13px;
	opacity: 0.7;
	margin: 0 0 20px;
}
.jca-reg-pending-feedback {
	font-size: 13px;
	min-height: 18px;
	margin: 12px 0 0;
	opacity: 0.8;
}

/* Bottone secondario (contorno scuro, usato per "Resend") */
.jca-reg-btn-secondary {
	background: transparent;
	color: inherit;
	border: 1px solid currentColor;
}
.jca-reg-btn-secondary:hover { background: rgba(0, 0, 0, 0.04); }

/* Link-button inline (usato nel banner errore login) */
.jca-reg-link-btn {
	display: inline-block;
	background: transparent;
	color: inherit;
	border: 0;
	padding: 0;
	margin: 0;
	text-decoration: underline;
	font-size: 14px;
	font-family: inherit;
	cursor: pointer;
}
.jca-reg-link-btn:disabled { opacity: 0.5; cursor: default; }

/* Password field con toggle eye */
.jca-reg-password-wrap {
	position: relative;
	display: block;
}
.jca-reg-password-wrap input {
	padding-right: 44px;   /* spazio per il bottone eye */
}
.jca-reg-password-toggle {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	padding: 6px;
	cursor: pointer;
	color: inherit !important;
	opacity: 0.6;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.15s ease;
	line-height: 1;
}
.jca-reg-password-toggle:hover,
.jca-reg-password-toggle:focus,
.jca-reg-password-toggle:focus-visible,
.jca-reg-password-toggle:active {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	color: inherit !important;
	opacity: 1;
}
.jca-reg-password-toggle.is-visible { opacity: 1; }
.jca-reg-password-toggle svg {
	width: 20px;
	height: 20px;
	pointer-events: none;
}
.jca-reg-password-toggle * {
	pointer-events: none;
}

/* ============================================================ */
/*  Password eye toggle (registration form)                     */
/* ============================================================ */

.jca-reg-pw-wrap {
	position: relative;
	display: block;
}
.jca-reg-pw-wrap input[type="password"],
.jca-reg-pw-wrap input[type="text"] {
	width: 100%;
	padding-right: 44px; /* spazio per icona */
	box-sizing: border-box;
}
.jca-reg-pw-toggle {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	padding: 4px 6px;
	cursor: pointer;
	font-size: 1.1rem;
	color: inherit;
	opacity: 0.6;
	transition: opacity 0.15s ease;
	line-height: 1;
}
.jca-reg-pw-toggle:hover,
.jca-reg-pw-toggle:focus,
.jca-reg-pw-toggle:focus-visible,
.jca-reg-pw-toggle:active {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	opacity: 1;
}

/* ============================================================ */
/*  Legal (sostituisce il checkbox)                              */
/* ============================================================ */

.jca-reg-legal {
	margin: 4px 0 0 0;
	font-size: 11px;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.75);
	text-align: center;
}
.jca-reg-legal a {
	color: inherit;
	text-decoration: underline;
}

/* ============================================================ */
/*  Login form modifier (sfondo scuro, label bianche)            */
/* ============================================================ */

.jca-reg-login .jca-reg-label {
	color: #fff;
}
.jca-reg-login .jca-reg-link {
	color: rgba(255, 255, 255, 0.85);
}
.jca-reg-login .jca-reg-link:hover {
	color: #fff;
}
.jca-reg-login .jca-reg-checkbox-field span,
.jca-reg-login .jca-reg-pw-feedback {
	color: #fff;
}

/* Success message (es. forgot password) */
.jca-reg-success {
	padding: 12px 14px;
	border-radius: 6px;
	background: rgba(74, 222, 128, 0.15);
	color: #4ADE80;
	font-size: 14px;
	line-height: 1.45;
}
.jca-reg-login .jca-reg-success {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
}

/* ============================================================ */
/*  Forgot / Reset password buttons (override forzato)           */
/* ============================================================ */

#jca-pw-forgot-form .jca-reg-btn,
#jca-pw-reset-form .jca-reg-btn,
#jca-pw-forgot-form .jca-reg-btn:hover,
#jca-pw-reset-form .jca-reg-btn:hover,
#jca-pw-forgot-form .jca-reg-btn:focus,
#jca-pw-reset-form .jca-reg-btn:focus,
#jca-pw-forgot-form .jca-reg-btn:focus-visible,
#jca-pw-reset-form .jca-reg-btn:focus-visible,
#jca-pw-forgot-form .jca-reg-btn:active,
#jca-pw-reset-form .jca-reg-btn:active {
	background: #285F74 !important;
	color: #fff !important;
	border-color: #285F74 !important;
	outline: none !important;
}

/* ============================================================ */
/*  Override valori specifici per layout "partials"              */
/* ============================================================ */

.jca-register-partials .jca-reg-label{
	font-size:11px!important;
}
.jca-register-partials select,
.jca-login-partials select {
	border-radius: 14px !important;
	padding: 5px 15px !important;
	font-size: 14px !important;
	line-height: 1.2 !important;
	height: 36px !important;
}
.jca-register-partials input[type="text"], .jca-register-partials input[type="email"], .jca-register-partials input[type="password"], .jca-register-partials input[type="date"], .jca-register-partials select {
	border-radius: 18px!important;
	font-size:14px; !important
}
