/* CGE – Extensiones Ninja Forms: estilos para formularios con wrapper_class "cge-form" (tema Avada) */

.cge-form .nf-field-container {
	margin-bottom: 22px;
}

.cge-form .nf-field-label label {
	font-weight: 600;
	color: #001689;
}

.cge-form .nf-field-element input[type="text"],
.cge-form .nf-field-element input[type="email"],
.cge-form .nf-field-element input[type="tel"],
.cge-form .nf-field-element input[type="number"],
.cge-form .nf-field-element select,
.cge-form .nf-field-element textarea {
	width: 100%;
	box-sizing: border-box;
	height: auto;
	min-height: 46px;
	padding: 10px 14px;
	border: 1px solid #c9d0dc;
	border-radius: 4px;
	background: #fff;
	color: #333;
	font-size: 16px;
	line-height: 1.4;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.cge-form .nf-field-element select {
	background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23001689' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}

.cge-form .nf-field-element textarea {
	min-height: 110px;
}

.cge-form .nf-field-element input:focus,
.cge-form .nf-field-element select:focus,
.cge-form .nf-field-element textarea:focus {
	outline: none;
	border-color: #001689;
	box-shadow: 0 0 0 3px rgba(0, 22, 137, .12);
}

.cge-form .nf-error .nf-field-element input,
.cge-form .nf-error .nf-field-element select,
.cge-form .nf-error .nf-field-element textarea {
	border-color: #c0392b;
}

.cge-form .nf-error-msg,
.cge-form .nf-form-errors .nf-error-msg {
	color: #c0392b;
	font-size: 13px;
	margin-top: 6px;
}

.cge-form .nf-field-description {
	font-size: 13px;
	color: #555;
	margin: 2px 0 6px;
}

.cge-form .cge-form-seccion {
	font-size: 20px;
	line-height: 1.3;
	color: #001689;
	margin: 28px 0 8px;
	padding-bottom: 6px;
	border-bottom: 2px solid #f28c00;
}

.cge-form .nf-field-container:first-child .cge-form-seccion {
	margin-top: 8px;
}

.cge-form .cge-form-ayuda,
.cge-form .cge-form-aviso {
	font-size: 13px;
	color: #555;
	margin: 0 0 4px;
}

.cge-form .cge-form-aviso a {
	text-decoration: underline;
}

/* Bloque «Condiciones para el cambio de medidor» (formulario v2) */
.cge-form .cge-form-condiciones {
	margin: 4px 0 6px;
	padding: 14px 18px;
	border-left: 4px solid #f28c00;
	border-radius: 0 4px 4px 0;
	background: #f5f7fb;
	color: #222;
	font-size: 15px;
	line-height: 1.5;
}

.cge-form .cge-form-condiciones p {
	margin: 0 0 10px;
}

.cge-form .cge-form-condiciones p:last-child {
	margin-bottom: 0;
}

.cge-form .cge-form-condiciones strong {
	color: #001689;
	white-space: nowrap;
}

/* Lista numerada de costos (Avada quita viñetas/sangrías en algunos contenedores). */
.cge-form .cge-form-condiciones ol {
	margin: 0 0 10px 22px;
	padding: 0;
	list-style: decimal outside;
}

.cge-form .cge-form-condiciones ol li {
	margin: 0 0 6px;
	padding: 0;
	line-height: 1.5;
}

.cge-form .cge-form-condiciones ol li:last-child {
	margin-bottom: 0;
}

/* Casillas (aceptación de condiciones, solicitud previa) como tarjeta: casilla + etiqueta en una
   línea, descripción debajo; toda la tarjeta es clickeable (cge-forms.js); estados hover / foco /
   marcada / error. NF deja la etiqueta en una columna angosta y justificada: se anula aquí. */
.cge-form .checkbox-container {
	margin-bottom: 18px;
}

.cge-form .checkbox-container .field-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	text-align: left;
	padding: 14px 16px;
	border: 1px solid #c9d0dc;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.cge-form .checkbox-container .field-wrap:hover {
	border-color: #001689;
}

.cge-form .checkbox-container .field-wrap:has(input:focus-visible) {
	border-color: #001689;
	box-shadow: 0 0 0 3px rgba(0, 22, 137, .12);
}

.cge-form .checkbox-container .field-wrap:has(input:checked) {
	border-color: #001689;
	background: #f5f7fb;
}

.cge-form .checkbox-container .field-wrap.nf-error {
	border-color: #c0392b;
	background: #fff6f5;
}

.cge-form .checkbox-container .field-wrap .nf-field-element {
	order: 1;
	flex: 0 0 auto;
	width: auto;
	margin: 0;
	display: block;
}

.cge-form .checkbox-container .field-wrap .nf-field-element input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	position: relative;
	width: 22px;
	height: 22px;
	margin: 1px 12px 0 0;
	border: 2px solid #8a93a6;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}

.cge-form .checkbox-container .field-wrap .nf-field-element input[type="checkbox"]:hover {
	border-color: #001689;
}

.cge-form .checkbox-container .field-wrap .nf-field-element input[type="checkbox"]:focus {
	outline: none;
}

.cge-form .checkbox-container .field-wrap .nf-field-element input[type="checkbox"]:checked {
	border-color: #001689;
	background: #001689 url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3.2 3L13 4.5'/%3E%3C/svg%3E") center/14px no-repeat;
}

.cge-form .checkbox-container .field-wrap .nf-field-label {
	order: 2;
	flex: 1 1 0;
	width: auto;
	max-width: none;
	padding: 0;
	margin: 0;
	text-align: left;
	display: block;
}

.cge-form .checkbox-container .field-wrap .nf-field-label label {
	display: inline;
	font-weight: 600;
	font-size: 16px;
	color: #222;
	line-height: 1.45;
	cursor: pointer;
}

.cge-form .checkbox-container .field-wrap .nf-field-label label .ninja-forms-req-symbol {
	color: #f28c00;
}

.cge-form .checkbox-container .field-wrap.nf-error .nf-field-label label {
	color: #c0392b;
}

.cge-form .checkbox-container .field-wrap .nf-field-description {
	order: 3;
	flex: 0 0 100%;
	width: 100%;
	margin: 4px 0 0 34px;
	text-align: left;
	font-size: 13px;
	color: #555;
}

.cge-form .checkbox-container .nf-after-field .nf-error-msg {
	margin: 6px 0 0 16px;
}

/* Dos columnas sin el add-on «Layout & Styles»: grilla de 10 columnas sobre el contenedor de campos
   de NF; cada campo ocupa todo el ancho salvo los pares definidos abajo (mismas proporciones que el
   layout del .nff: Calle 70/Número 30, Región/Comuna, Nombre/RUT, Correo/Teléfono). Navegadores sin
   :has() (anteriores a 2023) muestran una sola columna, igual que hoy. */
.cge-form nf-fields-wrap {
	display: grid;
	grid-template-columns: repeat(10, minmax(0, 1fr));
	column-gap: 24px;
}

.cge-form nf-fields-wrap > nf-field {
	grid-column: 1 / -1;
	min-width: 0;
}

.cge-form nf-fields-wrap > nf-field:has([data-testid="nf-field-calle"]) {
	grid-column: span 7;
}

.cge-form nf-fields-wrap > nf-field:has([data-testid="nf-field-numero"]) {
	grid-column: span 3;
}

.cge-form nf-fields-wrap > nf-field:has([data-testid="nf-field-region"]),
.cge-form nf-fields-wrap > nf-field:has([data-testid="nf-field-comuna"]),
.cge-form nf-fields-wrap > nf-field:has([data-testid="nf-field-nombre"]),
.cge-form nf-fields-wrap > nf-field:has([data-testid="nf-field-rut"]),
.cge-form nf-fields-wrap > nf-field:has([data-testid="nf-field-correo"]),
.cge-form nf-fields-wrap > nf-field:has([data-testid="nf-field-telefono"]) {
	grid-column: span 5;
}

@media (max-width: 640px) {
	.cge-form nf-fields-wrap > nf-field {
		grid-column: 1 / -1 !important;
	}
}

/* v2, modo «ya envié una solicitud»: se ocultan los campos con container_class cge-ocultar-previa y
   se muestran los cge-previa-only (nota sobre el correo); el correo pasa a ancho completo. */
.cge-form .cge-previa-only,
.cge-form nf-fields-wrap > nf-field:has(.cge-previa-only) {
	display: none;
}

.cge-form.cge-modo-previa .cge-previa-only,
.cge-form.cge-modo-previa nf-fields-wrap > nf-field:has(.cge-previa-only) {
	display: block;
}

.cge-form.cge-modo-previa .cge-ocultar-previa,
.cge-form.cge-modo-previa nf-fields-wrap > nf-field:has(.cge-ocultar-previa) {
	display: none;
}

.cge-form.cge-modo-previa nf-fields-wrap > nf-field:has([data-testid="nf-field-correo"]) {
	grid-column: 1 / -1;
}

.cge-form input[type="button"].ninja-forms-field,
.cge-form input[type="submit"].ninja-forms-field {
	display: inline-block;
	width: auto;
	min-height: 46px;
	padding: 12px 32px;
	border: 0;
	border-radius: 4px;
	background: #001689;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease;
}

.cge-form input[type="button"].ninja-forms-field:hover,
.cge-form input[type="button"].ninja-forms-field:focus {
	background: #0a2bb8;
	color: #fff;
}

.cge-form .nf-response-msg {
	padding: 16px 20px;
	border-left: 4px solid #f28c00;
	background: #f5f7fb;
	color: #222;
}

.cge-form .nf-form-fields-required {
	font-size: 13px;
	color: #555;
	margin-bottom: 10px;
}

.cge-form .nf-field-element input::placeholder,
.cge-form .nf-field-element textarea::placeholder {
	color: #8a93a6;
	opacity: 1;
}
