/**
 * Capital Femenino — Gravity Forms styling (Aplicación y futuros formularios CF).
 * Sobrescribe el CSS API del theme framework (Orbital) de Gravity Forms 3.
 * Solo se encola en páginas que incrustan un bloque gravityforms/form.
 */

/* ---- CSS API overrides de Gravity Forms ----
   Los controles y el contenedor de campos redefinen las variables en el
   elemento: así ganan sobre las reglas #id que el propio GF emite en el
   <style> del wrapper. En la versión sin framework (gravity-theme) las
   reglas directas de abajo dan el diseño aunque las vars no existan. */

.cf-solicitud_wrapper {
	font-family: var(--wp--preset--font-family--instrument-sans);
	color: var(--wp--preset--color--ink);
}

.cf-solicitud_wrapper .gform_fields {
	--gf-color-danger: var(--wp--preset--color--burgundy);
	--gf-field-gap-x: 28px;
	--gf-field-gap-y: 40px;
	--gf-field-choice-gap: 8px;
	--gf-desc-space: 10px;
}

.cf-solicitud .gform-field-label {
	--gf-ctrl-label-color-primary: var(--wp--preset--color--ink);
}

.cf-solicitud .gfield_description {
	--gf-ctrl-label-color-secondary: var(--wp--custom--tint--ink-66);
}

/* ---- Estructura ---- */

.cf-solicitud_wrapper .gfield {
	margin-block-start: 40px;
}

/* Honeypot: oculto fuera de pantalla (GF también lo hace vía foundation). */
.cf-solicitud .gform_validation_container {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

/* Marcadores de sección: borde superior 2px + etiqueta */
.cf-solicitud .gsection {
	border-top: 2px solid var(--wp--preset--color--ink);
	padding-top: 18px;
	margin-block-start: 0;
}

.cf-solicitud .gsection.mf-app-section--gap {
	margin-block-start: 32px;
}

.cf-solicitud .gsection .gsection_title {
	margin: 0;
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink);
	padding-top: 20px;
}

.page-id-19121 .gform_wrapper.gravity-theme .gsection {
	border-bottom: none;
}

/* Preguntas: Playfair 700 20px */
.cf-solicitud .gform-field-label:not(.gform-field-label--type-inline) .gform-field-label__text {
	font-family: var(--wp--preset--font-family--display);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.015em;
	color: var(--wp--preset--color--ink);
}

/* "(opcional)" */
.cf-solicitud .mf-optional .gform-field-label__text::after {
	content: "(opcional)";
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-weight: 400;
	font-size: 12px;
	color: var(--wp--custom--tint--ink-60);
	margin-inline-start: 6px;
}

/* Enlaces dentro del formulario (consentimiento): burdeos */
.cf-solicitud a {
	color: var(--wp--preset--color--burgundy);
	text-underline-offset: 3px;
}

/* Indicador "(Required)": oculto visualmente, accesible */
.cf-solicitud .gfield_required {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Descripciones (sublabel) */
.cf-solicitud .gfield_description {
	font-size: 15px;
	line-height: 1.55;
	color: var(--wp--custom--tint--ink-66);
}

/* Mensajes de validación */
.cf-solicitud .gfield_validation_message {
	font-size: 12px;
	color: var(--wp--preset--color--burgundy);
}

/* ---- Controles: subrayado ---- */

.cf-solicitud_wrapper .cf-solicitud .ginput_container input[type="text"],
.cf-solicitud_wrapper .cf-solicitud .ginput_container input[type="email"],
.cf-solicitud_wrapper .cf-solicitud .ginput_container input[type="tel"],
.cf-solicitud_wrapper .cf-solicitud .ginput_container input[type="url"],
.cf-solicitud_wrapper .cf-solicitud .ginput_container textarea {
	--gf-ctrl-bg-color: transparent;
	--gf-ctrl-bg-color-focus: transparent;
	--gf-ctrl-bg-color-hover: transparent;
	--gf-ctrl-bg-color-error: transparent;
	--gf-ctrl-border-color: var(--wp--custom--tint--ink-40);
	--gf-ctrl-border-color-focus: var(--wp--preset--color--burgundy);
	--gf-ctrl-border-color-hover: var(--wp--custom--tint--ink-40);
	--gf-ctrl-border-width: 0px;
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 17px;
	color: var(--wp--preset--color--ink);
	background: transparent;
	border: none;
	border-bottom: 1px solid var(--wp--custom--tint--ink-40);
	border-radius: 0;
	padding: 10px 0;
	width: 100%;
	transition: border-color 0.2s ease;
}

.cf-solicitud_wrapper .cf-solicitud .ginput_container input:focus,
.cf-solicitud_wrapper .cf-solicitud .ginput_container textarea:focus {
	border-bottom-color: var(--wp--preset--color--burgundy);
	outline: none;
}

.cf-solicitud ::placeholder {
	color: var(--wp--custom--tint--ink-38);
	opacity: 1;
}

/* !important: el CSS de GF (básico 3.1.x y framework Orbital) impone o
   deshace la altura del textarea con sus propios mecanismos; sin él el
   campo vuelve a 192px en ambos entornos. */
.cf-solicitud_wrapper .cf-solicitud .ginput_container textarea {
	padding: 8px 0;
	height: 69px !important;
	min-height: 69px !important;
	line-height: 1.55;
	resize: vertical;
}

/* ---- Elecciones: chips (facturación / objetivo) ---- */

.cf-solicitud .mf-chips .gfield_radio {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

.cf-solicitud .mf-chips--2 .gfield_radio {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cf-solicitud .mf-chips .gchoice {
	position: relative;
}

.cf-solicitud .mf-chips .gchoice .gfield-choice-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	margin: 0;
}

.cf-solicitud .mf-chips .gchoice label.gform-field-label--type-inline {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 14px 10px;
	border: 1px solid var(--wp--custom--tint--ink-30);
	background: transparent;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 15px;
	text-align: center;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cf-solicitud .mf-chips--2 .gchoice label.gform-field-label--type-inline {
	justify-content: flex-start;
	text-align: left;
	padding: 14px 16px;
}

.cf-solicitud .mf-chips .gchoice label.gform-field-label--type-inline:hover {
	border-color: var(--wp--preset--color--ink);
}

.cf-solicitud .mf-chips .gchoice .gfield-choice-input:checked + .gform-field-label--type-inline {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
}

.cf-solicitud .mf-chips .gchoice .gfield-choice-input:focus-visible + .gform-field-label--type-inline {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 3px;
}

/* ---- Elecciones: lista con cuadrado (qué mejorar / inversión) ---- */

.cf-solicitud .mf-mejora-max3 .gfield_checkbox,
.cf-solicitud .mf-radiodots .gfield_radio {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cf-solicitud .mf-mejora-max3 .gchoice,
.cf-solicitud .mf-radiodots .gchoice {
	position: relative;
	display: flex;
}

.cf-solicitud .mf-mejora-max3 .gchoice .gfield-choice-input,
.cf-solicitud .mf-radiodots .gchoice .gfield-choice-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	margin: 0;
}

.cf-solicitud .mf-mejora-max3 .gchoice label.gform-field-label--type-inline,
.cf-solicitud .mf-radiodots .gchoice label.gform-field-label--type-inline {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 50px;
	padding: 15px 18px;
	border: 1px solid var(--wp--custom--tint--ink-30);
	background: transparent;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 15px;
	text-align: left;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cf-solicitud .mf-mejora-max3 .gchoice label.gform-field-label--type-inline::before,
.cf-solicitud .mf-radiodots .gchoice label.gform-field-label--type-inline::before {
	content: "";
	flex: none;
	width: 10px;
	height: 10px;
	box-sizing: border-box;
	border: 1px solid currentColor;
	background: transparent;
	transition: background 0.2s ease;
}

.cf-solicitud .mf-mejora-max3 .gchoice label.gform-field-label--type-inline:hover,
.cf-solicitud .mf-radiodots .gchoice label.gform-field-label--type-inline:hover {
	border-color: var(--wp--preset--color--ink);
}

.cf-solicitud .mf-mejora-max3 .gchoice .gfield-choice-input:checked + .gform-field-label--type-inline,
.cf-solicitud .mf-radiodots .gchoice .gfield-choice-input:checked + .gform-field-label--type-inline {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
}

.cf-solicitud .mf-mejora-max3 .gchoice .gfield-choice-input:checked + .gform-field-label--type-inline::before,
.cf-solicitud .mf-radiodots .gchoice .gfield-choice-input:checked + .gform-field-label--type-inline::before {
	background: var(--wp--preset--color--gold);
	border-color: var(--wp--preset--color--gold);
}

.cf-solicitud .mf-mejora-max3 .gchoice .gfield-choice-input:focus-visible + .gform-field-label--type-inline,
.cf-solicitud .mf-radiodots .gchoice .gfield-choice-input:focus-visible + .gform-field-label--type-inline {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 3px;
}

/* Límite de tres opciones alcanzado (lo aplica cf-forms.js) */
.cf-solicitud .mf-choice-disabled .gform-field-label--type-inline,
.cf-solicitud .gform-field-label--type-inline[data-disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

/* ---- Consentimiento ---- */

.cf-solicitud input[type="checkbox"],
.cf-solicitud input[type="checkbox"].gform-choice-input {
	width: 18px;
	height: 18px;
	flex: none;
	margin: 1px 0 0;
	accent-color: var(--wp--preset--color--burgundy);
	cursor: pointer;
}

.cf-solicitud .gfield--type-consent .ginput_container_consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.cf-solicitud .gfield_consent_label {
	font-size: 15px;
	line-height: 1.5;
	cursor: pointer;
}

/* ---- Botón de envío ---- */

.cf-solicitud .gform-footer.gform_footer {
	padding-top: 6px;
}

.cf-solicitud_wrapper .cf-solicitud .gform_button {
	--gf-ctrl-btn-bg-color-primary: var(--wp--preset--color--ink);
	--gf-ctrl-btn-color-primary: var(--wp--preset--color--cream);
	--gf-ctrl-btn-color-hover-primary: var(--wp--preset--color--gold);
	--gf-ctrl-btn-color-focus-primary: var(--wp--preset--color--gold);
	--gf-ctrl-btn-font-size: 12px;
	--gf-ctrl-btn-padding-x: 34px;
	--gf-ctrl-btn-padding-y: 21px;
	--gf-ctrl-btn-border-width-ctrl: 0px;
	--gf-ctrl-btn-border-width-primary: 0px;
	display: inline-block;
	border: none;
	border-radius: 0;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	cursor: pointer;
	padding: 21px 34px;
	transition: background 0.28s ease, color 0.28s ease;
}

.cf-solicitud_wrapper .cf-solicitud .gform_button:hover,
.cf-solicitud_wrapper .cf-solicitud .gform_button:focus-visible {
	color: var(--wp--preset--color--gold);
}

/* ---- Confirmación (solicitud recibida) ---- */

.gform_confirmation_wrapper {
	max-width: 56ch;
	padding-top: 28px;
	border-top: 2px solid var(--wp--preset--color--ink);
}

.gform_confirmation_wrapper .mf-app-confirm-label {
	margin: 0;
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 11px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold);
}

.gform_confirmation_wrapper .mf-app-confirm-title {
	margin: 16px 0 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.03em;
	color: var(--wp--preset--color--ink);
}

.gform_confirmation_wrapper p:not(.mf-app-confirm-label):not(.mf-app-confirm-title) {
	margin: 16px 0 0;
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 17px;
	line-height: 1.7;
	color: var(--wp--custom--tint--ink-80);
}

/* ---- Responsive ---- */

@media (max-width: 860px) {
	.cf-solicitud_wrapper .cf-solicitud .mf-chips .gfield_radio {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	.cf-solicitud_wrapper .cf-solicitud .mf-chips--2 .gfield_radio {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}

/* ---- Movimiento reducido ---- */

@media (prefers-reduced-motion: reduce) {
	.cf-solicitud input,
	.cf-solicitud textarea,
	.cf-solicitud .gform-field-label--type-inline,
	.cf-solicitud .gform-field-label--type-inline::before,
	.cf-solicitud .gform_button {
		transition: none;
	}
}