/*
 * Gate Download - popup richiesta email e link di download protetti.
 * Caricato in <head> da functions/gate_download.php.
 */

.tethis-gate-link {
	display: inline-block;
	cursor: pointer;
}

body.tethis-gate-open {
	overflow: hidden;
}

/* -------------------------------------------------------------------------
 * Popup
 * ---------------------------------------------------------------------- */

.tethis-gate-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.tethis-gate-modal.is-open {
	display: flex;
}

.tethis-gate-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
}

.tethis-gate-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: 90vh;
	overflow: auto;
	box-sizing: border-box;
	padding: 32px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tethis-gate-modal__close {
	position: absolute;
	top: 10px;
	right: 14px;
	border: 0;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	color: #666;
	cursor: pointer;
}

.tethis-gate-modal__title {
	margin: 0 0 0.5rem;
	font-size: 1.6rem;
}

.tethis-gate-modal__extra {
	margin: 0 0 1.25rem;
}

/* -------------------------------------------------------------------------
 * Form
 * ---------------------------------------------------------------------- */

.tethis-gate-form__label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
}

.tethis-gate-form__input {
	width: 100%;
	box-sizing: border-box;
	margin-bottom: 14px;
	padding: 11px 12px;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 16px;
}

.tethis-gate-form__consent {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin-bottom: 16px;
	font-size: 13px;
	line-height: 1.4;
	color: #444;
}

.tethis-gate-form__consent input {
	flex: 0 0 auto;
	margin-top: 3px;
}

.tethis-gate-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/*
 * Submit del popup.
 *
 * Il pulsante è un <input type="submit"> (come il form di contatto) così
 * eredita la regola di brand del child theme (style.css:
 * .nectar-button, input[type="submit"] => bordo inferiore azzurro #99BDDF,
 * font-weight 800, font-size 1rem, transizione .5s) e le regole submit di
 * Salient (accent #005bae, hover azzurro).
 *
 * Qui sotto solo gli aggiustamenti di contesto: il popup vive fuori da
 * .container-wrap, quindi padding e border-radius non arriverebbero dal tema.
 */
.tethis-gate-modal .tethis-gate-form__submit {
	width: auto;
	padding: 15px 22px;
	border-radius: var(--nectar-border-radius, 0);
	text-align: center;
}

.tethis-gate-modal .tethis-gate-form__submit:disabled {
	opacity: 0.6;
	cursor: default;
}

/*
 * Variante inline (attributo form="true"): stesso form ma dentro la pagina.
 */
.tethis-gate-form--inline {
	max-width: 460px;
}

.tethis-gate-form--inline .tethis-gate-form__submit {
	width: auto;
	padding: 15px 22px;
	border-radius: var(--nectar-border-radius, 0);
	text-align: center;
}

.tethis-gate-form--inline .tethis-gate-form__submit:disabled {
	opacity: 0.6;
	cursor: default;
}

/*
 * Link di bypass "Just take me to the download": visibile solo con
 * mandatory="false".
 */
.tethis-gate-form__bypass {
	margin: 14px 0 0;
	font-size: 0.95rem;
}

.tethis-gate-form__bypass-link {
	color: var(--nectar-accent-color, #005bae);
	text-decoration: underline;
}

.tethis-gate-form__message {
	margin: 12px 0 0;
	min-height: 1em;
	font-size: 13px;
}

.tethis-gate-form__message.is-error {
	color: #c0392b;
}

.tethis-gate-form__message.is-info {
	color: #555;
}

.tethis-gate-error {
	color: #c0392b;
	font-size: 13px;
}
